首页 技术 正文
技术 2022年11月21日
0 收藏 815 点赞 4,797 浏览 705 个字

1. 拓扑图

10.1.1.173(内网目标)  <——–  10.1.1.207(内网网关)+172.16.5.100(外网入口) <———– 172.16.6.46

2.规则

/usr/sbin/iptables -t nat -I PREROUTING       -i eth1     -d      172.16.5.100     -p   tcp    –dport     9527    -j    DNAT     –to-destination     10.1.1.173:9527
/usr/sbin/iptables -t nat -I POSTROUTING      -d      10.1.1.173    -p     tcp                                –dport      9527            -j SNAT               –to         10.1.1.207

(目标1.173 , 目标端口 9527 )把数据包扔给1.207

  1. service iptables save
  2. service iptables restart

4. 查看设置: iptables -t nat -L

5. 查看是否保存:vi /etc/sysconfig/iptables …..OK了这里有,重启机器也会自动生效了!

6.如果开启iptables服务

  1. iptables -A FORWARD -o eth0 -d 172.18.1.X -p tcp –dport 443 -j ACCEPT
  2. iptables -A FORWARD -i eth0 -s 172.18.1.X -p tcp –sport 443 -j ACCEPT

参考:http://baiseda.iteye.com/blog/1333699

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,904
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,430
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,247
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,058
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,690
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,727