D
D
DimentR2016-05-05 12:17:19
Computer networks
DimentR, 2016-05-05 12:17:19

How to properly configure network in ubuntu with bridge and multiple ip?

Hello!
Let's say there are three white sp 115.162.91.174; 115.162.91.165; 115.162.91.167
One eth0 network card on the server
Raised LXC, manually created bridge, virtual network 10.0.2.x, nat registered, everything works.
When the server starts, the standard appears:


waiting for network configuration
waiting an additional 60 seconds for network configuration

and the system takes a long time to load. This worries me (although everything works), because there was no such delay before!
Attention, question: Tell me, did I set up the network correctly?
Here is the network config:
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet manual

auto br0
iface br0 inet static
        address 115.162.91.174
        netmask 255.255.255.240
        gateway 115.162.91.161
        network 115.162.91.160
        broadcast 115.162.91.175
        dns-nameservers 8.8.8.8 8.8.4.4
        bridge_ports eth0
        bridge_stp off
        bridge_fd 0

auto br0:1
iface br0:1 inet static
        address 115.162.91.165
        netmask 255.255.255.240

auto br0:2
iface br0:2 inet static
        address 115.162.91.167
        netmask 255.255.255.240

auto lxc-br-nat
iface lxc-br-nat inet static
    address 10.0.2.1
    netmask 255.255.255.0
    gateway 10.0.2.1
    network 10.0.2.0
    broadcast 10.0.2.255
    dns-nameservers 8.8.8.8 8.8.4.4
    bridge_ports eth0
    bridge_stp off
    bridge_fd 0

ps, I noticed that the wait appears when specifying several IP addresses on the same network interface. does everyone have it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DimentR, 2016-05-20
@DimentR

Correct configuration:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 115.162.91.174
        netmask 255.255.255.240
        gateway 115.162.91.161
        network 115.162.91.160
        broadcast 115.162.91.175
        dns-nameservers 8.8.8.8 8.8.4.4

auto eth0:1
iface eth0:1 inet static
        address 115.162.91.165
        netmask 255.255.255.240

auto eth0:2
iface eth0:2 inet static
        address 115.162.91.167
        netmask 255.255.255.240

auto lxc-br-nat
iface lxc-br-nat inet static
    address 10.0.2.1
    netmask 255.255.255.0
    network 10.0.2.0
    broadcast 10.0.2.255
    dns-nameservers 8.8.8.8 8.8.4.4
    pre-up brctl addbr lxc-br-nat
    post-down brctl delbr lxc-br-nat
    bridge_stp off
    bridge_fd 0

Accordingly, the bridge-utils package must be installed and packet forwarding is allowed in the kernel net.ipv4.ip_forward = 1.

A
Alexander Karabanov, 2016-05-05
@karabanov

And so:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet manual

auto lxc-br-nat
iface lxc-br-nat inet static
    address 10.0.2.1
    netmask 255.255.255.0

auto br0
iface br0 inet static
        address 115.162.91.174
        netmask 255.255.255.240
        gateway 115.162.91.161
        dns-nameservers 8.8.8.8 8.8.4.4
        bridge_ports eth0 lxc-br-nat
        bridge_stp off
        bridge_fd 0

auto br0:1
iface br0:1 inet static
        address 115.162.91.165
        netmask 255.255.255.240

auto br0:2
iface br0:2 inet static
        address 115.162.91.167
        netmask 255.255.255.240

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question