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.
1 Answer
iptables doesn't support virtual interfaces, so you have to match IP ranges in rules in order to achieve this.
ifconfig
,ip address show
, andip route show
? Feel free to replace any public IP with a generalized one (e.g., 11.22.33.xx)