리눅스 NAT 구성
Post

리눅스 NAT 구성

네트워크 구성

img01 네트워크 구성

NAT Gateway

1
2
3
4
5
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
sysctl -p
firewall-cmd --direct --add-rule ipv4 nat POSTROUTING 0 -o eth_ext -j MASQUERADE
firewall-cmd --direct --add-rule ipv4 filter FORWARD 0 -i eth_int -o eth_ext -j ACCEPT
firewall-cmd --direct --add-rule ipv4 filter FORWARD 0 -i eth_ext -o eth_int -m state --state RELATED,ESTABLISHED -j ACCEPT

Client

  • Gateway: 192.168.0.1
  • DNS: 192.168.0.1