I found a brain dead simple two liner at
http://www.cyberciti.biz/tips/linux-...-line-etc.html that is supposed to setup a simple router and goes like this (I added the flushing lines):
Code:
iptables -F
iptables -F -t nat
iptables -F -t mangle
iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT
My /etc/network/interfaces is like this:
Code:
iface lo inet loopback
# eth1 connects to router connected to DSL modem
# it is shown as dynamic but router (192.168.1.1) reserves 192.168.1.196 for eth1
auto eth1
allow-hotplug eth1
iface eth1 inet dhcp
# eth0 is the internal network (hotspot network)
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.2.254
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
dns-nameservers 192.168.1.196
route gives:
Code:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 * 255.255.255.0 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth1
iptables -L -v returns:
Code:
Chain INPUT (policy ACCEPT 3503 packets, 553K bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT all -- eth0 any anywhere anywhere
Chain OUTPUT (policy ACCEPT 2709 packets, 581K bytes)
pkts bytes target prot opt in out source destination
... but I cannot get anywhere - cannot ping 192.168.1.196 or 192.168.1.1 from a computer on the 192.168.2.0 network.
Any ideas?
Regards,
Dennis