I made some progress:
I use this as my IP-tables:
Code:
#Enable internal interfaces to communication between each other
#
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -A FORWARD -i eth0 -o eth2 -m state --state ESTABLISHED,RELATED \-j ACCEPT
iptables -A FORWARD -i eth1 -o eth2 -m state --state ESTABLISHED,RELATED \-j ACCEPT
iptables -A FORWARD -i eth2 -o eth1 -m state --state ESTABLISHED,RELATED \-j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to MY.EXTERNAL.IP.ADRESS
And this in my router /etc/network/interfaces:
Code:
#WAN port to get IP via DHCP
auto eth0
iface eth0 inet dhcp
#Configure LAN port
auto eth1
iface eth1 inet static
address 10.10.10.1
netmask 255.255.255.0
#Configure second LAN port
auto eth2
iface eth2 inet static
address 192.168.1.1
netmask 255.255.255.0
This enables me to ping and connect to the router via 192.168.1.1 adress.
But when I plug in a computer, I get nothing.
I have enabled dnsmasq to listen to eth1 and eth2 and my DHCP-ranges looks like tis:
Code:
dhcp-range=eth1,10.10.10.2,10.10.10.250,12h
dhcp-range=eth2,192.168.1.10,192.168.1.250,12h
I also tried using netmask 255.255.255.255 for the eth2 interface. Same thing there. I can ping 192.168.1.1 from any other computer, but I cannot get any connection.
I also tried to make a static IP-adress while connecting to eth2 on the laptop plugged into the network card that runs eth2, but no dice.
Any ideas what I'm doing wrong?