all the packets coming to 192.168.12.87
and port 80
will be forwarded to 192.168.12.77
port 80
.
192.168.12.87:80 ==forward==> 1192.168.12.77:80
이런경우, 다음과 같이 설정하면, 된다
iptables -t nat -A POSTROUTING -p tcp -d 192.168.12.77 --dport 80 -j SNAT --to-source 192.168.12.87 |
[iptable control]
- 끄기 / 켜기
service iptables stop
/etc/init.d/iptables stop
service iptables start
/etc/init.d/iptables start
상태
# iptables -L
[root@yum.repos.d]# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |