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 without registration, duration hours minute second in high quality. This video was added by user Phuong Nguyen 09 September 2017, don't forget to share it with your friends and acquaintances, it has been viewed on our site 2,663 once and liked it 3 people.