How to: Linux flush or remove all iptables rules
Here is small script that does this. Debian or Ubuntu GNU/Linux does
not comes with any SYS V init script (located in /etc/init.d directory)
.
You create a script as follows and use it to stop or flush the iptables rules.
Please don't type rules at command prompt. Use the script to speed up work.
Procedure for Debian / Ubuntu Linux
A) Create /root/fw.stop /etc/init.d/fw.stop script using text editor such as vi:
#!/bin/sh
echo "Stopping firewall and allowing everyone..."
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
(B) Make sure you can execute the script:
# chmod +x /root/fw.stop
(C) You can run the script:
# /root/fw.stop
A note for RedHat and friends Linux user
Please note that RedHat enterprise Linux (RHEL) and Fedora / Centos
Linux comes with pre-installed script, which can be used to stop the
firewall:
#/etc/init.d/iptables stop
Ïà¹ØÎĵµ£º
ÏµÍ³ÖØÆôºó·¢ÏÖ£¬ApacheÆô¶¯Ê§°Ü
±¨´íÈçÏ£º
# ./apachectl start
(98)Address already in use: make_sock: could not bind to address [::]:80
no listening sockets available, shutting down
Unable to open logs
²éÁËÏÂ80
#netstat -Inp|grep 80
tcp 0 &n ......
iptables-save > ipt.v1.0
iptables-save > ipt.v1.1
iptables-restore < ipt.v1.0
cp /etc/sysconfig/iptables iptables.raw
service iptables save
ipαװµÄ½Å±¾Îļþiptables_masquerade
#!/bin/bash
//ÉèÖÃlinuxϵͳÔÊÐíip°üµÄת·¢
echo "1" > /proc/sys/net/ipv4/ip_forward
//¼ÓÔØÊµÏÖ ......
1£®¹ØÓÚÎļþ/Ŀ¼´¦ÀíµÄÖ¸Áî
1.1 ls Ö¸Áî
lsµÄÒâÒåΪ“list”£¬Ò²¾ÍÊǽ«Ä³Ò»¸öĿ¼ÏµÄÄÚÈÝÏÔʾ³öÀ´¡£
lsÓÐһЩ²ÎÊý£¬¿ÉÒÔ¸øÓèʹÓÃÕ߸ü¶àÓйصÄ×ÊѶ£¬ÈçÏ£º
-a£ºÔÚlinuxÖÐÈôÒ»¸öĿ¼»òÎļþÃû×ֵĵÚÒ»¸ö×ÖԪΪ“.”£¬ÔòʹÓÃls½«²»»áÏÔʾ³öÕâ¸öÎļþµÄÃû×Ö£¬ÎÒÃdzƴËÀàÎļþΪÒþ²ØÎļþ¡£Èç¹ûÎÒà ......
linuxÏÂĬÈÏÖ»ÄܽâѹzipѹËõÎļþ£¬¶ørarÎļþĬÈÏûÓнâѹ֧³ÖµÄ¹¤¾ß£¬ÕâÀïÌṩһ¸ö¼òµ¥µÄ·½Ê½£¬°²×°rar¹¤¾ß£¬Ö§³ÖlinuxϽâѹrarÎļþ¡£
1£ºÊ×ÏÈÏÂÔØrar½âѹ¹¤¾ß£¬ÕâÀïÓà rarlinux-3.6.b6.tar.gz£¬¸ø³öÒ»¸öÍøÓÑÌṩµÄ°æ±¾ÏÂÔØµØÖ·£º
http://blogimg.chinaunix.net/blog/upfile2/080226173046.gz
2£º½ÓÏÂÀ´Ö´ÐÐÈçϲÙ×÷
t ......
ÀïѧϰlinuxÎļþϵͳ¼¼ÇÉ£¬¹ÒÔØUÅÌÊÇ·ñÁ¬½ÓµÄ¼¼ÇÉ£¬ÎÄÖÐÒÔ°¸Àý½²½â¡£ÍûÄܸø´ó¼Ò´øÀ´Ð¡Ð¡µÄ°ïÖú¡£
LinuxÎļþϵͳÊÇÒì²½µÄ£¬Ò²¾ÍÊÇ˵дһ¸öÎļþ²»ÊÇÁ¢¿Ì±£´æµ½½éÖÊ£¨Ó²ÅÌ£¬UÅ̵ȣ©ÖУ¬¶øÊÇ´æµ½»º³åÇøÄÚ£¬µÈ»ýÀÛµ½Ò»¶¨³Ì¶ÈÔÙÒ»Æð±£´æµ½½éÖÊÖС£Èç¹ûûÓÐumount¾Í·Ç·¨°Î³ö UÅÌ£¬³ÌÐòÊDz»ÖªµÀµÄ£¬fopen,fwriteµÈº¯Êý¶¼ÒÀÈ»·µ»ØÕý ......