linux 下面提示:Ignoring unknown interface eth0=eth0的解決方案

剛裝了臺debian的虛擬機,提示 Ignoring unknown interface eth0=eth0
結果上不到網,出現以下情況:
在設置靜態IP的時候 不能保存
/etc/init.d/networking restart
提示
Ignoring unknown interface eth0=eth0. SIOCSIFADDR: No such device
ifconfig -a eth0是存在的
解決方案:
首先刪除
/etc/udev/rules.d/70-persistent-net.rules 文件  之後重啓讓系統重新生成eth0配置文件
rm -f etc/udev/rules.d/70-persistent-net.rules
reboot
之後發現系統正常了,另外修改eth0爲eth1的方式
於是手動修改etc/udev/rules.d/70-persistent-net.rules 文件
vi etc/udev/rules.d/70-persistent-net.rules 文件
把eth0改爲eth1
之後修改 /etc/network/interfaces 文件
 vi /etc/network/interfaces
內容如下
auto eth1 //自動啓用eth1
iface eth1 inet static //eth1爲靜態IP
address 192.168.0.16 //ip地址
netmask 255.255.255.0 //子網掩碼
gateway 192.168.0.1 //網關
之後修改/etc/resolv.conf 
vi /etc/resolv.conf 
修改DNS 內容如下
# Generated by NetworkManager
nameserver 219.149.194.55  //電信DNS
nameserver 8.8.8.8 //谷歌提供的免費DNS解析
保存之後重啓networking服務
/etc/init.d/networking restart
OK 可以上網了。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章