간단 NAT Masquerade 설정

eth0 = 인터넷 연결된 것 (connected to the internet)
eth1 = 인터넷 연결할 것 (to connect)

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

 

Leave a Reply

Your email address will not be published. Required fields are marked *