当我尝试ping谷歌的dns或网络外的任何其他设备时,我得到了
connect: Network is unreachable
?
我也无法更新这个
我是网络新手...还有Ubuntu。但是这些是我认为可能会帮助一些命令的结果
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:0e:7f:a9:10:54 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.5/24 brd 192.168.0.255 scope global eth0
inet6 fe80::20e:7fff:fea9:1054/64 scope link
valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
link/ether 86:0b:cb:43:63:a5 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
mcserver@helloworld:~$
$ vi /etc/resolv.conf:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.0.5
nameserver 8.8.8.8
$ vi /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.0.5
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.0.255
post-up iptables-restore < /etc/iptables.up.rules
dns-nameservers 192.168.0.5 8.8.8.
192.168.0.0/24 dev eth0原型内核作用域链接src 192.168.0.5 192.168.122.0/24 dev virbr0原型内核作用域链接src 192.168.122.1
—
user240010 2014年
ip route add default via 192.168.0.1 dev eth0
假设您路由器的IP地址为192.168.0.1,您应该可以连接。如果可行(ping 8.8.8.8
先尝试,然后尝试google.com),请检查我的回答以保留更改。
@ user240010,您编写了一个出色的解决方案。请问您如何解决?谢谢。
—
弗兰克
@GnP,您编写了一个出色而巧妙的解决方案。我刚刚发现它在注销后不会持续存在。您能告诉我如何坚持吗?谢谢。
—
弗兰克
ip route show