服务器端口配置+常用检测脚本

2023-08-13 Sun Views 脚本 | 服务器 | Linux1082字5 min read

端口配置

开启防火墙: systemctl start firewalld.service
查看firewall服务状态:systemctl status firewalld
查看firewall的状态:firewall-cmd --state
查看防火墙规则:firewall-cmd --list-all
查询端口是否开放:firewall-cmd --query-port=19999/tcp
开放19999端口:firewall-cmd --permanent --add-port=19999/tcp
移除端口:firewall-cmd --permanent --remove-port=8080/tcp
重启防火墙(修改配置后要重启防火墙): firewall-cmd --reload

开放端口

CentOS 7RedHat 7 之前的 Linux 发行版开放端口

#命令方式开放5212端口命令

#开启5212端口接收数据
/sbin/iptables -I INPUT -p tcp --dport 5212 -j ACCEPT


#开启5212端口发送数据
/sbin/iptables -I OUTPUT -p tcp --dport 5212 -j ACCEPT

#保存配置
/etc/rc.d/init.d/iptables save

#重启防火墙服务
/etc/rc.d/init.d/iptables restart

#查看是否开启成功
/etc/init.d/iptables status

CentOS 7RedHat 7 之后的 Linux 发行版开放端口

firewall-cmd --zone=public --add-port=2333/tcp --permanent

# --zone 作用域

# --add-port=5121/tcp 添加端口,格式为:端口/通讯协议

# --permanent 永久生效,没有此参数重启后失效

重启防火墙(修改配置后要重启防火墙): firewall-cmd --reload

检测脚本

转载自NS论坛【宝典在手,江山我有】小白闯江湖之常用一键脚本!

网络测试类

三网测速

bash <(curl -Lso- https://www.infski.com/files/superspeed.sh)

来源:更新了一下三网测速脚本节点信息-美国VPS综合讨论-全球主机交流论坛
用途:三网多线程测速

Hyperspeed

bash <(curl -Lso- https://bench.im/hyperspeed)

来源:改了下 SuperSpeed 三网测速脚本-美国VPS综合讨论-全球主机交流论坛
用途:测试三网单线程测速,比方说油管速度就是单线程

硬件测试类

geekbench和yabs

geekbench5

curl -sL yabs.sh|bash -s -- -if -fdi5

yabs

curl -sL yabs.sh | bash

来源:masonr/yet-another-bench-script: YABS
用途:geekbench5只测试小鸡的cpugeekbench5的跑分,去掉了网络和硬盘测试。
现在的yabs默认是6,yabs同时还提供小鸡的硬盘和网络测试,具体详细的参数看作者githubreadme

geekbench5功能增强

bash <(curl -sL gb5.top)

来源:i-abc/GB5: Geekbench 5 专测

bench.sh

wget -qO- bench.sh | bash

来源:一键测试脚本bench.sh | 秋水逸冰
用途:秋水大佬的脚本,可以显示linux小鸡的详细信息,以及硬盘和网络的测试。如果要测试小鸡国外的速度的话,用这个。

硬盘测试

dd bs=64k count=4k if=/dev/zero of=test oflag=dsync

用途:用dd命令测试小鸡的硬盘性能

超售检测

curl https://raw.githubusercontent.com/uselibrary/memoryCheck/main/memoryCheck.sh | bash
wget --no-check-certificate -O memoryCheck.sh https://raw.githubusercontent.com/uselibrary/memoryCheck/main/memoryCheck.sh && chmod +x memoryCheck.sh && bash memoryCheck.sh

来源:超售检查一键脚本 -美国VPS综合讨论-全球主机交流论坛
用途:检测小鸡是否超售,不过其实自己买小鸡那价格超没超售,都应该心知肚明了。有钱还是上杜甫。

ip检测

流媒体检测

bash <(curl -L -s https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh)

来源:lmc999/RegionRestrictionCheck
用途:测试小鸡ip的流媒体以及chatgpt解锁,同时这个脚本在安卓的temuxiosishmac的终端上也是能用的,可以用来判断机场的节点是否支持解锁。windows的话可以用linux子系统。

四网回程测试

wget -O jcnf.sh https://raw.githubusercontent.com/Netflixxp/jcnfbesttrace/main/jcnf.sh && chmod +x jcnf.sh && clear &&./jcnf.sh

来源:Netflixxp/jcnfbesttrace
用途:测试小鸡的四网回程路由,三大运营商和教育网的路由。

综合脚本

融合怪

bash <(wget -qO- --no-check-certificate https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh)

来源:spiritLHLS/ecs: VPS融合怪服务器测评脚本

lemonbench

wget -qO- https://raw.githubusercontent.com/LemonBench/LemonBench/main/LemonBench.sh | bash -s -- --fast

来源:LemonBench/LemonBench: A simple Linux Benchmark Toolkit

用途:上面两个都是综合测试小鸡的各项性能,怎么用看作者的readme

魔法类

xui

bash <(curl -Ls https://raw.githubusercontent.com/FranzKafkaYu/x-ui/master/install.sh)

v2ray-agent

wget -P /root -N --no-check-certificate "https://raw.githubusercontent.com/mack-a/v2ray-agent/master/install.sh" && chmod 700 /root/install.sh && /root/install.sh

warp

wgcf

wget -N https://raw.githubusercontent.com/fscarmen/warp/main/menu.sh && bash menu.sh [option] [lisence]

Warp-go

wget -N https://raw.githubusercontent.com/fscarmen/warp/main/warp-go.sh && bash warp-go.sh
EOF
返回上一页