0

I'm still looking for answer on my question. I have a dedicated server with ubuntu server 14.04, and 2 public ip. I want to add 1 public ip per 1 lxc. I think i've tried everything and nothing helped me :(.

After install fresh system i got default:

root@h0st:~# cat /etc/network/interfaces

auto eth0 iface eth0 inet static

    address 94.23.237.216
    netmask 255.255.255.0
    network 94.23.237.0
    broadcast 94.23.237.255
    gateway 94.23.237.254

LXC configuration:

root@h0st:~# cat /var/lib/lxc/Oksymoron/config

lxc.rootfs = /var/lib/lxc/Oksymoron/rootfs

lxc.mount = /var/lib/lxc/Oksymoron/fstab

lxc.utsname = Oksymoron lxc.arch = amd64

lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = eth0
lxc.network.hwaddr = 00:16:3e:e0:1b:5d

cat /var/lib/lxc/Oksymoron/rootfs/etc/network/interfaces

auto lo iface lo inet loopback

auto eth0 iface eth0 inet dhcp

And as i mentioned i got 2 additional ip's: 91.121.239.228/32, 188.165.139.63/32

Someone can help me ?

1

The concept of creating or configuring multiple IP addresses on a single network interface is called IP aliasing. IP aliasing is very useful for setting up multiple virtual sites on Apache using one single network interface with different IP addresses on a single subnet network.

The main advantage of using this IP aliasing is, you don’t need to have a physical adapter attached to each IP, but instead you can create multiple or many virtual interfaces (aliases) to a single physical card.

Here I have an interface called eth0, the default interface for the Ethernet device. If you’ve attached second Ethernet device, then there would be an eth0:1 device and so on for each device you’ve attached.

Example:

root@h0st:~# cat /etc/network/interfaces

auto eth0 iface eth0 inet static

    address 94.23.237.216
    netmask 255.255.255.0
    network 94.23.237.0
    broadcast 94.23.237.255
    gateway 94.23.237.254

auto eth0:1 iface eth0:1 inet static

    address 91.131.239.228
    netmask 255.255.255.0
    network 91.131.239.0
    broadcast 91.131.239.255
    gateway 91.131.239.254

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.