
포트 20514에서 수신 대기하는 애플리케이션이 있습니다.
$ sudo netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
udp 0 0 192.168.100.213:20514 0.0.0.0:* 3629/python3
tcpdump를 사용하여 내 컴퓨터에 들어오는 패킷을 볼 수 있습니다.
$ sudo tcpdump -i enp0s25 -n -N udp port 20514
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp0s25, link-type EN10MB (Ethernet), capture size 262144 bytes
15:54:56.832307 IP 172.18.248.3.514 > 192.168.100.213.20514: SYSLOG user.critical, length: 111
iptables는 (이 시점에서) 모든 것을 허용합니다. 위에서 본 내용에도 불구하고 172.18.248.0/28의 규칙과 일치하는 패킷은 보고하지 않습니다. 모든 캐스트에서 -P INPUT은 ACCEPT입니다.
$ sudo iptables -L -v
Chain INPUT (policy ACCEPT 134 packets, 79373 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT tcp -- any any 192.168.100.0/24 anywhere tcp dpt:ssh
4745 282K ACCEPT tcp -- any any 10.8.0.0/24 anywhere tcp dpt:ssh
0 0 ACCEPT all -- any any 172.18.248.0/28 anywhere
Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 533 packets, 89933 bytes)
pkts bytes target prot opt in out source destination
Chain DOCKER (0 references)
pkts bytes target prot opt in out source destination
Chain DOCKER-ISOLATION-STAGE-1 (0 references)
pkts bytes target prot opt in out source destination
Chain DOCKER-ISOLATION-STAGE-2 (0 references)
pkts bytes target prot opt in out source destination
Chain DOCKER-USER (0 references)
pkts bytes target prot opt in out source destination
Chain LOGACCEPT (0 references)
pkts bytes target prot opt in out source destination
0 0 LOG all -- any any anywhere anywhere LOG level info prefix "INPUT:ACCEPT:"
0 0 ACCEPT all -- any any anywhere anywhere
따라서 패킷이 인터페이스에 들어간 후 방화벽에 도달하기 전에 중지되는 것 같습니다.
내 컴퓨터에 들어오는 패킷이 애플리케이션에 도달하지 못하는 이유를 어디에서 확인할 수 있나요?
답변1
문제는 Docker가 패킷의 소스 주소와 겹치는 네트워크와 인터페이스를 만들고 있다는 것이 밝혀졌습니다.
IPtables에서 docker가 만든 규칙을 모두 지웠음에도 불구하고 결국 다른 IP 범위에서 네트워크를 시작하려면 /etc/docker/daemon.json을 변경해야 했습니다. 그런 다음 모든 컨테이너를 제거하고 Docker가 생성한 모든 네트워크를 삭제했습니다. Docker 네트워크 인터페이스를 삭제하는 덜 파괴적인 방법이 있을 수 있지만 저는 아무 것도 연결되지 않았습니다.
그 후 패킷이 통과했습니다. 그래서 간섭하는 것은 네트워크 인터페이스 자체인 것 같았습니다.