Google의 DNS 또는 네트워크 외부에 핑을 시도하면
connect: Network is unreachable
어떻게됩니까?
이 중 하나를 업데이트 할 수 없습니다.
나는 네트워킹에 익숙하지 않다 ... 그리고 우분투. 그러나 이것들은 내가 도울 것으로 생각한 명령의 결과입니다.
$ 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.
ip route add default via 192.168.0.1 dev eth0
라우터의 IP 주소가 192.168.0.1이라고 가정하면 연결 상태가되어야합니다. 이것이 작동하면 ( ping 8.8.8.8
먼저 시도한 다음 google.com) 변경 사항이 유지되는지 내 답변을 확인하십시오.
ip route show