linux无法添加网络连接到服务器地址,ubuntu9.1服务器版局域网IP设置 网络无法连接(急)...

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

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值