Chinaunix首页 | 论坛 | 博客
  • 博客访问: 69587
  • 博文数量: 11
  • 博客积分: 286
  • 博客等级: 二等列兵
  • 技术积分: 136
  • 用 户 组: 普通用户
  • 注册时间: 2011-05-03 15:31
文章分类

全部博文(11)

文章存档

2015年(5)

2014年(3)

2011年(3)

我的朋友

分类: LINUX

2015-10-19 14:03:21


使用netfilter/iptables,命令如下:

  1. echo "1" > /proc/sys/net/ipv4/ip_forward

  2. iptables -t nat -A OUTPUT -d 修改前的目的地址 -j DNAT --to 修改后的目的地址

OUTPUT:表示本机生成的网络数据


参考(man iptables):
nat:
                  This  table  is  consulted when a packet that creates a new connection is encountered.  It consists of three
                  built-ins: PREROUTING (for altering packets as soon as they come in), OUTPUT (for altering locally-generated
                  packets before routing), and POSTROUTING (for altering packets as they are about to go out).
阅读(487) | 评论(0) | 转发(0) |
0

上一篇:perl printf 例子

下一篇:没有了

给主人留下些什么吧!~~