I have an ubuntu box with a single NIC. In order to bind a number of services (like apache, dnsmasq, etc), I have bound them to different alias's (e.g. eth0:0, etc), some of which are on completely different IP ranges. Since all my client computers are using my ubuntu box as their default gateway, I was wondering if this iptables rule was necessary:
iptables --append FORWARD --in-interface eth0:0 -j ACCEPT (this is facing the clients on 10.2.0.0/24, while this box communicates with my DSL router on 192.168.1.1 /24). I have already enabled IP forwarding, etc.
Basically, I want to know if forwarding is required between aliases that are on different IP ranges (I presume its required between multiple, separate NIC's but keep in mind I only have one.
I have added this iptables rule for my outbound interface:
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE