posts - 88, comments - 3, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          日歷

          <2012年2月>
          2930311234
          567891011
          12131415161718
          19202122232425
          26272829123
          45678910

          搜索

          •  

          iptables rules

          Posted on 2012-02-27 10:41 Milo的海域 閱讀(232) 評論(0)  編輯  收藏 所屬分類: Linux
          Disable/Enable PORT
          #disable port 29600
          iptables -I INPUT -p tcp --dport 
          29600 -j DROP
          iptables -I OUTPUT -p tcp --dport 
          29600 -j DROP

          #enable port 29600 after disabled
          iptables -D INPUT -p tcp --dport 29600 -j DROP
          iptables -D OUTPUT -p tcp --dport 
          29600 -j DROP

          Block Ipaddress
          # Block comming packets of ipaddress, then all packets come from this address will be dropped
          iptables -A INPUT -s 192.168.1.5 -j DROP

          # Block outgoing packets of ipaddress, then all packets sent to that address will be dropped
          iptables -A OUTPUT -p tcp -d 192.168.1.2  -j DROP

          Disable NIC traffic
          # disable
          iptables -A INPUT -jDROP -i eth1
          iptables -A OUTPUT -jDROP -o eth1

          # enable back
          iptables -D INPUT -jDROP -i eth1
          iptables -D OUTPUT -jDROP -o eth1

          links
          http://wiki.centos.org/HowTos/Network/IPTables
          http://www.thegeekstuff.com/2011/06/iptables-rules-examples/
          主站蜘蛛池模板: 长治县| 罗江县| 晴隆县| 和田县| 玉门市| 岱山县| 云安县| 扎囊县| 尚志市| 中方县| 泸定县| 富川| 晋州市| 灵宝市| 灵山县| 临颍县| 方城县| 盐城市| 郓城县| 瓦房店市| 海宁市| 镇平县| 张家口市| 张掖市| 茌平县| 酉阳| 万州区| 馆陶县| 建宁县| 延安市| 启东市| 丰顺县| 浑源县| 天台县| 延边| 梅河口市| 华宁县| 安康市| 武川县| 辽源市| 柏乡县|