1

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.

nixnotwin
  • 1,553
  • 5
  • 35
  • 55
  • 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 09 '11 at 15:38
  • I have only two interfaces, and I want both for private network. – nixnotwin Mar 09 '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 07:36
  • @pepoluan I bought and installed a third NIC, and you gave the right solution in another question on this site. – nixnotwin Apr 04 '11 at 16:54

1 Answers1

1

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

mgorven
  • 31,041