How to config basic NAT on linux

Published: 09 September 2017
on channel: Phuong Nguyen
2,663
3

Tutorial how to config basic NAT on linux:
Configure computer A go to internet via computer B
Computer A: card VMNET3:
IP: 192.168.1.3/24

Computer B can access internet
card VMNET3:
IP: 192.168.1.2/24
card NAT
Begin Configure on computer B:

echo "1" /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o ens37 -j MASQUERADE
iptables -A FORWARD -i eno16777736 -o ens37 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eno16777736 -o ens37 -j ACCEPT

configure on computer A:

route add default gw 192.168.1.2
echo "nameserver 8.8.8.8" to file /etc/resolv.conf

Hope it can helpful for you

Thanks for watching this video.


Watch video How to config basic NAT on linux online, duration hours minute second in high quality that is uploaded to the channel Phuong Nguyen 09 September 2017. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 2,663 times and liked it 3 visitors.