From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.0.1) Gecko/20020830 Description of problem: After set /proc/sys/net/ipv4/ip_forward to 1 (as suggested by many docuemnts on the net and works on previous version of RH Linux), IP forwarding does not work. ping does not go through from one subnet to another. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. echo "1" > /proc/sys/net/ipv4/ip_forward 2. ping from a host on one subnet to a host on another subnet Actual Results: %102[ehui@mva]~>/sbin/ifconfig eth0 Link encap:Ethernet HWaddr 00:02:2D:09:3A:C2 inet addr:192.168.0.20 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:82 errors:0 dropped:0 overruns:0 frame:0 TX packets:57 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:9050 (8.8 Kb) TX bytes:11099 (10.8 Kb) Interrupt:5 Base address:0x100 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:156 errors:0 dropped:0 overruns:0 frame:0 TX packets:156 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:10534 (10.2 Kb) TX bytes:10534 (10.2 Kb) %103[ehui@mva]~>route route: Command not found. %104[ehui@mva]~>/sbin/route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.0.0 * 255.255.255.0 U 0 0 0 eth0 127.0.0.0 * 255.0.0.0 U 0 0 0 lo default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0 %105[ehui@mva]~>ping 192.168.1.1 PING 192.168.1.1 (192.168.1.1) from 192.168.0.20 : 56(84) bytes of data. --- 192.168.1.1 ping statistics --- 3 packets transmitted, 0 received, 100% loss, time 2012ms %106[ehui@mva]~>ping 192.168.0.1 <- gateway IP address!! PING 192.168.0.1 (192.168.0.1) from 192.168.0.20 : 56(84) bytes of data. 64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=2.17 ms 64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=2.12 ms 64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=2.11 ms --- 192.168.0.1 ping statistics --- 3 packets transmitted, 3 received, 0% loss, time 2005ms rtt min/avg/max/mdev = 2.118/2.138/2.177/0.046 ms Expected Results: ping resport success Additional info: I have confirmed I can ping hosts from to both subnet from the gateway. [root@gate2 root]# ifconfig eth0 Link encap:Ethernet HWaddr 02:60:8C:4D:80:96 inet addr:192.168.1.3 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:14386 errors:0 dropped:0 overruns:0 frame:0 TX packets:5177 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:9068265 (8.6 Mb) TX bytes:453354 (442.7 Kb) Interrupt:5 Base address:0x300 Memory:dc000-de000 eth1 Link encap:Ethernet HWaddr 00:02:2D:09:39:07 inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:125 errors:0 dropped:0 overruns:0 frame:0 TX packets:194 errors:1 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:17503 (17.0 Kb) TX bytes:30306 (29.5 Kb) Interrupt:3 Base address:0x100 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:145 errors:0 dropped:0 overruns:0 frame:0 TX packets:145 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:10567 (10.3 Kb) TX bytes:10567 (10.3 Kb) [root@gate2 root]# ping 192.168.0.20 PING 192.168.0.20 (192.168.0.20) from 192.168.0.1 : 56(84) bytes of data. 64 bytes from 192.168.0.20: icmp_seq=1 ttl=64 time=2.35 ms 64 bytes from 192.168.0.20: icmp_seq=2 ttl=64 time=2.32 ms 64 bytes from 192.168.0.20: icmp_seq=3 ttl=64 time=2.29 ms --- 192.168.0.20 ping statistics --- 3 packets transmitted, 3 received, 0% loss, time 2017ms rtt min/avg/max/mdev = 2.299/2.325/2.351/0.059 ms [root@gate2 root]# ping 192.168.1.1 PING 192.168.1.1 (192.168.1.1) from 192.168.1.3 : 56(84) bytes of data. 64 bytes from 192.168.1.1: icmp_seq=1 ttl=255 time=1.68 ms 64 bytes from 192.168.1.1: icmp_seq=2 ttl=255 time=0.921 ms 64 bytes from 192.168.1.1: icmp_seq=3 ttl=255 time=0.871 ms 64 bytes from 192.168.1.1: icmp_seq=4 ttl=255 time=0.885 ms --- 192.168.1.1 ping statistics --- 4 packets transmitted, 4 received, 0% loss, time 3037ms rtt min/avg/max/mdev = 0.871/1.090/1.683/0.342 ms [root@gate2 root]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.0 * 255.255.255.0 U 0 0 0 eth0 192.168.0.0 * 255.255.255.0 U 0 0 0 eth1 127.0.0.0 * 255.0.0.0 U 0 0 0 lo default gate.edhome.ca 0.0.0.0 UG 0 0 0 eth0 [root@gate2 root]# Note: One of the subnet is a wireless LAN, but the same problem occurs when both LAN are 10base2. Note2: Also tried bridge the 2 subnets, the same problem occurs. Note3: This work on a current setup running RH 7.3. I'm working migurating the functions to RH8.
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0 eth0 addr:192.168.0.1 how can this work? your netmask is 24 bits, so it APPEARS that your eth0 subnet is 192.168.1.* but your IP address isn't ont his subnet!
Sorry, I think all the traces are confusion, some trace is from the host on the other subnet. eth0 is 192.168.1.3 and the route does match... [root@gate2 root]# ifconfig eth0 Link encap:Ethernet HWaddr 02:60:8C:4D:80:96 inet addr:192.168.1.3 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:21405 errors:0 dropped:0 overruns:0 frame:4 TX packets:13068 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:9847488 (9.3 Mb) TX bytes:2555515 (2.4 Mb) Interrupt:5 Base address:0x300 Memory:dc000-de000 eth1 Link encap:Ethernet HWaddr 00:02:2D:09:39:07 inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:390 errors:0 dropped:0 overruns:0 frame:0 TX packets:380 errors:1 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:47633 (46.5 Kb) TX bytes:68305 (66.7 Kb) Interrupt:3 Base address:0x100 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:170 errors:0 dropped:0 overruns:0 frame:0 TX packets:170 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:14483 (14.1 Kb) TX bytes:14483 (14.1 Kb) [root@gate2 root]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.0 * 255.255.255.0 U 0 0 0 eth0 192.168.0.0 * 255.255.255.0 U 0 0 0 eth1 127.0.0.0 * 255.0.0.0 U 0 0 0 lo [root@gate2 root]# netmask control how many bit are used as network address. 24 bit netmask leave eth0 as 192.168.1.0 and eth1 as 192.168.0.0. eth0 addr is 192.168.1.3 and eth1 addr is 192.168.0.1... So, maybe I don't know what I'm talking about?
Hi, I have looked further at the problem and still believed setup properly. There are 2 subnets on my network: 192.168.0 and 192.168.1 I have 3 hosts on the LAN: gate (192.168.1.1) gate2 (192.168.1.3, 192.168.0.1) and wmva (102.168.0.20) gate2 is the router between 192.168.0 and 192.168.1. Trace from this machine: ========================================================== [root@gate2 root]# ifconfig eth0 Link encap:Ethernet HWaddr 02:60:8C:4D:80:96 inet addr:192.168.1.3 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2938 errors:0 dropped:0 overruns:0 frame:0 TX packets:2814 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:1387508 (1.3 Mb) TX bytes:322849 (315.2 Kb) Interrupt:5 Base address:0x300 Memory:dc000-de000 eth1 Link encap:Ethernet HWaddr 00:02:2D:09:39:07 inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:39 errors:0 dropped:0 overruns:0 frame:0 TX packets:31 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:4546 (4.4 Kb) TX bytes:5872 (5.7 Kb) Interrupt:3 Base address:0x100 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:134 errors:0 dropped:0 overruns:0 frame:0 TX packets:134 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:8676 (8.4 Kb) TX bytes:8676 (8.4 Kb) [root@gate2 root]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.0 * 255.255.255.0 U 0 0 0 eth0 192.168.0.0 * 255.255.255.0 U 0 0 0 eth1 127.0.0.0 * 255.0.0.0 U 0 0 0 lo default gate.edhome.ca 0.0.0.0 UG 0 0 0 eth0 [root@gate2 root]# sysctl -A | grep forward net.ipv4.conf.eth1.mc_forwarding = 0 net.ipv4.conf.eth1.forwarding = 1 net.ipv4.conf.eth0.mc_forwarding = 0 net.ipv4.conf.eth0.forwarding = 1 net.ipv4.conf.lo.mc_forwarding = 0 net.ipv4.conf.lo.forwarding = 1 net.ipv4.conf.default.mc_forwarding = 0 net.ipv4.conf.default.forwarding = 1 net.ipv4.conf.all.mc_forwarding = 0 net.ipv4.conf.all.forwarding = 1 net.ipv4.ip_forward = 1 ====================================== ping between gate and gate2, gate2 and wmva works properly. However, ping does not work between gate and wmva even with IP forwarding turn on (echo "1" > /proc/sys/net/ipv4/ip_forward, see sysctl -A output above). Trace from wmva: ====================== [root@mva root]# ifconfig eth0 Link encap:Ethernet HWaddr 00:02:2D:09:3A:C2 inet addr:192.168.0.20 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:70 errors:0 dropped:0 overruns:0 frame:0 TX packets:71 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:8854 (8.6 Kb) TX bytes:13529 (13.2 Kb) Interrupt:5 Base address:0x100 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:74 errors:0 dropped:0 overruns:0 frame:0 TX packets:74 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:4906 (4.7 Kb) TX bytes:4906 (4.7 Kb) [root@mva root]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.0.0 * 255.255.255.0 U 0 0 0 eth0 127.0.0.0 * 255.0.0.0 U 0 0 0 lo default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0 [root@mva root]# ping 192.168.1.1 PING 192.168.1.1 (192.168.1.1) from 192.168.0.20 : 56(84) bytes of data. --- 192.168.1.1 ping statistics --- 12 packets transmitted, 0 received, 100% loss, time 10999ms [root@mva root]# ==================================