- 论坛徽章:
- 0
|
想把访问192.168.10.12的15222端口的数据,转发到192.168.10.16的5222端口
- iptables -t nat -A PREROUTING -d 192.168.10.12/32 -p tcp --dport 15222 -j DNAT --to-destination 192.168.10.16:5222
复制代码 查看:
- [root@localhost ~]# iptables -t nat -vnL --line-number
- Chain PREROUTING (policy ACCEPT 90 packets, 5243 bytes)
- num pkts bytes target prot opt in out source destination
- 1 0 0 DNAT all -- * * 0.0.0.0/0 192.168.10.12 to:192.168.10.16
- Chain POSTROUTING (policy ACCEPT 43 packets, 2988 bytes)
- num pkts bytes target prot opt in out source destination
- Chain OUTPUT (policy ACCEPT 43 packets, 2988 bytes)
- num pkts bytes target prot opt in out source destination
复制代码 telnet不通:
- [root@localhost ~]# telnet 192.168.10.12 15222
- Trying 192.168.10.12...
- telnet: connect to address 192.168.10.12: Connection refused
- [root@localhost ~]# telnet 192.168.10.16 5222
- Trying 192.168.10.16...
- Connected to 192.168.10.16.
- Escape character is '^]'.
复制代码 求指教。 |
|