
술어
S1
클라우드에서 실행 중인 서버( 이라고 함)가 있는데 제대로 작동하지 않습니다. 또한 S2
동일한 클라우드 네트워크에서 실행되는 다른 서버( )가 S1
별도의 네트워크( eth1
)를 통해 연결되어 있습니다.
서버는 S1
를 통해 해당 내부 네트워크에 연결되고 eth1
, 을 통해 웹에 직접 연결됩니다 eth0
.
S1
를 변경하여 깨끗한 Debian Wheezy에서 업그레이드한 Debian Jessie를 실행 중입니다 /etc/apt/sources.list
.
S2
완벽하게 작동하는 는 Debian Wheezy를 실행하고 있습니다. S1
업그레이드 전과 똑같은 깨끗한 Debian Wheezy .
상황
S1
네트워크 외부에서 SSH를 통해 연결할 수 있습니다- 인터페이스를 통해
eth0
.
- 인터페이스를 통해
S1
다른 서버에서 SSH를 통해 연결할 수 있습니다 (S2
).- 인터페이스를 통해
eth1
.
- 인터페이스를 통해
S1
에서 다른 서버(S2
) 에 연결할 수 있습니다 .- 인터페이스를 통해
eth1
.
- 인터페이스를 통해
- 저 할 수 있어요~ 아니다
S1
외부 세계와 연결하다- 통해서가 아니라
eth0
- 통해서가 아니라
eth1
- 다른 서버에 SSH로 연결할 수 없습니다. 핑을 할 수 없습니다
8.8.8.8
(하지만S2
~할 수 있다); 호스트를 확인할 수 없습니다(8.8.8.8
에서 사용/etc/resolv.conf
).
- 통해서가 아니라
문제와 시도
나는 왜 외부 세계에 연결할 수 없는지에 대해 가장 이상한 생각을 하지 못했습니다.
iptables
$ iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
resolv.conf
$ cat /etc/resolv.conf
nameserver 10.147.234.1
nameserver 8.8.8.8
nameserver 8.8.4.4
인터페이스
$ cat /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# The one directly connected to the web
auto eth0
iface eth0 inet dhcp
# The one connected to the internal network
auto eth1
iface eth1 inet dhcp
핑 요청
$ ping -I eth0 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from (MY_IP) eth0: 56(84) bytes of data.
From (MY_IP) icmp_seq=1 Destination Host Unreachable
From (MY_IP) icmp_seq=2 Destination Host Unreachable
From (MY_IP) icmp_seq=3 Destination Host Unreachable
$ ping -I eth1 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from (INTERNAL_IP) eth0: 56(84) bytes of data.
From (INTERNAL_IP) icmp_seq=1 Destination Host Unreachable
From (INTERNAL_IP) icmp_seq=2 Destination Host Unreachable
From (INTERNAL_IP) icmp_seq=3 Destination Host Unreachable
경로 -n
$ route -n
Destination Gateway Genmask Flags Metric Ref Use Iface
10.147.234.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
(SUBNET_MY_IP (ends 0)) 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.169.254 85.222.226.153 255.255.255.255 UGH 0 0 0 eth0
ip_forward
$ cat /proc/sys/net/ipv4/ip_forward
0
ifconfig -a
$ ifconfig -a
eth0 Link encap:Ethernet HWaddr fa:16:3e:d9:ab:b0
inet addr:(MY_IP) Bcast:(MY_IP_BUT_ENDS_WITH_255) Mask:255.255.255.0
inet6 addr: (MY_v6_IP) Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:75300 errors:0 dropped:0 overruns:0 frame:0
TX packets:689 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9905366 (9.4 MiB) TX bytes:86792 (84.7 KiB)
eth1 Link encap:Ethernet HWaddr fa:16:3e:2c:d7:80
inet addr:10.147.234.6 Bcast:10.147.234.255 Mask:255.255.255.0
inet6 addr: (MY_INTERNAL_6_IP) Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:177 errors:0 dropped:0 overruns:0 frame:0
TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:11626 (11.3 KiB) TX bytes:1346 (1.3 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:135 errors:0 dropped:0 overruns:0 frame:0
TX packets:135 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:22168 (21.6 KiB) TX bytes:22168 (21.6 KiB)
답변1
ICMP 요청 결과에 따르면 라우팅에 문제가 있는 것으로 나타났습니다.
route -n
, cat /proc/sys/net/ipv4/ip_forward
및 ifconfig -a
.
업데이트 후: 경로 테이블에 기본 경로가 없습니다. 다음 방법으로 추가할 수 있습니다.
route add default gw x.x.x.x
결과를 작업 시스템과 비교하고 다음을 포함하는 행을 검색해야 합니다.
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 x.x.x.x 0.0.0.0 UG 1024 0 0 eth0
처럼qasdfdsaq올바르게 지적한 것은 지속적인 해결책이 아닙니다.