ip -s link show eth0 网卡流量
ip route 本地路由
route -n
tracepath 192.168.1.120 -n 本机到网关有多少跳
ss -ltn 显示本地监听的tcp端口
nmcli connection show --active
nmcli device status
nmcli connection show ens33 显示对应网卡详细信息
ifconfig eth0:1 192.168.1.110 netmask 255.255.255.0 up
ip route show
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.111
169.254.0.0/16 dev eth0 scope link metric 1002
default via 192.168.1.1 dev eth0
src source ip 地址
ip addr del 192.168.1.110/24 dev eth0
ip addr add 192.168.1.130/24 dev eth0:testing 添加网络子接口
ifconfig eth0:techdept 192.168.1.111/14
ip linkhelp
ip link show #查看链路检测 命令可简化为 ip li sh
ip addr show
ip route get 1.1.1.1 测试经由网关及路由
ip route replace default via 192.168.1.1 改路由
ip route add 0.0.0.0/0 via 192.168.1.1
/etc/sysconfig/network 文件来配置网关,网关只有一个,ifcfg-文件的网关再配置会覆盖正确网关,
所以不建议在ifcfg文件中进行网关默认
grep -i gateway ./ifcfg-*
route add -net 192.168.200.1 netmask 255.255.255.0 gw 192.168.3.1
route del -net 192.168.200.1/34
主机名 /etc/sysconfig/network
同时更改 /etc/hosts
网络冗余技术
bonding
telnet nameserver 53 测试dns是否可用
nslookup baidu.com 解析dns
host 反向解析
dig 域名解析
netstat -t,--tcp -u,--udp -l,--listen -n,--numeric -p,--programname
可设置 eth0-techdept 文件
为eth0:techdept (网络子接口) 网口设置
restart NetworkManager.service #Centos8 重启网络service 命令
更改hostname
主机名 /etc/sysconfig/network
同时更改 /etc/hosts
无线网络
iwconfig #检测网口
ip linkset wlan0 up #启动
iw dev wlan0 scan|less
iw dev wlan0 connect [SSID] key 0:[*****]
iwlist wlp4s0 scan |grep ESSID 查看可以搜索到的无线网络的名称
ip -s link show eth0 网卡流量 ip route 本地路由 route -n tracepath 192.168.1.120 -n 本机到网关有多少跳 ss -ltn 显示本地监听的tcp端口 nmcli connection show --active nmcli device status nmcli connection show ens33 显示对应网卡详细信息 ifconfig eth0:1 .