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的海域 閱讀(230) 評論(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/
          主站蜘蛛池模板: 寿阳县| 鄂州市| 广灵县| 延吉市| 仁怀市| 唐山市| 九龙坡区| 宜都市| 合肥市| 新和县| 都匀市| 克什克腾旗| 贵溪市| 彩票| 芦溪县| 枣阳市| 仁怀市| 罗山县| 腾冲县| 柳江县| 黄平县| 临颍县| 阳东县| 汕尾市| 遂溪县| 东至县| 东乌珠穆沁旗| 黄梅县| 白山市| 海兴县| 水城县| 渑池县| 湟中县| 韶关市| 太谷县| 云和县| 南丹县| 于田县| 绍兴县| 和平县| 南澳县|