날짜#

2026-03-29

문제 상황#

Cilium(eBPF) 전환 후 외부에서 WireGuard VPN 연결 실패

증상#

  • 외부(핫스팟)에서 ping 10.0.0.1 실패 (100% packet loss)
  • ssh grgb-vpn 연결 불가
  • 집 내부 네트워크에서는 정상 작동

원인 분석#

1차 진단: tcpdump#

sudo tcpdump -i enp3s0 udp port 51820 -n
# 결과: 0 packets - 패킷이 서버까지 도달하지 않음

처음에는 공유기/ISP 문제로 의심했으나…

2차 진단: Cilium 설정 확인#

kubectl -n kube-system get cm cilium-config -o yaml | grep cluster-pool
# cluster-pool-ipv4-cidr: 10.0.0.0/8

3차 진단: 라우팅 테이블 확인#

ip route | grep 10.0.0
# 10.0.0.0/24 via 10.0.0.224 dev cilium_host

근본 원인#

  • Cilium이 10.0.0.0/8 전체를 클러스터 네트워크로 사용
  • WireGuard도 10.0.0.0/24 사용
  • IP 대역 충돌으로 Cilium이 WireGuard 트래픽을 cilium_host로 라우팅

해결#

WireGuard 네트워크 대역 변경#

10.0.0.0/24 -> 172.30.0.0/24 (Cilium과 겹치지 않는 사설 IP 대역)

수정한 파일들#

1. 서버 WireGuard 설정#

파일: /etc/wireguard/wg0.conf

[Interface]
PrivateKey = (생략)
Address = 172.30.0.1/24    # 변경
ListenPort = 51820

[Peer]
# 각 피어의 AllowedIPs 변경
AllowedIPs = 172.30.0.X/32
sudo systemctl restart wg-quick@wg0

2. 서버 SSH 접근 허용#

파일: /etc/hosts.allow

sshd: 127.0.0.1 124.49.102.36 39.119.192.15 122.34.166.131 192.168.45. 10.0.0. 172.30.0.
  • 172.30.0. 추가 (TCP Wrappers에서 새 대역 허용)

3. 클라이언트 WireGuard 설정 (맥북)#

WireGuard 앱에서 수정:

[Interface]
PrivateKey = (생략)
Address = 172.30.0.3/24    # 변경
DNS = 1.1.1.1

[Peer]
PublicKey = (생략)
AllowedIPs = 172.30.0.0/24, 192.168.0.0/24    # 변경
Endpoint = 39.119.192.15:51820
PersistentKeepalive = 25

4. SSH config#

파일: ~/.ssh/config

Host grgb-vpn
    HostName 172.30.0.1    # 변경
    User grgb-wonny
    IdentityFile ~/.ssh/keys/personal/mini_rsa

IP 할당표#

피어기존 IP변경 IP
서버 (mini-gmk)10.0.0.1172.30.0.1
맥북 (EbIZ)10.0.0.2172.30.0.2
grgb-wonny10.0.0.3172.30.0.3
grgb-rhuba10.0.0.4172.30.0.4
grgb-chamchi10.0.0.5172.30.0.5
mini-might (worker)10.0.0.11172.30.0.11

팀원 설정 변경 필요#

각 팀원의 WireGuard 설정에서:

  1. Address 변경 (10.0.0.X -> 172.30.0.X)
  2. AllowedIPs 변경 (10.0.0.0/24 -> 172.30.0.0/24)

교훈#

  • Cilium 설치 전 기존 네트워크 대역 확인 필수
  • cluster-pool-ipv4-cidr과 기존 VPN/사설 네트워크 대역 충돌 주의
  • 172.16.0.0/12 대역은 Cilium 기본 설정과 충돌하지 않음

관련 명령어#

# Cilium 클러스터 풀 확인
kubectl -n kube-system get cm cilium-config -o yaml | grep cluster-pool

# 라우팅 테이블 확인
ip route | grep 10.0.0

# WireGuard 상태 확인
sudo wg show

# SSH 접근 거부 로그 확인
sudo journalctl -u ssh -n 20