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

          iptables rules

          Posted on 2012-02-27 10:41 Milo的海域 閱讀(229) 評(píng)論(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/
          主站蜘蛛池模板: 呼图壁县| 万年县| 南岸区| 息烽县| 大悟县| 太康县| 罗源县| 米泉市| 娄烦县| 金华市| 安仁县| 揭西县| 博乐市| 当雄县| 长武县| 隆子县| 洛隆县| 大冶市| 郑州市| 明星| 宽城| 犍为县| 望江县| 呼和浩特市| 嘉祥县| 周口市| 麻阳| 舟山市| 梧州市| 双城市| 梓潼县| 昌江| 孙吴县| 长顺县| 若羌县| 桐乡市| 马鞍山市| 龙门县| 城口县| 阜康市| 永仁县|