Skip to content

Instantly share code, notes, and snippets.

@juner417
Created March 11, 2024 14:56
Show Gist options
  • Select an option

  • Save juner417/e6ebe2d27a180aadbc975542c7348eb6 to your computer and use it in GitHub Desktop.

Select an option

Save juner417/e6ebe2d27a180aadbc975542c7348eb6 to your computer and use it in GitHub Desktop.
My colima VM IP is not NATed, and the src IP goes out as is.

Status

  • colima vm(type : vz)에 2개의 컨테이너 런타임의 vm 존재(containerd-default, docker)
  • docker vm을 실행한뒤, 사내 내부 harbor로 로그인할 경우, 둘다 vm의 ip(192.168.64.0/24 col0)가 source ip 패킷이 나감(using tcpdump)
  • 해당 ip는 pc(macos)의 vtep interface ip이므로 dest(사내 내부 harbor)에서 src를 찾지 못해서 정상적인 커넥션 맺지 못함

Solution

  1. Force add translation rules to my local PC
# add below rule in /etc/pf.conf, utun4 is secure vpn interface
nat on utun4 from bridge100:network to any -> utun4

# reload pf.conf
sudo pfctl -f /etc/pf.conf

# docker login
docker login -u ACC https://MY_COMPANY_PRIVATE_REPO
Password:
...
Login Succeeded
  1. After logging into lima vm, netplan apply
# ssh login
colima ssh -p docker

# netplan reload
sudo netplan apply

# docker login
docker login -u ACC https://MY_COMPANY_PRIVATE_REPO
Password:
...
Login Succeeded

2번이 근본 원인일 것으로 판단해서 colima vm(lima vm)의 설정이랑 netplan 파일을 확인해볼 예정

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment