Networking Forums

Networking Forums > Computer Networking > Linux Networking > Simple routing question...

Reply
Thread Tools Display Modes

Simple routing question...

 
 
Christian Williamson
Guest
Posts: n/a

 
      07-08-2007, 12:35 PM
I have two physical networks, and I want to set up a Linux router
between them.

1. I have Computer A with IP address 192.9.200.1 on Network 1.

2. I have Linux Computer B on Network 1, with an ethernet interface
having the address of 192.9.200.2. That same Linux Computer B has
another ethernet interface with address 7.48.29.220 on Network 2.

3. Finally, I have Computer C with IP address 7.48.29.221 on Network
2.

I want Computer A to talk to Computer C, and I want Computer C to talk
to Computer A. The question is: How do I set up Computers A, B, and C
to make this happen?

I think I have to do the following:

o Add a route to Computer A that says whenever I want to send to
Computer C, go through Computer B.

route add <Computer C - 7.48.29.221> <Computer B - 192.9.200.2>

o Set up Computer B to pass packets from both networks

turn on IP packet forwarding
Is that all? Or do I need to add routes like this?

route add 192.9.200.1 <Network 1>
route add 7.48.29.221 <Network 2>

o Add a route to Computer C that says whenever I want to send to
Computer A, go through Computer B.

route add <Computer A - 192.9.200.1> <Computer B - 7.48.29.220>

Does this look right?
 
Reply With Quote
 
 
 
 
Moe Trin
Guest
Posts: n/a

 
      07-08-2007, 03:36 PM
On Sun, 08 Jul 2007, in the Usenet newsgroup comp.os.linux.networking, in
article <WR4ki.11810$g44.4266@trnddc02>, Christian Williamson wrote:

>I have two physical networks, and I want to set up a Linux router
>between them.


Been done tens of thousands of times. Did you glance through the
HOWTOs that should be included on your system?

40490 Jun 22 2000 Home-Network-mini-HOWTO
45604 Apr 18 2006 Networking-Overview-HOWTO
71626 Apr 4 2004 Unix-and-Internet-Fundamentals-HOWTO

Those are merely the first ones to come to mind. There is also the
Linux Network Administrator's Guide from the LDP - also should be on
your system - look for the 'nag2'

>1. I have Computer A with IP address 192.9.200.1 on Network 1.
>
>2. I have Linux Computer B on Network 1, with an ethernet interface
> having the address of 192.9.200.2. That same Linux Computer B has
> another ethernet interface with address 7.48.29.220 on Network 2.
>
>3. Finally, I have Computer C with IP address 7.48.29.221 on Network
> 2.


OK - but see RFC3330 which lists a whole bunch of address ranges you
can use - rather than "real" ones (192.9.200.1 is assigned to Sun
Microsystems - 7.48.29.221 is a reserved address).

>I want Computer A to talk to Computer C, and I want Computer C to talk
>to Computer A. The question is: How do I set up Computers A, B, and C
>to make this happen?
>
>I think I have to do the following:
>
>o Add a route to Computer A that says whenever I want to send to
> Computer C, go through Computer B.
>
> route add <Computer C - 7.48.29.221> <Computer B - 192.9.200.2>


man route the syntax could be

/sbin/route add -host 7.48.29.221 -gw 192.9.200.2

but all distributions have their own "cute" helper programs that can
be configured to do this. Each distribution knows how to do it better
than anyone else, so each uses different files and different formats.

>o Set up Computer B to pass packets from both networks
>
> turn on IP packet forwarding
> Is that all?


Basically, yes. Again, each distribution has their own cute way of
configuring this, but the results are the same.

>Or do I need to add routes like this?
>
> route add 192.9.200.1 <Network 1>
> route add 7.48.29.221 <Network 2>


Those should be added automatically when the boot scripts bring up
each interface.

>o Add a route to Computer C that says whenever I want to send to
> Computer A, go through Computer B.


As above

>Does this look right?


On computer "A" and assuming a /24 mask, rather than host routes, and
ignoring the loopback:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.9.200.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
7.48.29.0 192.9.200.2 255.255.255.0 UG 0 0 0 eth0

On computer "B":

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.9.200.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
7.48.29.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1

On computer "C":

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
7.48.29.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.9.200.0 7.48.29.220 255.255.255.0 UG 0 0 0 eth0

Piece of cake!

Old guy

 
Reply With Quote
 
Christian Williamson
Guest
Posts: n/a

 
      07-08-2007, 03:43 PM
Moe Trin wrote:
> On Sun, 08 Jul 2007, in the Usenet newsgroup comp.os.linux.networking, in
> article <WR4ki.11810$g44.4266@trnddc02>, Christian Williamson wrote:
>
>> I have two physical networks, and I want to set up a Linux router
>> between them.

>
> Been done tens of thousands of times. Did you glance through the
> HOWTOs that should be included on your system?
>
> 40490 Jun 22 2000 Home-Network-mini-HOWTO
> 45604 Apr 18 2006 Networking-Overview-HOWTO
> 71626 Apr 4 2004 Unix-and-Internet-Fundamentals-HOWTO
>
> Those are merely the first ones to come to mind. There is also the
> Linux Network Administrator's Guide from the LDP - also should be on
> your system - look for the 'nag2'
>
>> 1. I have Computer A with IP address 192.9.200.1 on Network 1.
>>
>> 2. I have Linux Computer B on Network 1, with an ethernet interface
>> having the address of 192.9.200.2. That same Linux Computer B has
>> another ethernet interface with address 7.48.29.220 on Network 2.
>>
>> 3. Finally, I have Computer C with IP address 7.48.29.221 on Network
>> 2.

>
> OK - but see RFC3330 which lists a whole bunch of address ranges you
> can use - rather than "real" ones (192.9.200.1 is assigned to Sun
> Microsystems - 7.48.29.221 is a reserved address).
>
>> I want Computer A to talk to Computer C, and I want Computer C to talk
>> to Computer A. The question is: How do I set up Computers A, B, and C
>> to make this happen?
>>
>> I think I have to do the following:
>>
>> o Add a route to Computer A that says whenever I want to send to
>> Computer C, go through Computer B.
>>
>> route add <Computer C - 7.48.29.221> <Computer B - 192.9.200.2>

>
> man route the syntax could be
>
> /sbin/route add -host 7.48.29.221 -gw 192.9.200.2
>
> but all distributions have their own "cute" helper programs that can
> be configured to do this. Each distribution knows how to do it better
> than anyone else, so each uses different files and different formats.
>
>> o Set up Computer B to pass packets from both networks
>>
>> turn on IP packet forwarding
>> Is that all?

>
> Basically, yes. Again, each distribution has their own cute way of
> configuring this, but the results are the same.
>
>> Or do I need to add routes like this?
>>
>> route add 192.9.200.1 <Network 1>
>> route add 7.48.29.221 <Network 2>

>
> Those should be added automatically when the boot scripts bring up
> each interface.
>
>> o Add a route to Computer C that says whenever I want to send to
>> Computer A, go through Computer B.

>
> As above
>
>> Does this look right?

>
> On computer "A" and assuming a /24 mask, rather than host routes, and
> ignoring the loopback:
>
> Kernel IP routing table
> Destination Gateway Genmask Flags Metric Ref Use Iface
> 192.9.200.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
> 7.48.29.0 192.9.200.2 255.255.255.0 UG 0 0 0 eth0
>
> On computer "B":
>
> Kernel IP routing table
> Destination Gateway Genmask Flags Metric Ref Use Iface
> 192.9.200.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
> 7.48.29.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
>
> On computer "C":
>
> Kernel IP routing table
> Destination Gateway Genmask Flags Metric Ref Use Iface
> 7.48.29.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
> 192.9.200.0 7.48.29.220 255.255.255.0 UG 0 0 0 eth0
>
> Piece of cake!
>
> Old guy
>


Thanks much, Moe! I'll give it a try, let you know how it goes.
 
Reply With Quote
 
NPG
Guest
Posts: n/a

 
      07-16-2007, 07:46 PM
* Moe Trin wrote:
> On Sun, 08 Jul 2007, in the Usenet newsgroup comp.os.linux.networking, in
> article <WR4ki.11810$g44.4266@trnddc02>, Christian Williamson wrote:
>
>> I have two physical networks, and I want to set up a Linux router
>> between them.

>
> Been done tens of thousands of times. Did you glance through the
> HOWTOs that should be included on your system?
>
> 40490 Jun 22 2000 Home-Network-mini-HOWTO
> 45604 Apr 18 2006 Networking-Overview-HOWTO
> 71626 Apr 4 2004 Unix-and-Internet-Fundamentals-HOWTO
>
> Those are merely the first ones to come to mind. There is also the
> Linux Network Administrator's Guide from the LDP - also should be on
> your system - look for the 'nag2'
>
>> 1. I have Computer A with IP address 192.9.200.1 on Network 1.
>>
>> 2. I have Linux Computer B on Network 1, with an ethernet interface
>> having the address of 192.9.200.2. That same Linux Computer B has
>> another ethernet interface with address 7.48.29.220 on Network 2.
>>
>> 3. Finally, I have Computer C with IP address 7.48.29.221 on Network
>> 2.

>
> OK - but see RFC3330 which lists a whole bunch of address ranges you
> can use - rather than "real" ones (192.9.200.1 is assigned to Sun
> Microsystems - 7.48.29.221 is a reserved address).
>

7.48.29.221 is assigned to the DoD NIC
 
Reply With Quote
 
Moe Trin
Guest
Posts: n/a

 
      07-18-2007, 12:31 AM
On Mon, 16 Jul 2007, in the Usenet newsgroup comp.os.linux.networking, in
article <f7ghu2$hkb$(E-Mail Removed)>, NPG wrote:

>* Moe Trin wrote:


>> 7.48.29.221 is a reserved address).

>
>7.48.29.221 is assigned to the DoD NIC


IANA says it's reserved (http://www.iana.org/assignments/ipv4-address-space)
while ARIN says it belongs to DISA - both in a whois and in the zonefiles.
However, no one seems to be advertising a route to the block, and the three
upstreams I can reach (eli, level3 and att) are all claiming "Unreachable"

Old guy

 
Reply With Quote
 
NPG
Guest
Posts: n/a

 
      07-18-2007, 04:59 PM
* Moe Trin wrote:
> On Mon, 16 Jul 2007, in the Usenet newsgroup comp.os.linux.networking, in
> article <f7ghu2$hkb$(E-Mail Removed)>, NPG wrote:
>
>> * Moe Trin wrote:

>
>>> 7.48.29.221 is a reserved address).

>> 7.48.29.221 is assigned to the DoD NIC

>
> IANA says it's reserved (http://www.iana.org/assignments/ipv4-address-space)
> while ARIN says it belongs to DISA - both in a whois and in the zonefiles.

Point taken. However IANA works in white collar. Whois and DNS in blue
collar. Management never really knows what is going on. Take
133.0.0.0/8 for instance. Management thinks it is assigned to a bunch of
Registries. Whois knows it is assigned to JPNIC
> However, no one seems to be advertising a route to the block, and the three
> upstreams I can reach (eli, level3 and att) are all claiming "Unreachable"
>

I was discussing assignment not reachability.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PSE help: up a very simple routing lab Branlebāt Windows Networking 5 01-11-2008 03:20 PM
simple question about ip_forward and NAT routing. meneg Linux Networking 3 03-31-2005 08:55 AM
Simple (?) routing question Dario Linux Networking 1 11-23-2004 12:51 PM
Simple routing question about my setup Ken Williams Linux Networking 4 06-30-2004 11:07 PM
Help with simple routing calle Linux Networking 12 09-05-2003 02:01 PM



1 2 3 4 5 6 7 8 9 10 11