- net-tools
ifconfig
eth0 第一块网卡(网络接口)
网卡名修改成 eth0
/etc/default/grub,增加 biosdevname=0 net.ifnames=0
更新grub
grub2-mkconfig -o /boot/grub2/grub.cfg
reboot
查看网卡物理连接情况
mii-tool eth0
查看网关
- route -n
网络配置命令:
ifconfig <接口> <ip地址> [netmask]
修改ip地址
ifconfig eth0 修改成的ip地址 netmask 修改成的子网掩码
ifup <接口>
ifup eth0
ifconfig eth0 up
ifdown <接口>
ifdown eth0
ifconfig eth0 down
route del default gw 10.211.55.1
rooute add default gw 10.211.55.2
明细路由:
route add - host 10.0.0.1 gw
指定网段路由:
route add - net 10.0.0.0 netmask 255.255.255.0 gw
网络故障排除
-
ping
-
traceroute
traceroute -w 1
-
mtr
-
nslookup
-
telnet
- telnet
-
tcpdump
- tcpdump - i any -n port 80
-
netstat
- netstat -ntpl
-
ss
网络管理和配置文件
sysv systemd
service network status
ifcfg-eth0
BOOTPROTO=none
IPADDR=
NETWORK=
GATEWAY
/etc/sysconfig/network-script/
/etc/hosts
chkconfig --list network
网络状态
service network status
service network restart
systemctl list-unit-files NetworkManager.service
chkconfig --list network
chkconfig --level 2345 network off
chkconfig --level 2345 network on
systemctl disable NetworkManager
systemctl enable NetworkManager
hostname c7.test11
hostnamectl set- hostname c7.test11
vim /etc/hosts