BoonPing
September 2nd, 2010, 07:23 AM
Hi,
I tried to setup a connection as below but face some problem (probably route table setting incorrect). Hope if anyone could shed the light...
Basically, I have a PC1 (.1) and PC2 (.130) connected via a PC router. PC router has 2 interfaces: wireless (.2) and ethernet (.129). PC1 connects to PC router via LAN cable/wireless interface, while PC2 connects to PC router via cable. This settings try to simulate 1 wireless connection along the path (and because PC2 is too old to support wireless interface, we need a PC router). These interfaces are all under same 172.16.130.x subnet.
[PC1](.1)--ethernet--[wireless AP]--wireless--(.2)[PC router](.129)--ethernet--[dummy switch]--ethernet-- (.130)[PC2]
I tried to check the settings at PC router by PING.
The problem is
(a)PING success from .1 to .129,
(b)PING fail from .129 to .1.
(c)PING success from .130 to .2
(d)PING fail from .2 to .130.
(e)PING fail from .1 to .130 (ICMP request from .1 reach .2 but does not forward to .129)
(f)PING fail from .130 to .1 (ICMP request from .130 reach .129 but does not forward to .2)
(g)PING success between adjacent interface (eg. .1 to .2 and vice versa, .129 to .130 and vice versa).
(h)PING fail between .129<>.2 using non loopback fail (expected since no conn btw 2 interface).
My question is why PING A -> B success, but PING B->A fail??
--------------------------------------------
Below are the settings of Ubuntu 9.04 at PC Router
--------------------------------------------
root@atdg-desktop:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.130.128 0.0.0.0 255.255.255.128 U 1 0 0 eth0
172.16.130.0 0.0.0.0 255.255.255.0 U 2 0 0 ra0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
0.0.0.0 172.16.130.2 0.0.0.0 UG 0 0 0 ra0
0.0.0.0 172.16.130.129 0.0.0.0 UG 0 0 0 eth0
-----------------------
root@atdg-desktop:~# sysctl -a | grep forward
error: "Invalid argument" reading key "fs.binfmt_misc.register"
error: permission denied on key 'net.ipv4.route.flush'
net.ipv4.conf.all.forwarding = 1
net.ipv4.conf.all.mc_forwarding = 0
net.ipv4.conf.default.forwarding = 1
net.ipv4.conf.default.mc_forwarding = 0
net.ipv4.conf.lo.forwarding = 1
net.ipv4.conf.lo.mc_forwarding = 0
net.ipv4.conf.eth0.forwarding = 1
net.ipv4.conf.eth0.mc_forwarding = 0
net.ipv4.conf.eth1.forwarding = 1
net.ipv4.conf.eth1.mc_forwarding = 0
net.ipv4.conf.ra0.forwarding = 1
net.ipv4.conf.ra0.mc_forwarding = 0
net.ipv4.conf.pan0.forwarding = 1
net.ipv4.conf.pan0.mc_forwarding = 0
net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding = 0
net.ipv6.conf.default.forwarding = 0
net.ipv6.conf.lo.forwarding = 0
error: permission denied on key 'net.ipv6.route.flush'
net.ipv6.conf.eth0.forwarding = 0
net.ipv6.conf.eth1.forwarding = 0
net.ipv6.conf.ra0.forwarding = 0
net.ipv6.conf.pan0.forwarding = 0
----------------------------------
root@atdg-desktop:~# cat /proc/sys/net/ipv4/ip_forward
1
----------------------------------
root@atdg-desktop:~# iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
----------------------------------
root@atdg-desktop:~# arp -n
Address HWtype HWaddress Flags Mask Iface
172.16.130.130 ether [CorrectMAC] CM ra0
172.16.130.130 ether [CorrectMAC] C eth0
172.16.130.1 ether [CorrectMAC] CM ra0
172.16.130.1 ether [CorrectMAC] C eth0
I tried to setup a connection as below but face some problem (probably route table setting incorrect). Hope if anyone could shed the light...
Basically, I have a PC1 (.1) and PC2 (.130) connected via a PC router. PC router has 2 interfaces: wireless (.2) and ethernet (.129). PC1 connects to PC router via LAN cable/wireless interface, while PC2 connects to PC router via cable. This settings try to simulate 1 wireless connection along the path (and because PC2 is too old to support wireless interface, we need a PC router). These interfaces are all under same 172.16.130.x subnet.
[PC1](.1)--ethernet--[wireless AP]--wireless--(.2)[PC router](.129)--ethernet--[dummy switch]--ethernet-- (.130)[PC2]
I tried to check the settings at PC router by PING.
The problem is
(a)PING success from .1 to .129,
(b)PING fail from .129 to .1.
(c)PING success from .130 to .2
(d)PING fail from .2 to .130.
(e)PING fail from .1 to .130 (ICMP request from .1 reach .2 but does not forward to .129)
(f)PING fail from .130 to .1 (ICMP request from .130 reach .129 but does not forward to .2)
(g)PING success between adjacent interface (eg. .1 to .2 and vice versa, .129 to .130 and vice versa).
(h)PING fail between .129<>.2 using non loopback fail (expected since no conn btw 2 interface).
My question is why PING A -> B success, but PING B->A fail??
--------------------------------------------
Below are the settings of Ubuntu 9.04 at PC Router
--------------------------------------------
root@atdg-desktop:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.130.128 0.0.0.0 255.255.255.128 U 1 0 0 eth0
172.16.130.0 0.0.0.0 255.255.255.0 U 2 0 0 ra0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
0.0.0.0 172.16.130.2 0.0.0.0 UG 0 0 0 ra0
0.0.0.0 172.16.130.129 0.0.0.0 UG 0 0 0 eth0
-----------------------
root@atdg-desktop:~# sysctl -a | grep forward
error: "Invalid argument" reading key "fs.binfmt_misc.register"
error: permission denied on key 'net.ipv4.route.flush'
net.ipv4.conf.all.forwarding = 1
net.ipv4.conf.all.mc_forwarding = 0
net.ipv4.conf.default.forwarding = 1
net.ipv4.conf.default.mc_forwarding = 0
net.ipv4.conf.lo.forwarding = 1
net.ipv4.conf.lo.mc_forwarding = 0
net.ipv4.conf.eth0.forwarding = 1
net.ipv4.conf.eth0.mc_forwarding = 0
net.ipv4.conf.eth1.forwarding = 1
net.ipv4.conf.eth1.mc_forwarding = 0
net.ipv4.conf.ra0.forwarding = 1
net.ipv4.conf.ra0.mc_forwarding = 0
net.ipv4.conf.pan0.forwarding = 1
net.ipv4.conf.pan0.mc_forwarding = 0
net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding = 0
net.ipv6.conf.default.forwarding = 0
net.ipv6.conf.lo.forwarding = 0
error: permission denied on key 'net.ipv6.route.flush'
net.ipv6.conf.eth0.forwarding = 0
net.ipv6.conf.eth1.forwarding = 0
net.ipv6.conf.ra0.forwarding = 0
net.ipv6.conf.pan0.forwarding = 0
----------------------------------
root@atdg-desktop:~# cat /proc/sys/net/ipv4/ip_forward
1
----------------------------------
root@atdg-desktop:~# iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
----------------------------------
root@atdg-desktop:~# arp -n
Address HWtype HWaddress Flags Mask Iface
172.16.130.130 ether [CorrectMAC] CM ra0
172.16.130.130 ether [CorrectMAC] C eth0
172.16.130.1 ether [CorrectMAC] CM ra0
172.16.130.1 ether [CorrectMAC] C eth0