SNAT(Source Network Address Translation, 출발지 주소 변환)


# iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j SNAT --to 203.230.7.1

  -192.168.0.0/24가 출발지 주소이고 eth0으로 나가는 패킷에 대하여 203.230.7.1 로 SNAT 시켜준다.



DNAT(Destinaton Network Address Translation, 목적지 주소 변환)


# iptables -t nat -A PREROUTING -d 203.230.7.1 -i eth0 -p tcp --dport 80 -j DNAT --to 192.168.0.1

  -eth0의 203.20.7.1주소로 들어오는 목적지 포트번호가 80인 tcp패킷에 대하여 192.168.0.1로 DNAT 시켜준다

+ Recent posts