网络服务管理
service network status 查看指定服务的状态
service network stop 停止指定服务
service network start 启动指定服务
service network restart 重启指定服务
service --status–all 查看系统中所有后台服务
netstat –nltp 查看系统中网络进程的端口监听情况
防火墙设置
防火墙根据配置文件/etc/sysconfig/iptables来控制本机的”出”、”入”网络访问行为。
service iptables status 查看防火墙状态
service iptables stop 关闭防火墙
(在linux中很多软件的端口都被”防火墙”限止,我们需要将防火墙关闭,但是公司开发中,不建议关闭防火墙,打开对应端口可
例:防火墙打开3306端口(mysql端口打开)
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
/etc/rc.d/init.d/iptables save
/etc/init.d/iptables status)
service iptables start 启动防火墙
chkconfig iptables off 禁止防火墙自启