300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > linux无法添加网络连接到服务器地址 ubuntu9.1服务器版局域网IP设置 网络无法连接(急)...

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

时间:2023-06-18 00:43:41

相关推荐

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

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

发布时间:-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

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

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。