I have the following interfaces: eth0, eth0:0, and eth1. eth0:0 is virtual and also it faces WAN (interent). eth0 is 192.168.0.0/24 and eth1 is 10.0.0.0/24. How can I enable NAT and make eth0:0 as gateway for both 192.168.0.0/24 and 10.0.0.0/24 networks.

link|improve this question

69% accept rate
Do you mean: eth0:0 has a public IP address? Okay, now I'm confused. If eth0 is a private network, why do you put a public IP there?? – pepoluan Mar 9 '11 at 15:38
I have only two interfaces, and I want both for private network. – nixnotwin Mar 9 '11 at 17:03
can you post the output of ifconfig, ip address show, and ip route show? Feel free to replace any public IP with a generalized one (e.g., 11.22.33.xx) – pepoluan Mar 10 '11 at 7:36
@pepoluan I bought and installed a third NIC, and you gave the right solution in another question on this site. – nixnotwin Apr 4 '11 at 16:54
feedback

1 Answer

iptables doesn't support virtual interfaces, so you have to match IP ranges in rules in order to achieve this.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.