내가 가진 것:
LXC 호스트
# ifconfig
wg1: flags=209<UP,POINTOPOINT,RUNNING,NOARP> mtu 1420
inet 192.168.7.2 netmask 255.255.255.0 destination 192.168.7.2
...
enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.110 netmask 255.255.255.0 broadcast 192.168.1.255
...
lxdbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.7.56.1 netmask 255.255.255.0 broadcast 0.0.0.0
...
/etc/wireguard/wg1.conf
[Interface]
PrivateKey = my_private_key
Address = 192.168.7.2/24
[Peer]
PublicKey = my_public_key
AllowedIPs = 0.0.0.0/0
Endpoint = my_remote_server_ipv4:51194
PersistentKeepalive = 15
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 100 0 0 enp2s0
10.7.56.0 0.0.0.0 255.255.255.0 U 0 0 0 lxdbr0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 enp2s0
192.168.1.1 0.0.0.0 255.255.255.255 UH 100 0 0 enp2s0
192.168.7.0 0.0.0.0 255.255.255.0 U 0 0 0 wg1
LXC 컨테이너
# curl ifconfig.me
my_remote_server_ipv4
모든 것이 괜찮습니다. 하지만:
# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.7.56.100 netmask 255.255.255.0 broadcast 10.7.56.255
...
내가 원하는 것은:
# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet my_remote_server_ipv4 netmask 255.255.255.0 broadcast ...
...
컨테이너에서 아무것도 변경하지 않고 이 작업을 수행하고 싶습니다.
고쳐 쓰다.내 홈 lxc 컨테이너에 공용 IP(내 원격 서버 소유)를 할당하고 싶습니다. 불가능할 것 같은데...