I'm currently using dnsmasq to create a small Debian box as a DHCP and DNS cache server. Until today, I had just 2 interfaces (eth0, eth1). One connected to my WAN (eth0) and one connected to my LAN (eth1) to distribute the ip.
In order to forward the traffic between the NIC I set-up my iptables like this:
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE iptables --append FORWARD --in-interface eth1 -j ACCEPT
Then I used iptables-persistent to fix the rules.
I've installed a new NIC (eth2), configured dnsmasq so I now have 2 subnets. I added :
iptables --append FORWARD --in-interface eth2 -j ACCEPT
/etc/iptables/rules.v4, reinstalled iptables-persistent but when I edit /etc/iptables/rules.v4 there is no trace of eth2 in the config file.
The thing is that it works, but what am I doing wrong?