I have a Debian 10 server which gets its IPv4-v6 via DHCP which can be configured as static also:
root@host:~# ifconfig
ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 45.76.XX.XX netmask 255.255.254.0 broadcast 45.76.XX.255
inet6 2001:19f0:XXXX:XXX:XXXX:XXX:XXXX:XXXX prefixlen 64 scopeid 0x0<global>
inet6 fe80::5400:2ff:fecf:999b prefixlen 64 scopeid 0x20<link>
ether 56:00:XX:XX:XX:XX txqueuelen 1000 (Ethernet)
RX packets 113 bytes 14499 (14.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 114 bytes 12413 (12.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 24 bytes 1896 (1.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 24 bytes 1896 (1.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
I know how to configure nat-ed LXC instances with private IPv4 address. But in this fresh system I wish to create a LXC instance assigning it the main public IPv4 address of the host. Is it even possible? I can SSH into host using its IPv6 when its IPv4 is taken away from it and assigned to the container.
Thanks in advance for all your help.
ip addr
for managing network interfaces on Linux... it's not because 'ifconfig' and 'route' are merely old, it's because they can outright lie to you -- e.g. 'ifconfig' doesn't know that an interface can have more than one IPv4 address, and 'route' doesn't know that a route can have more than one gateway. (In your case, a very useful feature would be having an IPv4 default route with an IPv6 nexthop, which is also not understood by those tools.)