Re: routing
Thank You for Your time and answer, lee:
> > host1 <-> eth <-> host2 <-> ppp
> >
> > On host2 it seems that the route table is wrong somehow:
> >
> > Destination Gateway Genmask Flags Metric Ref
> > Use Iface
> > 10.10.10.10 * 255.255.255.255 UH 0
> > 0 0 ppp0
> > 192.168.0.0 * 255.255.255.0 U 0
> > 0 0 eth0
> > default * 0.0.0.0 U 0
> > 0 0 ppp0
> >
> > in iptables, chain FORWARD I have:
> > Chain FORWARD (policy DROP 0 packets, 0 bytes)
> > pkts bytes target prot opt in out source
> > destination 0 0 ACCEPT all -- * *
> > 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
> > 129 10247 ACCEPT all -- eth0 * 192.168.0.3 0.0.0.0/0
> >
> > cat /proc/sys/net/ipv4/ip_forward
> > 1
>
> You need to set host2 as a gateway on host1 so that you have a default
> route to host2 on host1, using eth, just as you have a default route
> on host2 using ppp0. Take a look at /etc/network/interfaces on both
> hosts.
Already done:
host1$ cat /etc/network/interfaces
auto lo eth0
iface lo inet loopback
iface eth0 inet static
address 192.168.0.3
netmask 255.255.255.0
broadcast 192.168.0.255
network 192.168.0.0
gateway 192.168.0.125
host1$ /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:80:48:18:a3:a1
inet addr:192.168.0.3 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::280:48ff:fe18:a3a1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:184 errors:0 dropped:0 overruns:0 frame:0
TX packets:135 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:19074 (18.6 KiB) TX bytes:17960 (17.5 KiB)
Interrupt:11 Base address:0x6600
This RX/TX - shows the traffic through SSH. - Not that it gets access
by ppp on host2.
host2$ /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:19:b9:53:34:18
inet addr:192.168.0.125 Bcast:192.168.0.255
Mask:255.255.255.0
inet6 addr: fe80::219:b9ff:fe53:3418/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1161 errors:6 dropped:3 overruns:0 frame:1
TX packets:1523 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:257653 (251.6 KiB) TX bytes:145937 (142.5 KiB)
Interrupt:21
ppp0 Link encap:Point-to-Point Protocol
inet addr:20.20.20.20 P-t-P:10.10.10.10
Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:99919 errors:0 dropped:0 overruns:0 frame:0
TX packets:78388 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:144637228 (137.9 MiB) TX bytes:4836845 (4.6 MiB)
Firewall and routing on host2 was made with the following commands:
/sbin/iptables -F FORWARD
/sbin/iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
/sbin/iptables -A FORWARD -i eth0 -s 192.168.0.3 -j ACCEPT
echo 1 >/proc/sys/net/ipv4/ip_forward
route del default
route add default dev ppp0
Reply to: