Networking Forums

Networking Forums > Computer Networking > Linux Networking > routing problem of Linux box

Reply
Thread Tools Display Modes

routing problem of Linux box

 
 
CS
Guest
Posts: n/a

 
      05-09-2006, 07:29 PM
Hi all.

I have this network:

|
|
|----------------------------|
| Linksys Route=R |
|----------------------------|
| |
| |-----|
| | B |
| |-----|
|
|
|---------------------------eth0|
| F=(RH Firewall/Route) |
|---------------------------eth1|
|
|
|-----|
| C |
|-----|

>From B I can ping F(192.168.1.2) and internet, not C.
>From F I can ping B (192.168.1.3) and internet as well as itself eth0

and eth1 (192.168.1.2 and 192.168.2.2). But from F I can not ping C.
>From C I can not ping F (192.168.1.2 and 192.168.2.2), nor internet.

F has ipv4 forward=1

I expected that B and C and F can ping each other and the internet.

What is the reason? There is no firewall on F. (iptables is down)

IP addresses:
R = 198.168.1.1
B = 198.168.1.3
F = 198.168.1.2 eth0
198.168.2.2 eth1

C = 198.168.2.3

route table of F:
route add -net 192.168.2.0 gw 192.168.2.2 nemask 255.255.255.0 dev eth0
route add default gw 192.168.1.2 dev eth1
route add default gw 192.168.1.1 dev eth0
route add -net 127.0.0.0 netmask 255.0.0.0 dev lo

ifconfig of F:

eth0 Link encap:Ethernet HWaddr 00:16:09:73:1E1
inet addr:192.168.1.108 Bcast:192.168.1.255
Mask:255.255.252.0
inet6 addr: fe80::206:29ff:fe73:5ed2/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:17 errors:17 dropped:0 overruns:0 carrier:17
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:882 (882.0 b)

eth1 Link encap:Ethernet HWaddr 00:41:2A:A5:F1:AA
inet addr:192.168.2.108 Bcast:192.168.2.255
Mask:255.255.252.0
inet6 addr: fe80::240:33ff:fea4:f1aa/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:31 errors:0 dropped:0 overruns:0 frame:0
TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2141 (2.0 KiB) TX bytes:714 (714.0 b)
Interrupt:9 Base address:0xee00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:3463 errors:0 dropped:0 overruns:0 frame:0
TX packets:3463 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4974862 (4.7 MiB) TX bytes:4974862 (4.7 MiB)





Thanks.

 
Reply With Quote
 
 
 
 
Unruh
Guest
Posts: n/a

 
      05-09-2006, 08:47 PM
"CS" <(E-Mail Removed)> writes:

>Hi all.


You are confused about default routes See below.



>I have this network:


> |
> |
> |----------------------------|
> | Linksys Route=R |
> |----------------------------|
> | |
> | |-----|
> | | B |
> | |-----|
> |
> |
> |---------------------------eth0|
> | F=(RH Firewall/Route) |
> |---------------------------eth1|
> |
> |
> |-----|
> | C |
> |-----|


>>From B I can ping F(192.168.1.2) and internet, not C.
>>From F I can ping B (192.168.1.3) and internet as well as itself eth0

>and eth1 (192.168.1.2 and 192.168.2.2). But from F I can not ping C.
>>From C I can not ping F (192.168.1.2 and 192.168.2.2), nor internet.

>F has ipv4 forward=1


>I expected that B and C and F can ping each other and the internet.


>What is the reason? There is no firewall on F. (iptables is down)


>IP addresses:
>R = 198.168.1.1
>B = 198.168.1.3
>F = 198.168.1.2 eth0
> 198.168.2.2 eth1


>C = 198.168.2.3


>route table of F:
>route add -net 192.168.2.0 gw 192.168.2.2 nemask 255.255.255.0 dev eth0
>route add default gw 192.168.1.2 dev eth1
>route add default gw 192.168.1.1 dev eth0



??? There is only ever one default route. That is what default means. Only
the last one will work.

Put in an explicit route for C or for its subnet on F.



>route add -net 127.0.0.0 netmask 255.0.0.0 dev lo


>ifconfig of F:


>eth0 Link encap:Ethernet HWaddr 00:16:09:73:1E1
> inet addr:192.168.1.108 Bcast:192.168.1.255
>Mask:255.255.252.0
> inet6 addr: fe80::206:29ff:fe73:5ed2/64 Scope:Link
> UP BROADCAST MULTICAST MTU:1500 Metric:1
> RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> TX packets:17 errors:17 dropped:0 overruns:0 carrier:17
> collisions:0 txqueuelen:1000
> RX bytes:0 (0.0 b) TX bytes:882 (882.0 b)


>eth1 Link encap:Ethernet HWaddr 00:41:2A:A5:F1:AA
> inet addr:192.168.2.108 Bcast:192.168.2.255
>Mask:255.255.252.0
> inet6 addr: fe80::240:33ff:fea4:f1aa/64 Scope:Link
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:31 errors:0 dropped:0 overruns:0 frame:0
> TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:1000
> RX bytes:2141 (2.0 KiB) TX bytes:714 (714.0 b)
> Interrupt:9 Base address:0xee00


>lo Link encap:Local Loopback
> inet addr:127.0.0.1 Mask:255.0.0.0
> inet6 addr: ::1/128 Scope:Host
> UP LOOPBACK RUNNING MTU:16436 Metric:1
> RX packets:3463 errors:0 dropped:0 overruns:0 frame:0
> TX packets:3463 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
> RX bytes:4974862 (4.7 MiB) TX bytes:4974862 (4.7 MiB)






>Thanks.


 
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
linux ipv6 routing problem ayqazi Linux Networking 7 10-29-2007 08:20 PM
Linux subnet routing problem. rickpratt@gmail.com Linux Networking 1 07-11-2007 12:44 PM
Linux Gateway routing problem KeesS Linux Networking 9 08-19-2005 09:08 AM
Linux Firewall / Routing Problem Idris Saliu Linux Networking 2 02-14-2004 05:13 PM
Routing problem with linux Christian Vorholt Linux Networking 1 12-03-2003 01:40 PM



1 2 3 4 5 6 7 8 9 10 11