红联Linux门户
Linux帮助

ubuntu9.1服务器版局域网IP设置 网络无法连接(急)

发布时间:2010-01-19 12:53:43来源:红联作者:szfhx
我的网络环境是要设置静态IP地址的 网段是192.168.2.X 电信DNS 61.177.7.1 221.228.255.1(备用)

我的interfaces配置如下:
$ sudo vim /etc/network/interfaces
代码:
auto eth0
iface eth0 inet static
address 192.168.2.99
netmask 255.255.255.0
gateway 192.168.2.1

resolv.conf配置如下:
#配置DNS服务器的地址,下面是电信的DNS服务器IP地址
$ sudo vim /etc/resolv.conf
nameserver 61.177.7.1
nameserver 221.228.255.1

$ sudo /etc/init.d/networking restart
重启网络配置的时候出现这个情况:
ubuntu:~$ sudo /etc/init.d/networking restart
* Reconfiguring network interfaces.../etc/network/interfaces:2: misplaced option
ifdown: couldn't read interfaces file "/etc/network/interfaces"
/etc/network/interfaces:2: misplaced option
ifup: couldn't read interfaces file "/etc/network/interfaces"
[fail]

$ ping 127.0.0.1,不通。
必须$ ifconfig lo up
ping 127.0.0.1,才通。
但ping 192.168.2.1 不通 提示:network is unreachable
$ ifconfig -a #查看
eth0 没按设想是192.168.2.99
wal0
好像interfaces设置没起作用
我的机器有1个有线网卡和1个无线网卡,以前在ubuntu9.1图形界面中是可以设置上网的
但我查下以前图形界面中设置是在/etc/NetworkManager/system-connections/有线连接 1 的文件(内容如下),但以下内容是在图形界面中设置自动生成的
[connection]
id=有线连接 1
uuid=8baafb91-4d3a-456c-9ea6-3f4746ae9945
type=802-3-ethernet
autoconnect=true
timestamp=0

[ipv4]
method=manual
dns=61.177.7.1;
addresses1=192.168.2.99;24;192.168.2.1;
ignore-auto-routes=false
ignore-auto-dns=false
dhcp-send-hostname=false
never-default=false

[802-3-ethernet]
speed=0
duplex=full
auto-negotiate=true
mac-address=0:13:20:d5:e5:61
mtu=0

[ipv6]
method=ignore
ignore-auto-routes=false
ignore-auto-dns=false
never-default=false

无法链接网络。求高人指点迷津!急!谢谢!
文章评论

共有 4 条评论

  1. 于 2012-07-11 16:08:10发表:

    我也遇到 同样问题,怎么解决,QQ:908346810

  2. yyg64 于 2010-01-20 19:50:14发表:

    好深

  3. szfhx 于 2010-01-20 11:44:17发表:

    可读的,我还修改的呐

  4. raymin 于 2010-01-19 13:39:46发表:

    出错信息提示couldn't read interfaces file "/etc/network/interfaces"无法读取这个配置文件啊,权限可读吗?