Michał
Bryniarski
Akademia Górniczo
Hutniczka Kraków
Temat: Konfiguracja Ubuntu z LXC i 1 IP failover z OVH .
Witam serdecznie,Mecze sie od paru dni z konfiguracja LXC pod ubuntu a dokladnie z siecia. Chce dodac jedno IP failover (server w ovh) do LXC. Niestety po konfiguracji nie dziala internet z poziomu LXC. Korzystalem z tego poradnika, zrobilem dokladnie to samo z tym, ze zastapilem swoim ip:
# The loopback network interface
auto lo
iface lo inet loopback
auto br0
iface br0 inet static
address 91.123.123.123
netmask 255.255.255.0
gateway 91.123.123.254
network 91.123.123.0
broadcast 91.123.123.255
bridge_ports eth0
bridge_stp off
bridge_maxwait 5
bridge_fd 0
Don't forget to restart your network (/etc/init.d/networking restart).
3) Guest configuration file
Once your host network new configuration is up, edit the network part of
your guest's configuration file (/var/lib/lxc/GUEST/config) with the IP
failover and Mac adresses :
lxc.utsname = GUEST1
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.name = eth0
lxc.network.veth.pair = vethGUEST1
lxc.network.ipv4 = 91.2.2.2
lxc.network.hwaddr = 00:50:56:0a:2a:aa
4) Guest network configuration
Then, add eth0 interface to your guest's /etc/network/interfaces file. The
default gateway IP address should be the same as your host's one (for OVH
servers, just replace the last byte of your host IP address by 254
(91.123.123.254 in my example) :
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 91.2.2.2
netmask 255.255.255.255
broadcast 91.2.2.2
post-up route add 91.123.123.254 dev eth0
post-up route add default gw 91.123.123.254
post-down route del 91.123.123.254 dev eth0
post-down route del default gw 91.123.123.254
That's it :-)
Z poziomu LXC probuje apt-get update i:
root@Oksymoron:~# apt-get update
0% [Connecting to cdn.debian.net]
0% [Connecting to cdn.debian.net]
0% [Connecting to cdn.debian.net]
root@Oksymoron:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:3e:36:fe:87
inet addr:91.121.239.228 Bcast:255.255.255.255 Mask:0.0.0.0
inet6 addr: fe80::216:3eff:fe36:fe87/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:420 errors:0 dropped:2 overruns:0 frame:0
TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:36144 (35.2 KiB) TX bytes:2160 (2.1 KiB)
lo 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:28 errors:0 dropped:0 overruns:0 frame:0
TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2408 (2.3 KiB) TX bytes:2408 (2.3 KiB)
Route:
root@Oksymoron:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
Nie ma nic, ale dlaczego :( Pomoze ktos, bede wdzieczny
Z gory dziekuje,
Pozdrawiam,