vps更換服務器后網卡不通的處理辦法
更換網卡vps主機不通,在更換服務器的時候linux的主機時常遇到這類問題。
具體處理辦法是:
1.查看目前使用網卡和配置的實際mac地址(下面的使用的eth1)
[root@localhost ~]# vi /etc/udev/rules.d/70-persistent-net.rules
顯示信息如下:(可能會多出一段是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地址,如果與實際分配的不一樣,必須修改成實際使用的
2.配置網卡信息(注意:ip,網關,掩碼,配置與實際相同即可)
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.重啟網卡服務
[root@localhost ~]# service network restart
評論(0人參與,0條評論)
發布評論
最新評論