10.15 iptables filter表案例 10.16/10.17/10.18 iptable

10.15 iptables filter表案例

10.15 iptables filter表案例 10.16/10.17/10.18 iptable
10.15 iptables filter表案例 10.16/10.17/10.18 iptable
10.15 iptables filter表案例 10.16/10.17/10.18 iptable

10.15 iptables filter表案例 10.16/10.17/10.18 iptable

10.16/10.17/10.18 iptables nat表应用

10.15 iptables filter表案例 10.16/10.17/10.18 iptable
10.15 iptables filter表案例 10.16/10.17/10.18 iptable

10.15 iptables filter表案例 10.16/10.17/10.18 iptable

A机器有两块网卡ens33 192.168.15.132 ; ens37 192.168.1.98
B机器一块网卡ens37 192.168.1.168
两台机器能相互拼通。

10.15 iptables filter表案例 10.16/10.17/10.18 iptable
A机器上执行打开路由转发
echo "1" > /proc/sys/net/ipv4/ip_forward
ip_forward 值为1打开,0关闭。默认是关闭状态。
配置转发规则
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o ens33 -j

10.15 iptables filter表案例 10.16/10.17/10.18 iptable

B机器上配置网关及DNS
10.15 iptables filter表案例 10.16/10.17/10.18 iptable
route add default gw 192.168.1.98 网关就是A机器ens37的ip地址
vim /etc/relosv.conf 添加一个nameserver 119.29.29.29

10.15 iptables filter表案例 10.16/10.17/10.18 iptable
10.15 iptables filter表案例 10.16/10.17/10.18 iptable

10.15 iptables filter表案例 10.16/10.17/10.18 iptable

A机器清空上面设置的NAT规则
打开转发规则 echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -D POSTROUTING -s 192.168.1.0/24 -o ens33 -j MASQUERADE
iptables -t nat -nvL
10.15 iptables filter表案例 10.16/10.17/10.18 iptable

iptables -t nat -A PREROUTING -d 192.168.15.132 -p tcp --dport 1122 -j DNAT --to 192.168.1.168:22
iptables -t nat -A POSTROUTING -s 192.168.1.168 -j SNAT --to 192.168.15.132

10.15 iptables filter表案例 10.16/10.17/10.18 iptable
B机器上也要配置IP,DNS等操作。
10.15 iptables filter表案例 10.16/10.17/10.18 iptable

转载于:https://blog.51cto.com/12058686/2066116

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值