NAT - 2 internet connections
I have a router (debian installed) with 3 network cards and 2 broadband internet connections. I also have a VLAN capable switch. On eth1 and eth2 are the the internet connections (since i can't tag a port on my switch) and on eth4 i have vlans 21 and 23. I want to separate two lans and every lan with it's own connection. I managed to make a iptables script and the internet works on both lans, but the problem is that all the computers (from both connections) are accessing the internet via one internet connection.
Here is my iptables script:
Now, both lans are accessing the internet with pe .3 IP Address (if you're asking why 88.xxx.219.0, the answer is that my ISP has a agregated class). Where I'm doing it wrong? Please help me.
iptables -t nat -F
iptables -t nat -A POSTROUTING -o $IFACE_EXTERN_CLIENTI -j SNAT --to $IP_EXTERN_CLIENTI # R1
iptables -t nat -A POSTROUTING -o $IFACE_EXTERN_CLIENTI2 -j SNAT --to $IP_EXTERN_CLIENTI2 # R2
iptables -t nat -A PREROUTING -i $IFACE_EXTERN_CLIENTI -j DNAT --to $IP_EXTERN_CLIENTI #R1
iptables -t nat -A PREROUTING -i $IFACE_EXTERN_CLIENTI2 -j DNAT --to $IP_EXTERN_CLIENTI2 #R2
Thanks and please excuse my english.