Configuración de NAT en Core Linux con iptables
Config de NAT con iptables
stop client dhcp
Check if IP-Forwarding is enabled in the OS
/etc/init.d/services/dhcp stop
Configure Eth0 (WAN)
$ sudo ifconfig eth0 10.1.100.33 netmask 255.255.255.0 up
Configure Eth1 (LAN)
$ sudo ifconfig eth1 192.168.11.1 netmask 255.255.255.0 up
Ruta de default
$ sudo route add default gw 10.1.100.253
Archivo resolv.conf
$ echo "nameserver 8.8.8.8" >> /etc/resolv.conf
Internet verification
$ nslookup cisco.com
Route verification
$ ip route get 8.8.8.8
$ sudo sysctl net.ipv4.ip_forward
0 = disabled
1 = enabled
Enable IP-Forwarding
$ sudo sysctl -w net.ipv4.ip_forward=1
Config NAT (PAT)
$ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Cisco SW
Switch(config-if)#ip add 192.168.11.2 255.255.255.0
Switch(config-if)#no sh
Switch(config-if)#exit
Switch(config)#ip dhcp excluded-address 192.168.11.1
Switch(config)#ip dhcp pool test
Switch(dhcp-config)#network 192.168.11.0 255.255.255.0
Switch(dhcp-config)#default-router 192.168.11.1
Switch(dhcp-config)#dns-server 8.8.8.8
0 comentarios