Microsoft MVP성태의 닷넷 이야기
오류 유형: 966. Ubuntu - ping: connect: Network is unreachable [링크 복사], [링크+제목 복사],
조회: 2457
글쓴 사람
정성태 (seongtaejeong at gmail.com)
홈페이지
첨부 파일
 

Ubuntu - ping: connect: Network is unreachable

설치해 둔 Ubuntu 24.04 LTS에서 외부 접속이 안 됩니다. ^^;

$ ping www.naver.com
ping: connect: Network is unreachable

또 DNS 서버 설정이 풀렸나 싶었더니... 그건 또 아닙니다.

$ resolvectl status
Global
         Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
  resolv.conf mode: stub
Current DNS Server: 8.8.8.8
       DNS Servers: 8.8.8.8

...[생략]...

그러니까, IP를 직접 찍어도 연결이 안 됩니다.

$ ping 23.212.12.248
ping: connect: Network is unreachable

보니까, 라우팅 테이블이 꽤나 한산합니다. ^^;

$ ip route
192.168.100.0/24 dev eth0 proto kernel scope link src 192.168.100.50 

$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.100.0   0.0.0.0         255.255.255.0   U         0 0          0 eth0

보통은 아래에서처럼 "default via ..." 같은 게 있어야 하는데,

// 정상적인 경우였다면,

$ ip route
default via 192.168.100.1 dev eth1 proto static metric 100 
192.168.100.0/24 dev eth1 proto kernel scope link src 192.168.100.25 metric 100 
...[생략]...

$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.100.1   0.0.0.0         UG        0 0          0 eth1
...[생략]...

그게 없는 것입니다. 즉, 오로지 192.168.100.x 대역의 IP에 대해서만 eth0 인터페이스를 통해 접속이 되고 있는 것입니다. 따라서 default gateway 설정만 추가하면,

$ sudo ip route add default via 192.168.100.1 dev eth0

// (2025-07-08 업데이트) 위의 명령어로 인한 변화는 재부팅 후 사라집니다.
// How to add persistent IP routes in Ubuntu 20.04 server
// ; https://askubuntu.com/questions/1345376/how-to-add-persistent-ip-routes-in-ubuntu-20-04-server 
// 1. edit config file in /etc/netplan
//    routes:
//    - to: default
//      via: 192.168.100.1
// 2. sudo netplan generate
// 3. sudo netplan apply

이후 정상적으로 ping이 됩니다.

$ ping www.microsoft.com
PING e13678.dscb.akamaiedge.net (23.40.45.184) 56(84) bytes of data.
64 bytes from a23-40-45-184.deploy.static.akamaitechnologies.com (23.40.45.184): icmp_seq=1 ttl=54 time=3.29 ms
64 bytes from a23-40-45-184.deploy.static.akamaitechnologies.com (23.40.45.184): icmp_seq=2 ttl=54 time=3.08 ms
...[생략]...




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 7/8/2025]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 166  167  168  169  170  171  172  173  174  175  [176]  177  178  179  180  ...
NoWriterDateCnt.TitleFile(s)
682정성태3/27/200931134디버깅 기술: 25. 보호 모드로 응용 프로그램 디버깅하는 방법 [2]
681정성태3/23/200928245오류 유형: 73. SQL Server 2008 Express 설치 오류
680정성태3/21/200928149.NET Framework: 125. WPF - RadioButton에 대한 데이터바인딩(2) [1]파일 다운로드1
679정성태3/15/200922725오류 유형: 72. IE 8 멈춤 현상 - 두 번째 이야기
678정성태3/15/200928372개발 환경 구성: 37. Hyper-V에서 Vista의 Virtual Machine Bus 장치 인식 문제
677정성태3/15/200928677개발 환경 구성: 36. MSI P45 Neo3-FR V2 - RAID 1 구성
997정성태2/26/201124219    답변글 개발 환경 구성: 36.1. 개발 환경 구성: 34 - 1. RAID 1 구성 이후...
676정성태3/15/200925341오류 유형: 71. IE 8 RC1 - 멈춤 현상
675정성태3/14/200928116오류 유형: 70. Virtual Machine Additions 제거
673정성태3/11/200926504웹: 10. 금일 진행되었던 마이크로소프트 IE 8 행사의 ActiveX 세션 PPT [6]파일 다운로드1
672정성태3/1/200939977Windows: 43. Loopback network adapter 설치하기 [2]
670정성태2/22/200933423.NET Framework: 124. IIS 7에서 SVC 호스팅 [1]
669정성태2/21/200927384오류 유형: 69. The SQL Server Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service.
668정성태2/21/200932863개발 환경 구성: 35. SQL Express 버전과 User Instance 옵션
667정성태2/14/200944496웹: 9. IE 7. IWebBrowser2 인터페이스 메서드의 Navigate / Navigate2 차이점 [3]파일 다운로드1
666정성태2/12/200931210웹: 8. IE 8: 프로세스와 윈도우의 관계 - LCIE [1]파일 다운로드1
665정성태2/7/200927622웹: 7. Internet Explorer 8 - XHR, XDR, XST, XSRF [1]
664정성태2/5/200923608Windows: 42. Concurrency Runtime
663정성태2/5/200928120.NET Framework: 123. WPF - Arial Narrow 폰트 문제
662정성태2/3/200923548VS.NET IDE: 59. HyperAddin 도구 사용 설명 [1]
661정성태2/3/200927225오류 유형: 68. msxml6r.dll 설치 오류
660정성태2/3/200926079Windows: 41. UAC 보안 취약 [2]
659정성태2/2/200937246오류 유형: 67. ClickOnce 응용 프로그램이 실행되지 않을 때.
658정성태2/1/200929538Team Foundation Server: 30. 소스 서버 보안
657정성태2/1/200932583Windows: 40. Q1 Ultra + Windows 7 베타
656정성태2/1/200933619디버깅 기술: 24. .NET JIT 최적화 코드 생성 제어
... 166  167  168  169  170  171  172  173  174  175  [176]  177  178  179  180  ...