Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
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

1 Answer 1

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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