Results 1 to 3 of 3
HI All,
I am pretty new to Linux . So I would be grateful to you people out there who can solve this problem of mine....As u would've guessed from ...
- 05-24-2010 #1Just Joined!
- Join Date
- May 2010
- Posts
- 2
IP Forwarding Not happening
HI All,
I am pretty new to Linux . So I would be grateful to you people out there who can solve this problem of mine....As u would've guessed from the Title, IP forwarding is not happening as expected on my Server.. I'll explain u the configurations I've made.
First this is how my interface-setup looks like:
qabng95a:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:1A:64:9D
A:6E
inet addr:10.6.9.95 Bcast:10.6.9.255 Mask:255.255.255.0
inet6 addr: fe80::21a:64ff:fe9d:da6e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2734012 errors:0 dropped:0 overruns:0 frame:0
TX packets:1288259 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:474734014 (452.7 MiB) TX bytes:1568966063 (1.4 GiB)
Interrupt:106 Memory:ca000000-ca011100
eth1 Link encap:Ethernet HWaddr 00:15:17:8C:C3:82
inet addr:192.168.10.1 Bcast:192.168.10.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Base address:0x5000 Memory:c9fe0000-ca000000
eth2 Link encap:Ethernet HWaddr 00:15:17:8C:C3:83
inet6 addr: fe80::215:17ff:fe8c:c383/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:963835 errors:0 dropped:0 overruns:0 frame:0
TX packets:29978 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:61689192 (58.8 MiB) TX bytes:1922362 (1.8 MiB)
Base address:0x5020 Memory:c9fa0000-c9fc0000
eth2.100 Link encap:Ethernet HWaddr 00:15:17:8C:C3:83
inet6 addr: fe80::215:17ff:fe8c:c383/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:27 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:1782 (1.7 KiB)
eth2.101 Link encap:Ethernet HWaddr 00:15:17:8C:C3:83
inet addr:192.178.1.2 Bcast:192.178.1.255 Mask:255.255.255.0
inet6 addr: fe80::215:17ff:fe8c:c383/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:818 errors:0 dropped:0 overruns:0 frame:0
TX packets:593 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:35652 (34.8 KiB) TX bytes:27114 (26.4 KiB)
eth2.101: Link encap:Ethernet HWaddr 00:15:17:8C:C3:83
inet addr:192.176.8.100 Bcast:192.176.8.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
eth2.150 Link encap:Ethernet HWaddr 00:15:17:8C:C3:83
inet6 addr: fe80::215:17ff:fe8c:c383/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:468 (468.0 b)
eth2.200 Link encap:Ethernet HWaddr 00:15:17:8C:C3:83
inet addr:192.168.9.2 Bcast:192.168.9.255 Mask:255.255.255.0
inet6 addr: fe80::215:17ff:fe8c:c383/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:625 errors:0 dropped:0 overruns:0 frame:0
TX packets:616 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:27958 (27.3 KiB) TX bytes:28264 (27.6 KiB)
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:1349 errors:0 dropped:0 overruns:0 frame:0
TX packets:1349 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:88616 (86.5 KiB) TX bytes:88616 (86.5 KiB)
Here eth2.101 and eth2.200 are two sub-interfaces ... They are VLANS with respective ids 101 n 200... Now My problem is "I need to forward all packets coming to eth2.101 to eth2.200".... For that i enabled IP-Forwarding with the option
qabng95a:~# sysctl -w net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1
Now I added an Iptable entry to forward the packet as desired
"iptables -A FORWARD -i eth2.101 -o eth2.200 -j ACCEPT"
qabng95a:~# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
...........................
Now i ping eth2.200 such that the packet is reachable only thro eth2.101(actually i gave the next-hop address for the packet as eth2.101).. The packet as expected reaches eth2.101(did a tcpdump on that interface).. But this packet doesnot get forwarded to eth2.200.....
It would be immensely helpful if you guys can help me at this...
Thanks in advance.....
Regards,
Sankarshan
- 05-24-2010 #2
Could you post the content of /proc/sys/net/ipv4/ip_forward please?
My experience is that changing sysctl values doesn't always change the values in those files. You might want to make it 1.
If it is 1 already, there's another problem.
- 05-25-2010 #3Just Joined!
- Join Date
- May 2010
- Posts
- 2
Hi Bemk,
Here is the output of the command....
qabng95a:~# cat /proc/sys/net/ipv4/ip_forward
1
As we can see the value has been set to 1.. So IP forwarding is enabled....I think the problem reduces to that of intra-interface routing.... the two interfaces eth2.101 and eth2.200 are vlans ..... Is it possible for me to add an IP-Forwarding rule from eth2.101 to eth2.200?


Reply With Quote