I'm trying to configure network of a Centos 6.8 LXC on Ubuntu host and to assign multiple IPs to it.Here is the content of eth filesifcfg-eth0DEVICE=eth0ONBOOT=yesBOOTPROTO=noneIPADDR=185.99.79.221NETMASK=255.255.255.255GATEWAY=139.56.26.254IPV6INIT=yesIPV6_AUTOCONF=noIPV6ADDR=2607:5400:61:bcb:10:10:10:20/64ifcfg-eth0:1DEVICE=eth0:1ONBOOT=yesBOOTPROTO=noneIPADDR=185.99.79.222NETMASK=255.255.255.255GATEWAY=139.56.26.254IPV6INIT=yesIPV6_AUTOCONF=noIPV6ADDR=2607:5400:61:bcb:10:10:10:21/64When i issue the service network restart command, i see the errorSIOCADDRT: Network is unreachableRTNETLINK answers: File existsifconfig give the outputeth0      Link encap:Ethernet  HWaddr 02:00:00:A6:C4:7D          inet addr:185.99.79.221  Bcast:185.99.79.221  Mask:255.255.255.255          inet6 addr: 2607:5400:61:bcb:10:10:10:20/64 Scope:Global          inet6 addr: fe80::ff:fea6:c47d/64 Scope:Link          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1          RX packets:176088 errors:0 dropped:0 overruns:0 frame:0          TX packets:6038 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1000          RX bytes:18075023 (17.2 MiB)  TX bytes:424237 (414.2 KiB)eth0:1    Link encap:Ethernet  HWaddr 02:00:00:A6:C4:7D          inet addr:185.99.79.222  Bcast:185.99.79.222  Mask:255.255.255.255          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1lo        Link encap:Local Loopback          inet addr:127.0.0.1  Mask:255.0.0.0          inet6 addr: ::1/128 Scope:Host          UP LOOPBACK RUNNING  MTU:65536  Metric:1          RX packets:6 errors:0 dropped:0 overruns:0 frame:0          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:0          RX bytes:504 (504.0 b)  TX bytes:504 (504.0 b)So, actually the IPV6 in the eth0:1 interface is not there.When i continue with the following command ifup eth0:1, i got the following messagesRTNETLINK answers: File existsRTNETLINK answers: File existsRTNETLINK answers: File existsRTNETLINK answers: File existsThen, ifconfig gives the following resultseth0      Link encap:Ethernet  HWaddr 02:00:00:A6:C4:7D          inet addr:185.99.79.221  Bcast:185.99.79.221  Mask:255.255.255.255          inet6 addr: 2607:5400:61:bcb:10:10:10:21/64 Scope:Global          inet6 addr: 2607:5400:61:bcb:10:10:10:20/64 Scope:Global          inet6 addr: fe80::ff:fea6:c47d/64 Scope:Link          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1          RX packets:180415 errors:0 dropped:0 overruns:0 frame:0          TX packets:6145 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1000          RX bytes:18330196 (17.4 MiB)  TX bytes:429635 (419.5 KiB)eth0:1    Link encap:Ethernet  HWaddr 02:00:00:A6:C4:7D          inet addr:185.99.79.222  Bcast:185.99.79.222  Mask:255.255.255.255          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1lo        Link encap:Local Loopback          inet addr:127.0.0.1  Mask:255.0.0.0          inet6 addr: ::1/128 Scope:Host          UP LOOPBACK RUNNING  MTU:65536  Metric:1          RX packets:6 errors:0 dropped:0 overruns:0 frame:0          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:0          RX bytes:504 (504.0 b)  TX bytes:504 (504.0 b)So, the second IPv6 has appeared, but in eth0 instead of eth0:1.When i restart network with service network restart, i got the following errorShutting down interface eth0:                              [  OK  ]Shutting down loopback interface:                          [  OK  ]Bringing up loopback interface:                            [  OK  ]Bringing up interface eth0:  Determining if ip address 185.99.79.221 is already in use for device eth0...Determining if ip address 185.99.79.222 is already in use for device eth0...SIOCADDRT: Network is unreachableRTNETLINK answers: File exists                                                           [  OK  ]Checking with ifconfig, i see the second IPv6 disappeared.eth0      Link encap:Ethernet  HWaddr 02:00:00:A6:C4:7D          inet addr:185.99.79.221  Bcast:185.99.79.221  Mask:255.255.255.255          inet6 addr: 2607:5400:61:bcb:10:10:10:20/64 Scope:Global          inet6 addr: fe80::ff:fea6:c47d/64 Scope:Link          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1          RX packets:187329 errors:0 dropped:0 overruns:0 frame:0          TX packets:6321 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1000          RX bytes:18743143 (17.8 MiB)  TX bytes:438745 (428.4 KiB)eth0:1    Link encap:Ethernet  HWaddr 02:00:00:A6:C4:7D          inet addr:185.99.79.222  Bcast:185.99.79.222  Mask:255.255.255.255          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1lo        Link encap:Local Loopback          inet addr:127.0.0.1  Mask:255.0.0.0          inet6 addr: ::1/128 Scope:Host          UP LOOPBACK RUNNING  MTU:65536  Metric:1          RX packets:6 errors:0 dropped:0 overruns:0 frame:0          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:0          RX bytes:504 (504.0 b)  TX bytes:504 (504.0 b)This unstable IP problem has caused me a lot of headache for the whole day. So i'd like to ask how to resolve this problem. It seems conflicting somewhere.
Network configuration in Centos LXC on Ubuntu host
ubuntu;centos;ip;lxc