hello,
first of all i am new to unix so maybe my problem is very easy for many of you but is very important to me.
So the idea is that i want to use a ubuntu 10.4 machine as a router from eth0 to eth1.
but the traffic routing is nor working properly
i configured the 2 interfaces to be part of 2 subnets and then i tried to use iptables command.
sudo sysctl -w net.ipv4.ip_forward=1
iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
the result was
sudo iptables -L -n -v
Chain INPUT (policy ACCEPT 5493 packets, 4815K bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 254 packets, 16979 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT all -- eth0 eth1 0.0.0.0/0 0.0.0.0/0
1 60 ACCEPT all -- eth1 eth0 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT 5349 packets, 888K bytes)
pkts bytes target prot opt in out source destination
unfortunately there was no trafic between the interfaces an even i could ping eth1 and eth0 from the pc-s from the subnetworks i was unable to ping from one pc to the other
digging more i found that if i run
sudo iptable -t nat -A POSTROUTING -j MASQUERADE everithing works perfect
unfortunately i need the ipaddresses of the PC and the NAT here is not doing more wrong than good.
please give me some ideas why this hapens
i add here the result of the route command
destination Gateway Genmask Flags Metric Ref Use Iface
100.10.10.0 * 255.255.255.0 U 1 0 0 eth1
192.168.10.0 * 255.255.255.0 U 1 0 0 eth0
link-local * 255.255.0.0 U 1000 0 0 eth0
default 192.168.10.1 0.0.0.0 UG 0 0 0 eth0