posts - 495,comments - 227,trackbacks - 0
首先确认net.ipv4.ip_forward是打开的;到/etc/sysctl.conf下确认
net.ipv4.ip_forward = 1

设置数据包去的
iptables -t nat -A PREROUTING -d 192.168.80.111 -p tcp --dport 38161 -j DNAT --to-destination 124.42.15.38:38141
设置数据包回来的
iptables -t nat -A POSTROUTING -d 124.42.15.38 -p tcp --dport 38141 -j SNAT --to 192.168.80.111

查看已经设置好的
iptables -t nat -L

删除设置
iptables -t nat -D PREROUTING lineNum
iptables -t nat -D POSTROUTING lineNum
posted on 2012-04-09 18:38 SIMONE 阅读(435) 评论(0)  编辑  收藏 所属分类: LINUX

只有注册用户登录后才能发表评论。


网站导航: