歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> 配置Ubuntu的網絡時遇到了錯誤

配置Ubuntu的網絡時遇到了錯誤

日期:2017/3/3 15:57:41   编辑:關於Linux

配置Ubuntu的網絡已經不是第一次了,今天遇到了個錯誤,以前從來沒遇到過的,感覺很郁悶!

在使用/etc/init.d/networking restart的時候,出現了

RTNETLINK answers: File exists

表示很郁悶,然後ping了一下,提示網絡不可達。看了一下路由表,發現沒網關,最後使用命令加網關

# route add default gw 1.1.1.254

結果,又報錯

SIOCADDRT: no such process. frustrating error.

網上找了一些資料,也沒得到解決,最後自己發現,配置文件寫錯了。

root@node1:/etc/network# cat interfaces  
# This file describes the network interfaces available on your system 
# and how to activate them. For more information, see interfaces(5). 
     
# The loopback network interface
auto lo 
iface lo inet loopback 
     
# The primary network interface
auto eth0 
iface eth0 inet static
address 1.1.1.1
metmask 255.0.0.0
gateway 1.1.1.254
dns-nameservers 1.1.1.254

輸入的時候,可能太快了,把netmask寫成了metmask,小記一下!

URL:http://www.bianceng.cn/OS/Linux/201410/46051.htm

Copyright © Linux教程網 All Rights Reserved