觸屏版
全國(guó)服務(wù)熱線:0571-87205688
登錄
注冊(cè)
客戶中心
關(guān)注云客
vps更換服務(wù)器后網(wǎng)卡不通的處理辦法
更換網(wǎng)卡vps主機(jī)不通,在更換服務(wù)器的時(shí)候linux的主機(jī)時(shí)常遇到這類問題。
具體處理辦法是:
1.查看目前使用網(wǎng)卡和配置的實(shí)際mac地址(下面的使用的eth1)
[root@localhost ~]# vi /etc/udev/rules.d/70-persistent-net.rules
顯示信息如下:(可能會(huì)多出一段是eth_sudu的)
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# net device ()
# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:22:*", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:4a:ff:2a:23:3d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
~
注意:ATTR{address}=="00:4a:ff:2a:23:3d"中的00:4a:ff:2a:23:3d為vps使用mac地址,如果與實(shí)際分配的不一樣,必須修改成實(shí)際使用的
2.配置網(wǎng)卡信息(注意:ip,網(wǎng)關(guān),掩碼,配置與實(shí)際相同即可)
vi /etc/sysconfig/network-scripts/ifcfg-eth1
顯示信息如下:
DEVICE="eth1"
ONBOOT="yes"
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPADDR=192.168.0.7
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
3.重啟網(wǎng)卡服務(wù)
[root@localhost ~]# service network restart
評(píng)論(0人參與,0條評(píng)論)
發(fā)布評(píng)論
最新評(píng)論