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
Ïà¹ØÎĵµ£º
1. HCI²ãÐÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI) ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈÐÒé ......
LinuxÖÐwaitÓ÷¨£º
ϵͳÖеĽ©Ê¬½ø³Ì¶¼ÒªÓÉwaitϵͳµ÷ÓÃÀ´»ØÊÕ¡£
º¯ÊýÔÐÍ£º
#include<sys/types.h>
#include<sys/wait.h>
pid_t wait(int *status);
½ø³ÌÒ»µ©µ÷ÓÃÁËwait¾ÍÁ¢¼´×èÈû×Ô¼º£¬ÓÉwait×Ô¶¯·ÖÎöÊÇ·ñµ±Ç°½ø³ÌµÄij¸ö×Ó½ø³ÌÒѾÍ˳ö£¬Èç¹ûÈÃËüÕÒµ½ÁËÕâÑùÒ»¸öÒѾ±ä³É½©Ê¬µÄ×Ó½ø³Ì£¬wait¾Í»áÊÕ¼¯Õâ ......
ÏµÍ³ÖØÆôºó·¢ÏÖ£¬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 ......
1£®¹ØÓÚÎļþ/Ŀ¼´¦ÀíµÄÖ¸Áî
1.1 ls Ö¸Áî
lsµÄÒâÒåΪ“list”£¬Ò²¾ÍÊǽ«Ä³Ò»¸öĿ¼ÏµÄÄÚÈÝÏÔʾ³öÀ´¡£
lsÓÐһЩ²ÎÊý£¬¿ÉÒÔ¸øÓèʹÓÃÕ߸ü¶àÓйصÄ×ÊѶ£¬ÈçÏ£º
-a£ºÔÚlinuxÖÐÈôÒ»¸öĿ¼»òÎļþÃû×ֵĵÚÒ»¸ö×ÖԪΪ“.”£¬ÔòʹÓÃls½«²»»áÏÔʾ³öÕâ¸öÎļþµÄÃû×Ö£¬ÎÒÃdzƴËÀàÎļþΪÒþ²ØÎļþ¡£Èç¹ûÎÒà ......
To enable dumps for every daemon:
ulimit -c unlimited >/dev/null 2>&1 (-c maximum size of core files)
ulimit -S -c ${DAEMON_COREFILE_LIMIT:-0} >/dev/null 2>&1
Dump for system
:
DAEMON_COREFILE_LIMIT='unlimited'
The same for every daemon (in /etc/sysconfig/_daemon_ ......