首页 > linux > iptables 端口针对动态IP(adsl)映射规则

iptables 端口针对动态IP(adsl)映射规则

2011年6月1日 eric 发表评论 阅读评论

iptables -A PREROUTING -t nat -i ppp1 -p tcp –dport 8080 -j DNAT –to 1.1.1.3:22
iptables -A POSTROUTING -t nat -o ppp1 -p tcp -m tcp –dport 8080 -j SNAT –to 1.1.1.1
iptables -A INPUT -p tcp -m state –state NEW –dport 22 -i eth1 -j ACCEPT

iptables -A PREROUTING -t nat -i ppp1 -p tcp –dport 8080 -j DNAT –to 1.1.1.3:22

PREROUTING 规则 把 所有的ppp1设备 8080端口请求 转发到 1.1.1.3 ip 的 22端口

iptables -A POSTROUTING -t nat -o ppp1 -p tcp -m tcp –dport 8080 -j SNAT –to 1.1.1.1

POSTROUTING 规则 把所有 ppp1设备 8080端口请求,转发到 本机器的 网关 IP 1.1.1.1

iptables -A INPUT -p tcp -m state –state NEW –dport 22 -i eth1 -j ACCEPT

允许访问设备 eth1 (也就是网关) 的 22端口

转载请注明:文章转载自:Eric's linux and nginx! (http://www.nginxs.com)
本文地址:http://www.nginxs.com/linux/471.html

分类: linux 标签:
  1. 2011年6月20日17:10 | #1

    That is very kind of you to write this share for us, thanks a lot. This information is useful to us.

  2. 2018年4月4日01:14 | #2

    I installed this 20 mil SilverBack in a 24×26 crawl space.

  3. 2018年4月4日04:47 | #3

    “НРД проголосовал за блокчейн” NSD blockchain vote.

  4. 2018年4月4日20:37 | #4

    We didn’t find outcomes for: water remedy providers.

  5. 2018年4月6日16:33 | #5

    Quick one hundred fifty palm sander to smooth
    ground.

  6. 2018年4月6日17:28 | #6

    Killing Black Mould with Ammonia has its advantages.

  7. 2018年4月7日00:04 | #7

    MacOS could now prompt you to allow Location Services.

  8. 2018年4月7日14:49 | #8

    For cupped or wavy floors, a drum sander is required.

  9. 2018年4月8日18:33 | #9

    Rinse with clear water and permit to dry completely.

  10. 2018年4月9日10:33 | #10

    You possibly can say Laminate flooring is a hybrid.

  11. 2018年4月9日16:08 | #11

    Book a skilled lawn pro in Kansas Metropolis.

  12. 2018年4月12日12:53 | #12

    Օh my goodness! Awesome article dude! Ƭhanks,
    Hoᴡeveг I am encountering issues ѡith yoᥙr RSS.
    Ι don’t understand the reason why І amm unable to subscribe to іt.
    Is there anybⲟdy еlse havіng identical RSS
    issues? Antone tһat knows the answer wilⅼ yοu kindly respond?

    Thanx!!

  13. 2018年4月13日06:34 | #13

    Pretty ѕection of content. I just stumbled ᥙpon your weblog
    ɑnd in accession capital tⲟ assert that Ι get actuaⅼly enjoyed
    account ʏour blog posts. Аny way I’ll be subscribing tօ your augment аnd even I achievement yoս access consistently fаst.

  14. 2018年4月14日11:38 | #14

    It’ѕ impressive that you ɑrе getting ideas from this
    piece оf writing aѕ well aѕ from our argument made at this
    place.

  15. 2018年4月15日06:56 | #15

    Remove Mold From Virtually Any Floor.

  16. 2018年4月15日21:13 | #16

    buy brand cialis cheap generic cialis 20mg tablets
    buy cialis online estudios de cialis genricos canadian discount cialis

  17. 2018年4月15日22:15 | #17

    cialis cipla best buy buying cialis in colombia
    cialis in usa american pharmacy cialis cialis 10 doctissimo

  18. 2018年4月16日18:47 | #18

    cialis y deporte generic cialis levitra
    Cheap Cialis usa free generic cialis prescription doctor cialis

  19. 2018年4月16日19:38 | #19

    cialis canadian drugs cialis kamagra levitra
    cialis usa import cialis cialis 5 mg effetti collateral

  20. 2018年4月16日20:04 | #20

    They not too long ago took down three large timber from my yard.

  21. 2018年4月16日21:16 | #21

    Website-completed flooring gives numerous advantages.

  22. 2018年4月17日11:01 | #22

    cialis super acti il cialis quanto costa
    cheap cialis american pharmacy cialis look here cialis cheap canada

  23. 2018年4月17日11:52 | #23

    cialis price thailand fast cialis online
    buy cialis female cialis no prescription cialis e hiv

  24. 2018年4月18日04:31 | #24

    the best choice cialis woman prices on cialis 10 mg
    cialis usa cialis rezeptfrei sterreich cialis online holland

  25. 2018年4月18日05:28 | #25

    cost of cialis per pill generic cialis 20mg uk
    Buy Cheap Cialis usa only best offers 100mg cialis cialis online deutschland

  26. 2018年4月18日15:32 | #26

    Find a local Mohawk carpet and flooring store.

  27. 2018年4月20日12:55 | #27

    Name 631-424-2585 for installation, maintenance, pumping.

  28. 2018年4月21日01:34 | #28

    Thaznk youu foor thhe auspoicious writeup. It in fac sed too
    bbe a enjoyment account it. Glance advanced to moree beought agreeable
    fom you! By thee way, how can we keep uup a correspondence?

  29. 2018年4月22日06:04 | #29

    Oak and maple are the most typical hardwoods used.

  30. 2018年4月23日21:03 | #30

    bookmarked!!, I lie your website!

  31. 2018年4月25日01:02 | #31

    Mildew spores is not going to survive in dry climates.

  32. 2018年4月25日01:02 | #32

    You’ll be able to say Laminate flooring is a hybrid.

  33. 2018年4月25日12:09 | #33

    Set up of the vapor barrier was truly the simple half.

订阅评论
0+9= (必填)