
例如:网卡名 eth0
启用网卡命名 ifconfig eth0 up
禁用网卡命名 ifconfig eth0 down
验证了 suse系统/redhat系统/ubuntu系统/Frdora系统/CentOS系统,均能使用。
https://linuxconfig.org/how-to-configure-static-ip-address-on-ubuntu-18-10-cosmic-cuttlefish-linux
service network restart
有的人用ifconfig -a 查网卡已经配置的正确的IP地址,可是就是ping不能网络,到机房一看网线没接,^@^! 网络不通 会有好多原因,但最先查的就是网卡的网络是还已连接并UP。就像办公室的MM喊着说上不了网,结果“本地连接”都是“X”的一样的情况。[root@localhost root]# mii-tooleth0: negotiated 100baseTx-FD, link oketh1: no link或[root@localhost root]# mii-tool -veth0: negotiated 100baseTx-FD, link okproduct info: vendor 00:50:43, model 2 rev 3basic mode: autonegotiation enabledbasic status: autonegotiation complete, link okcapabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HDadvertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-controllink partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HDeth1: no linkproduct info: vendor 00:50:43, model 2 rev 3basic mode: autonegotiation enabledbasic status: no linkcapabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HDadvertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control或[root@localhost root]# mii-tool -w21:20:33 eth0: negotiated 100baseTx-FD, link ok21:20:33 eth1: no link//mii-tool主要是用于配置网卡工作模式的指令,同时也可以进行查询、监控等工作!2)[root@localhost /]# /etc/init.d/network statusConfigured devices:lo eth0 eth1Currently active devices:lo eth0等同于[root@localhost root]# service --status-allConfigured devices:lo eth0 eth1欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)