LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-25-2012, 12:26 PM   #1
borgy95
Member
 
Registered: Mar 2012
Location: England
Distribution: Debian, Kali, CentOS 7
Posts: 64

Rep: Reputation: Disabled
How to config route from nic B>C so A can talk to D


Right this is not really LInux so please forgive me, although it would be no different if it was pure linux, and NO other damn site seems to have an answer and i can't be the first person in the world to try this. So im hoping you guys can rock my world.

Here is the million dollar problem:
Quote:
I have an issue with some traffic routing i can't quite figure: i'll try map out blow what im aiming to do.

Machine A || Machine B (Win 2008 R2) || Machine C
Start: 192.168.5.9 > 192.168.5.5 (NIC 1) - 10.14.137.113 (NIC 2) > 10.14.137.128

So the question is how do I get traffic from Machine A to Machine C. I've tried various 'Route ADD' cmds but no luck so far. So was hoping someone out there could shed some light for me?

Machine B is a AD/DNS and can talk to the entire 10.14.137.x range but has no forwarders set up in DNS. And does not act as a AD/DNS server for the 10.14.137.x range. It fills these roles only for the 192.1668.5.x range. It also has RRAS installed already.
So far machine A can talk to NIC 2 on machine B via
Code:
route ADD 10.14.137.113 MASK 255.255.255.255 192.168.5.5
But beyond that i just can't get it to communicate, what am i doing wrong?
Does machine B need some kind of route forwarding rule?
 
Old 09-25-2012, 01:47 PM   #2
whizje
Member
 
Registered: Sep 2008
Location: The Netherlands
Distribution: Slackware64 current
Posts: 594

Rep: Reputation: 141Reputation: 141
This should do it.
Code:
route ADD 10.14.137.113 MASK 255.255.255.0
route ADD 192.168.5.5 MASK 255.255.255.0
 
1 members found this post helpful.
Old 09-26-2012, 09:41 AM   #3
borgy95
Member
 
Registered: Mar 2012
Location: England
Distribution: Debian, Kali, CentOS 7
Posts: 64

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by whizje View Post
This should do it.
Code:
route ADD 10.14.137.113 MASK 255.255.255.0
route ADD 192.168.5.5 MASK 255.255.255.0
So i had tried something like that. and yes it allow traffic from 192.168.5.9 > 10.14.137.113 but nothing goes beyond it can't figure it out. So im still in the same situation it seems if the destination is set as 10.14.137.128 but it first has to route via 192.168.5.5 then via 10.14.137.113 there is a lose of direction. So i need to figure out how to tell all packets destined for 10.14.137.128 from 192.168.5.9 that there are two ports of call: 1st: 192.168.5.5 2nd: 10.14.137.113.

How can i do this?

..and thanks
 
Old 09-26-2012, 09:49 AM   #4
KatrinAlec
Member
 
Registered: Feb 2012
Posts: 116

Rep: Reputation: 13
is IP forwarding active on B?
 
Old 09-26-2012, 10:33 AM   #5
Joaquim Almeida
LQ Newbie
 
Registered: Sep 2012
Posts: 7

Rep: Reputation: Disabled
Are you trying to make your server act as a router? If so, have you done a RIP configuration? Here is one tutorial that explains it quite well.

For a better support maybe you should paste the routing tables of the 3 machines.
 
1 members found this post helpful.
Old 09-26-2012, 11:51 AM   #6
borgy95
Member
 
Registered: Mar 2012
Location: England
Distribution: Debian, Kali, CentOS 7
Posts: 64

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by KatrinAlec View Post
is IP forwarding active on B?
It wasn't but done that now.
so i guess i'll need a rule to forward from one nic to another if the packet is trying to get 10.14.137.113?

(please be patient with me... im really not a networking buff)
 
Old 09-27-2012, 02:02 AM   #7
KatrinAlec
Member
 
Registered: Feb 2012
Posts: 116

Rep: Reputation: 13
You need a route and you need to let it thorugh your firewall.
you can look up the routes with
Code:
ip route
and the firewall with
Code:
iptables -L
In the firewall it's the table called Chain FORWARD where you have to make the appropriate settings.

you can check your routing with
Code:
ip route get 10.14.137.128
it will tell you which interface it will go to.

You can check your firewall with
Code:
iptables -L -v
that will show you statistics if an entry of your firewall gets used at all.
 
Old 09-27-2012, 07:25 AM   #8
borgy95
Member
 
Registered: Mar 2012
Location: England
Distribution: Debian, Kali, CentOS 7
Posts: 64

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Joaquim Almeida View Post
Are you trying to make your server act as a router? If so, have you done a RIP configuration? Here is one tutorial that explains it quite well.

For a better support maybe you should paste the routing tables of the 3 machines.
Tutorial helped i wasn't aware of that step. I have now done that. Still not getting the traffic going across here are the routing table to help figure this out. There are no firewalsl on machine A, B or C.

I have attached the routing tables as pngs (sorry for the incovenience could not copy/paste em in here.) also haven't bothred with Machine C's as i only need traffic to go from A-C

thanks joaquim and others
Attached Thumbnails
Click image for larger version

Name:	MachineA.png
Views:	9
Size:	15.3 KB
ID:	10784   Click image for larger version

Name:	machineB.png
Views:	6
Size:	18.9 KB
ID:	10785  
 
Old 09-27-2012, 07:39 AM   #9
KatrinAlec
Member
 
Registered: Feb 2012
Posts: 116

Rep: Reputation: 13
Quote:
Machine A || Machine B (Win 2008 R2) || Machine C
Start: 192.168.5.9 > 192.168.5.5 (NIC 1) - 10.14.137.113 (NIC 2) > 10.14.137.128
It seems to me that your machine B (the black background?) has the wrong subnet.
At least you don't seem to have a route to machine C.
it says 10.14.137.113 is host only (255.255.255.255). So the default routing will be used, which doesn't send the data to machine C.

either change the subnet or add a route for 10.14.137.128.

And you do need a route back from C over B to A, so that A can reply. You won't be able to establish a TCP connection if C can't answer,
the the routing in C is important as well.
 
1 members found this post helpful.
Old 09-27-2012, 09:01 AM   #10
borgy95
Member
 
Registered: Mar 2012
Location: England
Distribution: Debian, Kali, CentOS 7
Posts: 64

Original Poster
Rep: Reputation: Disabled
ahh really didn't know 255.255.255.255 means the route is for host only.

so should the route be something along the lines:

On Tunis:
Code:
route 10.14.137.128 MASK 255.255.252.0 192.0.168.5.5
is the route is disallowed. as apparently it "manipulates the routing table"

what kind of route would u recommend? is there a site that can teach me in depth this stuff, cos im clearly holding some serious knowledge gaps.

ok i'll config a route back as well in that case for C-A communiation.
 
Old 09-27-2012, 09:26 AM   #11
KatrinAlec
Member
 
Registered: Feb 2012
Posts: 116

Rep: Reputation: 13
on B
route ADD 10.14.137.128 10.14.137.113

That should send packets to .113 through .128
 
1 members found this post helpful.
Old 09-27-2012, 08:14 PM   #12
Joaquim Almeida
LQ Newbie
 
Registered: Sep 2012
Posts: 7

Rep: Reputation: Disabled
In my opinion this isn't a routing question because server knows its subnet. If you had, say 1.2.3.4 then the server didn't know which interface to send from, so it needs help (routing)!

This is a forwarding issue; RIP or NAT should solve your problem. I find very odd that you didn't manage to get it working with dynamic routing in WS2008 by using RIP. Try NAT instead: here.

Anyway, let's see a "talk" between systems:
Code:
A:
192.168.5.9

B:
192.168.5.5
10.14.137.113

C:
10.14.137.128

User at A issue "ping 10.14.137.128":
A: Do I have any route to 10.14.137.128?              > No
A: What is my default gateway?                        > Default gateway: 192.168.5.5
A: Send icmp through 192.168.5.9 to 192.168.5.5

B: Received icmp packet from 192.168.5.9. Where to?   > 10.14.137.128
B: Do I have any route to 10.14.137.128?              > Yes
B: What is route to 10.14.137.128                     > 10.14.137.113
B: Send icmp through 10.14.137.113 to 10.14.137.128

C: Got icmp ping packet for me from 192.168.5.9. Have to answer back. Send icmp answer to 192.168.5.9
C: Do I have any route to 192.168.5.9?                > No
C: What is my default gateway?                        > Default gateway: 10.14.137.113
C: Send icmp through 10.14.137.128 to 10.14.137.113

B: Received icmp packet from 10.14.137.128. Where to? > 192.168.5.9
B: Do I have any route to 192.168.5.9?                > Yes
B: What is route to 192.168.5.9                       > 192.168.5.5
B: Send icmp through 192.168.5.5 to 192.168.5.9

A: Got icmp ping answer packet for me from 10.14.137.128. Done.
So, since A and C have default gateways, only B server needs to know where to send packets.
The route table in your screenshot is incomplete. Above the table are interface parameters. You will need to match the id's with the interface. In this example interface 0 means subnet that contains A and interface 1 means the other (if 0 and if 1, respectively):
Code:
route -p add 10.14.137.128 mask 255.255.255.255 10.14.137.113 if 1
route -p add 192.168.5.9 mask 255.255.255.255 192.168.5.5 if 0
Hope it solves.

Last edited by Joaquim Almeida; 09-27-2012 at 08:16 PM.
 
2 members found this post helpful.
Old 09-28-2012, 05:23 AM   #13
borgy95
Member
 
Registered: Mar 2012
Location: England
Distribution: Debian, Kali, CentOS 7
Posts: 64

Original Poster
Rep: Reputation: Disabled
I added a route from A-C and that worked straight off no problem. After that A-C started communicting which is abit odd. but at least it's working.

i had tried
Code:
 route ADD 10.14.136.0 MASK 255.255.255.255 10.14.137.113
and that didnt change anything so it's all abit odd. but working so im kinda content to leave it at that.

joaquim, katrin thanks for helping me out. espcially the detail you guys have given me.. i'll be rmbring this thread.
 
Old 09-28-2012, 07:24 AM   #14
borgy95
Member
 
Registered: Mar 2012
Location: England
Distribution: Debian, Kali, CentOS 7
Posts: 64

Original Poster
Rep: Reputation: Disabled
And here is the corker, figured out why no ping reply was coming! there was no return route! i do feel daft..

thanks again
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to talk to network after configuring a second NIC. RossR Linux - Networking 9 08-06-2009 03:40 PM
Adding a route for use with 2 NIC Roverius Linux - Networking 3 02-18-2008 06:43 AM
Routing/iptables - can't talk to outside nic from inside swagger Linux - Networking 3 07-29-2007 02:19 PM
Problems getting NIC to talk to my router Draylath Ubuntu 18 06-28-2007 04:45 PM
unable to route with ip alias using one NIC simayi Linux - Networking 0 10-27-2004 04:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration