Microsoft MVP성태의 닷넷 이야기
오류 유형: 966. Ubuntu - ping: connect: Network is unreachable [링크 복사], [링크+제목 복사],
조회: 4034
글쓴 사람
정성태 (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

비밀번호

댓글 작성자
 




... 181  182  183  184  185  186  187  188  189  [190]  191  192  193  194  195  ...
NoWriterDateCnt.TitleFile(s)
332정성태8/20/200632303    답변글 디버깅 기술: 5.14. GAC 에 등록된 Assembly 디버그 [2]
341정성태9/16/200624524    답변글 디버깅 기술: 5.15. [내용 예약]
342정성태9/16/200642376    답변글 디버깅 기술: 5.16. ASP.NET 디버깅 환경 구성 [1]파일 다운로드1
306정성태2/13/200721524기타: 15. .NET 이 생산성이 높다는 증거(!)
304정성태7/21/200623817VS.NET IDE: 41. 하위 폴더의 모든 프로젝트의 출력물을 제거 (Clean)
305정성태7/21/200623509    답변글 VS.NET IDE: 41.1. 하위 폴더의 모든 프로젝트의 출력물을 제거 (Clean) [1]
303정성태7/20/200621468Team Foundation Server: 12. 사용자 계정 재생성에 따른 Version Control 영향
302정성태8/21/200623328Team Foundation Server: 11. TFS Team Build와 VC++ Project 설정
299정성태7/23/200622959개발 환경 구성: 5. VMWare - VM 생성 화면 캡쳐
300정성태7/15/200628491    답변글 개발 환경 구성: 5.1. VMWare 오류 유형 - The handle is invalid.
301정성태7/18/200623207    답변글 개발 환경 구성: 5.2. VMWare - 사용 후기.
298정성태7/14/200622965개발 환경 구성: 4. VMWare Server를 64bit 운영체제에 설치 시 주의 사항 [2]
296정성태7/10/200632040.NET Framework: 73. [ASP.NET] HTC(DHTML Control Behavior)를 WebResource.axd로 제공하는 방법 [3]
295정성태7/1/200625482VC++: 25. Microsoft National Language Support Downlevel APIs 1.0 사용 방법파일 다운로드1
294정성태6/30/200622050.NET Framework: 72. XSDObjectGen.EXE 기능 개선
293정성태6/29/200623985Team Foundation Server: 10. TFS 버전 컨트롤(TFVC)에 참여시킨 프로젝트의 로컬 경로를 옮기는 방법
290정성태6/26/200621370Team Foundation Server: 9. HTTPS를 통한 Team Server 접근 - 두 번째 이야기 [1]
291정성태6/26/200622769    답변글 Team Foundation Server: 9.1. [선행 작업] HTTPS 를 통한 Team Server 접근 - 두번째 이야기 [1]
292정성태6/26/200622312    답변글 Team Foundation Server: 9.2. TF30177 오류 발생
307정성태8/3/200624258    답변글 Team Foundation Server: 9.3. Team Server 접근 이름을 바꾸는 방법 [1]파일 다운로드1
308정성태2/18/200723961        답변글 Team Foundation Server: 9.4. Team Server HTTPS 접근 완료. ^^ [1]
288정성태6/26/200638508오류 유형: 10. error MSB6006: "aspnet_merge.exe" exited with code 1
286정성태6/23/200626351웹: 4. 웹 사이트 식별자(Identifier) 값 변경
285정성태6/20/200626744오류 유형: 9. [TFS] Report 관련 서비스를 조회할 때 rsErrorImpersonatingUser 오류 메시지 발생 [1]
284정성태6/19/200624414VS.NET IDE: 40. FxCop - IDE 에서 제공해 주는 SuppressMessage 코드
283정성태1/19/200725697Team Foundation Server: 8. 소스 세이프에서 TFS SourceControl 로 마이그레이션 [2]
... 181  182  183  184  185  186  187  188  189  [190]  191  192  193  194  195  ...