I would like to configure the network for the container (guest) system.
My host system uses a public IPv4 IP address 77.14.7.42/26 , subnet 255.255.255.192.
I would like to assign a new public IPv4 address to container (guest), which is 77.14.7.22/26, subnet 255.255.255.192.
If I type it in, inside the container, then I am unable to ping from the container or to the container IP.
If I assign it on the host, the IP becomes pingable (but I want this IP to be in container).
The configuration files for the container are such (on host):
—> # cat /etc/lxc/default.conf
lxc.net.0.type = veth
lxc.net.0.link = lxcbr0
lxc.net.0.flags = up
lxc.net.0.hwaddr = 00:16:3e:c8:e5:e3
lxc.apparmor.profile = generated
lxc.apparmor.allow_nesting = 1
—> # cat /etc/lxc/lxc-usernet
lxcuser veth lxcbr0 10
—> # cat /var/lib/lxc/vps1/config
- Template used to create this container: /usr/share/lxc/templates/lxc-download
- Parameters passed to the template:
- For additional config options, please look at lxc.container.conf(5)
- Uncomment the following line to support nesting containers:
- (Be aware this has security implications)
- LXC.include = /usr/share/lxc/config/nesting.conf
Distribution configuration
lxc.include = /usr/share/lxc/config/common.conf
lxc.arch = linux64
Container specific configuration
lxc.apparmor.profile = generated
lxc.apparmor.allow_nesting = 1
lxc.rootfs.path = dir:/var/lib/lxc/vps1/rootfs
lxc.uts.name = vps1
Network configuration
lxc.net.0.type = veth
lxc.net.0.link = lxcbr0
lxc.net.0.flags = up
lxc.net.0.hwaddr = 00:16:3e:c8:e5:e3
—> # ifconfig (host)
lxcbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.3.1 netmask 255.255.255.0 broadcast 10.0.3.255
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
vethv6SL9o: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500