더북(TheBook)

뒷부분에서 ping 8.8.8.8 테스트를 할 때 신호를 받아 오지 못한다면, 기본 게이트웨이를 설치하려고 추가한 enp0s9가 아닌 enp0s3으로 설정했기 때문입니다. 이때는 앞의 파일(/etc/network/interfaces)에서 넷마스크 255.255.255.0과 게이트웨이 192.168.56.1을 삭제한 후 네트워크를 재시작해(service networking restart) ping 테스트를 하거나 라우터의 기본 게이트웨이에 enp0s9를 추가하면 됩니다.

root@controller:~# route
Kernel IP routing table
Destination   Gateway         Genmask         Flags Metric Ref  Use Iface
default       192.168.56.1    0.0.0.0         UG         0   0    0 enp0s3
10.0.4.0      *               255.255.255.0   U          0   0    0 enp0s9
192.168.56.0  *               255.255.255.0   U          0   0    0 enp0s3
root@controller:~# ip route add default 10.0.4.2 enp0s9
root@controller:~# route
Kernel IP routing table
Destination   Gateway         Genmask         Flags Metric Ref  Use Iface
default       10.0.4.2        0.0.0.0         UG         0   0    0 enp0s9
default       192.168.56.1    0.0.0.0         UG         0   0    0 enp0s3
10.0.4.0      *               255.255.255.0   U          0   0    0 enp0s9
192.168.56.0  *               255.255.255.0   U          0   0    0 enp0s3
root@controller:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=2 ttl=63 time=35.0 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=63 time=34.9 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=63 time=34.9 ms
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 3 received, 25% packet loss, time 3010ms
rtt min/avg/max/mdev = 34.927/34.976/35.047/0.221 ms
신간 소식 구독하기
뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.