iptables规则中DNAT规则设置

一 场景模拟


 
 
二 规则配置
[root@localhost ~]# iptables -t nat -A PREROUTING -d 10.10.188.232 -p tcp --dport 80 -j DNAT --to 10.10.177.233:80
 
三 测试

<!--5f39ae17-8c62-4a45-bc43-b32064c9388a:W3siYmxvY2tUeXBlIjoicGFyYWdyYXBoIiwic3R5bGVzIjp7ImFsaWduIjoibGVmdCIsImluZGVudCI6MCwidGV4dC1pbmRlbnQiOjAsImxpbmUtaGVpZ2h0IjoxLjc1fSwiYmxvY2tJZCI6Ijg0a2ptYTE1MDMxMjk2OTUwNzgiLCJyaWNoVGV4dCI6eyJpc1JpY2hUZXh0Ijp0cnVlLCJrZWVwTGluZUJyZWFrIjp0cnVlLCJkYXRhIjpbeyJjaGFyIjoi5LiAIiwic3R5bGVzIjp7ImJvbGQiOnRydWV9fSx7ImNoYXIiOiIgIiwic3R5bGVzIjp7ImJvbGQiOnRydWV9fSx7ImNoYXIiOiLlnLoiLCJzdHlsZXMiOnsiYm9sZCI6dHJ1ZX19LHsiY2hhciI6IuaZryIsInN0eWxlcyI6eyJib2xkIjp0cnVlfX0seyJjaGFyIjoi5qihIiwic3R5bGVzIjp7ImJvbGQiOnRydWV9fSx7ImNoYXIiOiLmi58iLCJzdHlsZXMiOnsiYm9sZCI6dHJ1ZX19XX19LHsiYmxvY2tUeXBlIjoicGFyYWdyYXBoIiwic3R5bGVzIjp7ImFsaWduIjoibGVmdCIsImluZGVudCI6MCwidGV4dC1pbmRlbnQiOjAsImxpbmUtaGVpZ2h0IjoxLjc1fSwiYmxvY2tJZCI6Ijk4ZW1qbDE1MDMxMzA2MTQ5MjUiLCJyaWNoVGV4dCI6eyJpc1JpY2hUZXh0Ijp0cnVlLCJrZWVwTGluZUJyZWFrIjp0cnVlLCJkYXRhIjpbeyJjaGFyIjoiMiIsInN0eWxlcyI6eyJjb2xvciI6IiNERjQwMkEifX0seyJjaGFyIjoiMSIsInN0eWxlcyI6eyJjb2xvciI6IiNERjQwMkEifX0sey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RhIjpbeyJjaGFyIjoiMiIsInN0eWxlcyI6eyJjb2xvciI6IiNERjQwMkEifX0seyJjaGFyIjoiMSIsInN0eWxlcyI6eyJjb2xvciI6IiNERjQwMkEifX0seyJjaGFyIjoiNSIsInN0eWxlcyI6eyJjb2xvciI6IiNERjQwMkEifX0seyJjaGFyIjoiLiIsInN0eWxlcyI6eyJjb2xvciI6IiNERjQwMkEifX0seyJjaGFyIjoicCIsInN0eWxlcyI6eyJjb2xvciI6IiNERjQwMkEifX0seyJjaGFyIjoibiIsInN0eWxlcyI6eyJjb2xvciI6IiNERjQwMkEifX0seyJjaGFyIjoiZyIsInN0eWxlcyI6eyJjb2xvciI6IiNERjQwMkEifX1dfX1d-->



 
  • 296ad542-b0b7-399a-ae51-e423d424de00-thumb.png
  • 大小: 70.9 KB
  • e4cdf795-5f91-304d-8f65-02cae9b979b1-thumb.png
  • 大小: 32.7 KB
发布了4094 篇原创文章 · 获赞 586 · 访问量 311万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 书香水墨 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览