linux小记

linux 防火墙开启关闭
(1)即时生效,重启失效
service iptables start

service iptables stop
(2)重启后生效
chkconfig iptables on
chkconfig iptables off

查看端口状态
(1)upd
netstat -nupl
(2)tcp
netstat -ntpl

查看某端口状态  lsof
例如:lsof -i:80

netstat -an | grep port

拒绝端口访问
例如拒绝3000端口访问
iptables -A INPUT --dport 3000 -j DROP

例如拒绝3000以上的端口访问
iptables -A INPUT --dport 3001:65535 -j DROP

开启3000端口
iptables -A INPUT -p tcp --dport 3000 -j ACCEPT
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值