Linux 网络设置记录

Linux 网络设置记录

Tcping

1
2
3
4
5
yum install -y tcptraceroute bc
apt-get install -y tcptraceroute bc
cd /usr/bin
wget -O tcping https://soft.mengclaw.com/Bash/TCP-PING
chmod +x tcping

BestTrace

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 获取安装列表
$ yum list | grep zip/unzip
# 安装zip
$ yum install zip unzip -y
# 安装 best trace
$ wget http://cdn.ipip.net/17mon/besttrace4linux.zip
$ unzip besttrace4linux.zip
# 64 位系统
$ chmod +x besttrace
# 32 位系统
$ chmod +x besttrace32
# 用法
$ ./besttrace -q 1 IP
$ ./besttrace32 -q l 192.168.1.1

SpeedTest

1
2
3
wget --no-check-certificate -O speedtest https://raw.github.com/sivel/speedtest-cli/master/speedtest.py 
chmod +x speedtest
./speedtest
1
./speedtest --server id

speedtest server list

Country Provider Host ID
China China Mobile Group Zhejiang Co.,Ltd ltetest1.139site.com:8080 4647
China China Telecom ZheJiang Branch 122.229.136.10:8080 7509
China Hangzhou , Zhejiang Unicom 101.71.241.238:8080 5300
China wang su speedtest.tkfl.cc:8080 26308
China 5UFVPN cn_hz1.we.tm:8080 8173
China ZheJiang Mobile XiHu ltetest6.139site.com:8080 12278
1
./speedtest --list|grep 'China'

关闭 IPV6

1
2
3
4
5
6
7
8
$ ifconfig
$ ip addr list
# 编辑配置文件
$ vi /etc/sysctl.conf
# 添加配置
$ net.ipv6.conf.all.disable_ipv6=1
# 重启服务
$ sysctl -p /etc/sysctl.conf

DNS 修改

查看 DNS

1
cat /etc/resolv.conf 
  • 方法一
1
2
3
4
5
6
# 添加配置 dns=done
$ vi /etc/NetworkManager/NetworkManager.conf
# 修改 dns
$ vi /etc/resolv.conf
# 重启网卡
$ systemctl restart NetworkManager.service
  • 方法二
1
2
3
4
5
6
# 查看当前启动的连接
$ nmcli connection show
# 修改 dns
$ nmcli con mod eth0 ipv4.dns "8.8.8.8 114.114.114.114"
# 生效
$ nmcli con up eth0