Re: [lxc-users] Networking in Ubuntu with 2 ip failover in LXC

2014-08-13 Thread bryn1u85 .
Hey,

I made some changes:
root@ns321124:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto br0
iface br0 inet static
bridge_ports eth0
bridge_stp off
bridge_maxwait 0
bridge_fd 0
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

post-up /sbin/ifconfig br0:0 91.121.239.228 netmask 255.255.255.255
broadcast 91.121.239.228
post-down /sbin/ifconfig br0:0 down


root@ns321124:~# cat /var/lib/lxc/Oksymoron/config
# Template used to create this container:
/usr/share/lxc/templates/lxc-ubuntu
# Parameters passed to the template:
# For additional config options, please look at lxc.container.conf(5)

# Common configuration
lxc.include = /usr/share/lxc/config/ubuntu.common.conf

# Container specific configuration
lxc.rootfs = /var/lib/lxc/Oksymoron/rootfs
lxc.mount = /var/lib/lxc/Oksymoron/fstab
lxc.utsname = Oksymoron
lxc.arch = amd64

# Network configuration
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.name = eth0
lxc.network.ipv4 = 91.121.239.228/32
lxc.network.ipv4.gateway = 91.121.239.254
lxc.network.hwaddr = 00:16:3e:3e:35:9e

root@ns321124:~# ifconfig
br0   Link encap:Ethernet  HWaddr 00:30:48:bd:ee:08
  inet addr:94.23.237.216  Bcast:94.23.237.255  Mask:255.255.255.0
  inet6 addr: fe80::230:48ff:febd:ee08/64 Scope:Link
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:1432 errors:0 dropped:4 overruns:0 frame:0
  TX packets:785 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:0
  RX bytes:109849 (109.8 KB)  TX bytes:149687 (149.6 KB)

br0:0 Link encap:Ethernet  HWaddr 00:30:48:bd:ee:08
  inet addr:91.121.239.228  Bcast:91.121.239.228
 Mask:255.255.255.255
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

eth0  Link encap:Ethernet  HWaddr 00:30:48:bd:ee:08
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:1507 errors:0 dropped:0 overruns:0 frame:0
  TX packets:826 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000
  RX bytes:133897 (133.8 KB)  TX bytes:163263 (163.2 KB)
  Interrupt:16 Memory:fbce-fbd0

loLink 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:370 (370.0 B)  TX bytes:370 (370.0 B)

 LXC ###

root@Oksymoron:~# lxc-console -n Oksymoron

root@Oksymoron:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp


root@Oksymoron:~# ifconfig
eth0  Link encap:Ethernet  HWaddr 00:16:3e:3e:35:9e
  inet addr:91.121.239.228  Bcast:255.255.255.255
 Mask:255.255.255.255
  inet6 addr: fe80::216:3eff:fe3e:359e/64 Scope:Link
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:489 errors:0 dropped:0 overruns:0 frame:0
  TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000
  RX bytes:41460 (41.4 KB)  TX bytes:10332 (10.3 KB)

loLink 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:60 errors:0 dropped:0 overruns:0 frame:0
  TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:0
  RX bytes:4966 (4.9 KB)  TX bytes:4966 (4.9 KB)

And failed:


root@Oksymoron:~# apt-get update
0% [Connecting to archive.ubuntu.com] [Connecting to security.ubuntu.com]
0% [Connecting to archive.ubuntu.com] [Connecting to security.ubuntu.com]

I don;t know what can i do more
Please give me some advice





2014-08-13 10:29 GMT+02:00 Tamas Papp tom...@martos.bme.hu:


 On 08/13/2014 10:28 AM, bryn1u85 . wrote:

 Hey,

 what do u mean standard configuration ?


 man interfaces



 t
 ___
 lxc-users mailing list
 lxc-users@lists.linuxcontainers.org
 http://lists.linuxcontainers.org/listinfo/lxc-users

___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] Networking in Ubuntu with 2 ip failover in LXC

2014-08-13 Thread Tamas Papp

Try traceroute, show route command output and things like that.
BTW you setup looks the same as before.

tamas



On 08/13/2014 12:32 PM, bryn1u85 . wrote:

Hey,

I made some changes:
root@ns321124:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto br0
iface br0 inet static
bridge_ports eth0
bridge_stp off
bridge_maxwait 0
bridge_fd 0
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

post-up /sbin/ifconfig br0:0 91.121.239.228 netmask 
255.255.255.255 broadcast 91.121.239.228

post-down /sbin/ifconfig br0:0 down


root@ns321124:~# cat /var/lib/lxc/Oksymoron/config
# Template used to create this container: 
/usr/share/lxc/templates/lxc-ubuntu

# Parameters passed to the template:
# For additional config options, please look at lxc.container.conf(5)

# Common configuration
lxc.include = /usr/share/lxc/config/ubuntu.common.conf

# Container specific configuration
lxc.rootfs = /var/lib/lxc/Oksymoron/rootfs
lxc.mount = /var/lib/lxc/Oksymoron/fstab
lxc.utsname = Oksymoron
lxc.arch = amd64

# Network configuration
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.name http://lxc.network.name = eth0
lxc.network.ipv4 = 91.121.239.228/32 http://91.121.239.228/32
lxc.network.ipv4.gateway = 91.121.239.254
lxc.network.hwaddr = 00:16:3e:3e:35:9e

root@ns321124:~# ifconfig
br0   Link encap:Ethernet  HWaddr 00:30:48:bd:ee:08
  inet addr:94.23.237.216  Bcast:94.23.237.255  Mask:255.255.255.0
  inet6 addr: fe80::230:48ff:febd:ee08/64 Scope:Link
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:1432 errors:0 dropped:4 overruns:0 frame:0
  TX packets:785 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:0
  RX bytes:109849 (109.8 KB)  TX bytes:149687 (149.6 KB)

br0:0 Link encap:Ethernet  HWaddr 00:30:48:bd:ee:08
  inet addr:91.121.239.228  Bcast:91.121.239.228 
 Mask:255.255.255.255

  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

eth0  Link encap:Ethernet  HWaddr 00:30:48:bd:ee:08
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:1507 errors:0 dropped:0 overruns:0 frame:0
  TX packets:826 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000
  RX bytes:133897 (133.8 KB)  TX bytes:163263 (163.2 KB)
  Interrupt:16 Memory:fbce-fbd0

loLink 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:370 (370.0 B)  TX bytes:370 (370.0 B)

 LXC ###

root@Oksymoron:~# lxc-console -n Oksymoron

root@Oksymoron:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp


root@Oksymoron:~# ifconfig
eth0  Link encap:Ethernet  HWaddr 00:16:3e:3e:35:9e
  inet addr:91.121.239.228  Bcast:255.255.255.255 
 Mask:255.255.255.255

  inet6 addr: fe80::216:3eff:fe3e:359e/64 Scope:Link
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:489 errors:0 dropped:0 overruns:0 frame:0
  TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000
  RX bytes:41460 (41.4 KB)  TX bytes:10332 (10.3 KB)

loLink 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:60 errors:0 dropped:0 overruns:0 frame:0
  TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:0
  RX bytes:4966 (4.9 KB)  TX bytes:4966 (4.9 KB)

And failed:


root@Oksymoron:~# apt-get update
0% [Connecting to archive.ubuntu.com http://archive.ubuntu.com] 
[Connecting to security.ubuntu.com http://security.ubuntu.com]
0% [Connecting to archive.ubuntu.com http://archive.ubuntu.com] 
[Connecting to security.ubuntu.com http://security.ubuntu.com]


I don;t know what can i do more
Please give me some advice





2014-08-13 10:29 GMT+02:00 Tamas Papp tom...@martos.bme.hu 
mailto:tom...@martos.bme.hu:



On 08/13/2014 10:28 AM, bryn1u85 . wrote:

Hey,

what do u mean standard configuration ?


man interfaces



t

Re: [lxc-users] Networking in Ubuntu with 2 ip failover in LXC

2014-08-13 Thread bryn1u85 .
From LXC nothing:
root@Oksymoron:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric RefUse
Iface
^C

From Host:
root@ns321124:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric RefUse
Iface
default vss-gw-6k.fr.eu 0.0.0.0 UG0  00 br0
10.0.3.0*   255.255.255.0   U 0  00
lxcbr0
94.23.237.0 *   255.255.255.0   U 0  00 br0



2014-08-13 12:35 GMT+02:00 Tamas Papp tom...@martos.bme.hu:

  Try traceroute, show route command output and things like that.
 BTW you setup looks the same as before.

 tamas




 On 08/13/2014 12:32 PM, bryn1u85 . wrote:

 Hey,

  I made some changes:
  root@ns321124:~# cat /etc/network/interfaces
 # This file describes the network interfaces available on your system
 # and how to activate them. For more information, see interfaces(5).

  # The loopback network interface
 auto lo
 iface lo inet loopback

  auto br0
 iface br0 inet static
 bridge_ports eth0
 bridge_stp off
 bridge_maxwait 0
 bridge_fd 0
 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

  post-up /sbin/ifconfig br0:0 91.121.239.228 netmask
 255.255.255.255 broadcast 91.121.239.228
 post-down /sbin/ifconfig br0:0 down


  root@ns321124:~# cat /var/lib/lxc/Oksymoron/config
 # Template used to create this container:
 /usr/share/lxc/templates/lxc-ubuntu
 # Parameters passed to the template:
 # For additional config options, please look at lxc.container.conf(5)

  # Common configuration
 lxc.include = /usr/share/lxc/config/ubuntu.common.conf

  # Container specific configuration
 lxc.rootfs = /var/lib/lxc/Oksymoron/rootfs
 lxc.mount = /var/lib/lxc/Oksymoron/fstab
 lxc.utsname = Oksymoron
 lxc.arch = amd64

  # Network configuration
 lxc.network.type = veth
 lxc.network.flags = up
 lxc.network.link = br0
 lxc.network.name = eth0
 lxc.network.ipv4 = 91.121.239.228/32
 lxc.network.ipv4.gateway = 91.121.239.254
 lxc.network.hwaddr = 00:16:3e:3e:35:9e

  root@ns321124:~# ifconfig
 br0   Link encap:Ethernet  HWaddr 00:30:48:bd:ee:08
   inet addr:94.23.237.216  Bcast:94.23.237.255  Mask:255.255.255.0
   inet6 addr: fe80::230:48ff:febd:ee08/64 Scope:Link
   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
   RX packets:1432 errors:0 dropped:4 overruns:0 frame:0
   TX packets:785 errors:0 dropped:0 overruns:0 carrier:0
   collisions:0 txqueuelen:0
   RX bytes:109849 (109.8 KB)  TX bytes:149687 (149.6 KB)

  br0:0 Link encap:Ethernet  HWaddr 00:30:48:bd:ee:08
   inet addr:91.121.239.228  Bcast:91.121.239.228
  Mask:255.255.255.255
   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

  eth0  Link encap:Ethernet  HWaddr 00:30:48:bd:ee:08
   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
   RX packets:1507 errors:0 dropped:0 overruns:0 frame:0
   TX packets:826 errors:0 dropped:0 overruns:0 carrier:0
   collisions:0 txqueuelen:1000
   RX bytes:133897 (133.8 KB)  TX bytes:163263 (163.2 KB)
   Interrupt:16 Memory:fbce-fbd0

  loLink 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:370 (370.0 B)  TX bytes:370 (370.0 B)

   LXC ###

  root@Oksymoron:~# lxc-console -n Oksymoron

  root@Oksymoron:~# cat /etc/network/interfaces
 # This file describes the network interfaces available on your system
 # and how to activate them. For more information, see interfaces(5).

  # The loopback network interface
 auto lo
 iface lo inet loopback

  auto eth0
 iface eth0 inet dhcp


  root@Oksymoron:~# ifconfig
 eth0  Link encap:Ethernet  HWaddr 00:16:3e:3e:35:9e
   inet addr:91.121.239.228  Bcast:255.255.255.255
  Mask:255.255.255.255
   inet6 addr: fe80::216:3eff:fe3e:359e/64 Scope:Link
   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
   RX packets:489 errors:0 dropped:0 overruns:0 frame:0
   TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
   collisions:0 txqueuelen:1000
   RX bytes:41460 (41.4 KB)  TX bytes:10332 (10.3 KB)

  loLink 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:60 errors:0 dropped:0 overruns:0 frame:0
   TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
   collisions:0 txqueuelen:0
   RX bytes:4966 

Re: [lxc-users] Networking in Ubuntu with 2 ip failover in LXC

2014-08-13 Thread Tamas Papp

Resending..


On 08/13/2014 02:27 PM, Tamas Papp wrote:

host machine:

auto br0
iface br0 inet static
bridge_ports eth0
bridge_stp off
bridge_maxwait 0
bridge_fd 0
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


Don't setup br0:0


Remove the following entries from CONTAINER/config:

lxc.network.ipv4 = 91.121.239.228/32 http://91.121.239.228/32
lxc.network.ipv4.gateway = 91.121.239.254



guest machine:

auto eth0
iface eth0 inet static
address 91.121.239.228
netmask 255.255.255.0
gateway 94.23.237.254


This should work.


tamas


___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] Networking in Ubuntu with 2 ip failover in LXC

2014-08-13 Thread m.byryn1u


W dniu 2014-08-13 16:57, Fajar A. Nugraha pisze:

On Wed, Aug 13, 2014 at 7:34 PM, Tamas Papp tom...@martos.bme.hu wrote:

Resending..


On 08/13/2014 02:27 PM, Tamas Papp wrote:

host machine:

auto br0
iface br0 inet static
 bridge_ports eth0
 bridge_stp off
 bridge_maxwait 0
 bridge_fd 0
 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


Don't setup br0:0


Remove the following entries from CONTAINER/config:

lxc.network.ipv4 = 91.121.239.228/32
lxc.network.ipv4.gateway = 91.121.239.254



guest machine:

auto eth0
iface eth0 inet static
 address 91.121.239.228
 netmask 255.255.255.0
 gateway 94.23.237.254


This should work.

No, that won't work.

94.23.237.254 is not part of 91.121.239.0/24.

@Bryn, how is the ROUTER (i.e. 94.23.237.254) setup? Is it configured
to route the additional IP (91.121.239.228) thru host's IP
(94.23.237.216), the way some dedicated server provider does (e.g.
serverloft)?

If yes, then the EASY way would be to put 91.121.239.228 as an alias
in host's interface (I'd just use eth0, no need to use a bridge there)
and setup a static NAT to whatever IP the container has (e.g.
10.0.3.251, connected to host's lxcbr0 bridge)


Hey,

It's server dedicated in OVH.
I have one ip like  94.23.237.216 and i bought one more called ip 
failover like 91.121.239.228. You say as an alias and setup static NAT. 
But what about 2 ip failover ?


___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] Networking in Ubuntu with 2 ip failover in LXC

2014-08-13 Thread Fajar A. Nugraha
On Wed, Aug 13, 2014 at 10:08 PM, m.byryn1u m.bry...@gmail.com wrote:

 W dniu 2014-08-13 16:57, Fajar A. Nugraha pisze:

 On Wed, Aug 13, 2014 at 7:34 PM, Tamas Papp tom...@martos.bme.hu wrote:

 Resending..


 On 08/13/2014 02:27 PM, Tamas Papp wrote:

 host machine:

 auto br0
 iface br0 inet static
  bridge_ports eth0
  bridge_stp off
  bridge_maxwait 0
  bridge_fd 0
  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


 Don't setup br0:0


 Remove the following entries from CONTAINER/config:

 lxc.network.ipv4 = 91.121.239.228/32
 lxc.network.ipv4.gateway = 91.121.239.254



 guest machine:

 auto eth0
 iface eth0 inet static
  address 91.121.239.228
  netmask 255.255.255.0
  gateway 94.23.237.254


 This should work.

 No, that won't work.

 94.23.237.254 is not part of 91.121.239.0/24.

 @Bryn, how is the ROUTER (i.e. 94.23.237.254) setup? Is it configured
 to route the additional IP (91.121.239.228) thru host's IP
 (94.23.237.216), the way some dedicated server provider does (e.g.
 serverloft)?

 If yes, then the EASY way would be to put 91.121.239.228 as an alias
 in host's interface (I'd just use eth0, no need to use a bridge there)
 and setup a static NAT to whatever IP the container has (e.g.
 10.0.3.251, connected to host's lxcbr0 bridge)

 Hey,

 It's server dedicated in OVH.

Then ask OVH how to use that IP.

 I have one ip like  94.23.237.216 and i bought one more called ip failover
 like 91.121.239.228. You say as an alias and setup static NAT. But what
 about 2 ip failover ?


If my guess is right, it's similar to serverloft. They will say
simply put it as an IP alias/additional IP on your server.

As in, the additional IP is routed to ONE of your server's IP.
Permanently. Can't be used on other server. Thus, there can be NO
failover.

It's not a standard failover setup where two or more physical servers
each have an IP in the same network segment, and you can have one or
more virtual IP for your services that can fail over to any of the
servers.

-- 
Fajar
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] Networking in Ubuntu with 2 ip failover in LXC

2014-08-13 Thread m.byryn1u


W dniu 2014-08-13 17:24, Fajar A. Nugraha pisze:

On Wed, Aug 13, 2014 at 10:08 PM, m.byryn1u m.bry...@gmail.com wrote:

W dniu 2014-08-13 16:57, Fajar A. Nugraha pisze:


On Wed, Aug 13, 2014 at 7:34 PM, Tamas Papp tom...@martos.bme.hu wrote:

Resending..


On 08/13/2014 02:27 PM, Tamas Papp wrote:

host machine:

auto br0
iface br0 inet static
  bridge_ports eth0
  bridge_stp off
  bridge_maxwait 0
  bridge_fd 0
  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


Don't setup br0:0


Remove the following entries from CONTAINER/config:

lxc.network.ipv4 = 91.121.239.228/32
lxc.network.ipv4.gateway = 91.121.239.254



guest machine:

auto eth0
iface eth0 inet static
  address 91.121.239.228
  netmask 255.255.255.0
  gateway 94.23.237.254


This should work.

No, that won't work.

94.23.237.254 is not part of 91.121.239.0/24.

@Bryn, how is the ROUTER (i.e. 94.23.237.254) setup? Is it configured
to route the additional IP (91.121.239.228) thru host's IP
(94.23.237.216), the way some dedicated server provider does (e.g.
serverloft)?

If yes, then the EASY way would be to put 91.121.239.228 as an alias
in host's interface (I'd just use eth0, no need to use a bridge there)
and setup a static NAT to whatever IP the container has (e.g.
10.0.3.251, connected to host's lxcbr0 bridge)


Hey,

It's server dedicated in OVH.

Then ask OVH how to use that IP.


I have one ip like  94.23.237.216 and i bought one more called ip failover
like 91.121.239.228. You say as an alias and setup static NAT. But what
about 2 ip failover ?


If my guess is right, it's similar to serverloft. They will say
simply put it as an IP alias/additional IP on your server.

As in, the additional IP is routed to ONE of your server's IP.
Permanently. Can't be used on other server. Thus, there can be NO
failover.

It's not a standard failover setup where two or more physical servers
each have an IP in the same network segment, and you can have one or
more virtual IP for your services that can fail over to any of the
servers.

I had a server on FreeBSD-10 before and i had 2 jails with 1 failover ip 
per jail, work well.

OVH says :

post-up /sbin/ifconfig eth0:X IP.FAIL.OVER netmask 255.255.255.255 
broadcast IP.FAIL.OVER

post-down /sbin/ifconfig eth0:X down

Or as bridge:


/etc/network/interfaces
auto lo eth0
iface lo inet loopback
iface eth0 inet static
addressIP.FAIL.OVER
netmask 255.255.255.255
broadcastIP.FAIL.OVER
post-up route addIP..SERWERA.254dev eth0
post-up route add default gwIP.SERWERA.254
post-down route delIP..SERWERA.254dev eth0
post-down route del default gwIP.SERWERA.254

That's why i think that method 2 post befor should works.
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] Networking in Ubuntu with 2 ip failover in LXC

2014-08-13 Thread m.byryn1u


W dniu 2014-08-13 18:43, Fajar A. Nugraha pisze:

On Wed, Aug 13, 2014 at 10:55 PM, m.byryn1u m.bry...@gmail.com wrote:

94.23.237.254 is not part of 91.121.239.0/24.

@Bryn, how is the ROUTER (i.e. 94.23.237.254) setup? Is it configured
to route the additional IP (91.121.239.228) thru host's IP
(94.23.237.216), the way some dedicated server provider does (e.g.
serverloft)?

If yes, then the EASY way would be to put 91.121.239.228 as an alias
in host's interface (I'd just use eth0, no need to use a bridge there)
and setup a static NAT to whatever IP the container has (e.g.
10.0.3.251, connected to host's lxcbr0 bridge)

Hey,

It's server dedicated in OVH.

Then ask OVH how to use that IP.

I have one ip like  94.23.237.216 and i bought one more called ip failover
like 91.121.239.228. You say as an alias and setup static NAT. But what
about 2 ip failover ?

If my guess is right, it's similar to serverloft. They will say
simply put it as an IP alias/additional IP on your server.

As in, the additional IP is routed to ONE of your server's IP.
Permanently. Can't be used on other server. Thus, there can be NO
failover.

It's not a standard failover setup where two or more physical servers
each have an IP in the same network segment, and you can have one or
more virtual IP for your services that can fail over to any of the
servers.

I had a server on FreeBSD-10 before and i had 2 jails with 1 failover ip per
jail, work well.

To prevent confusion and wasting everyone's time, what do you mean by
failover IP?

That simply looks like addtional IP (i.e. you only have one server),
not an IP that can be failed over between two physical servers.



OVH says :

post-up /sbin/ifconfig eth0:X IP.FAIL.OVER netmask 255.255.255.255 broadcast
IP.FAIL.OVER
post-down /sbin/ifconfig eth0:X down

Or as bridge:


/etc/network/interfaces
auto lo eth0
iface lo inet loopback
iface eth0 inet static
address IP.FAIL.OVER
netmask 255.255.255.255
broadcast IP.FAIL.OVER
post-up route add IP..SERWERA.254 dev eth0
post-up route add default gw IP.SERWERA.254
post-down route del IP..SERWERA.254 dev eth0
post-down route del default gw IP.SERWERA.254

If that snippet work, you can use it as the container's
/etc/network/interfaces. ONLY put the additional IP there. Do NOT put
the ip address in the host's bridge.
E This LXC doesn't work.  I don't know what to do. Don't know how to 
add secondary ip to lxc.

There are settings by default after install dedicated server (ubuntu 14.04):

root@Host:~# ifconfig
eth0  Link encap:Ethernet  HWaddr 00:30:48:bd:ee:08
  inet addr:94.23.237.216  Bcast:94.23.237.255 Mask:255.255.255.0
  inet6 addr: 2001:41d0:2:70d8::/64 Scope:Global
  inet6 addr: fe80::230:48ff:febd:ee08/64 Scope:Link
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:10138 errors:0 dropped:11 overruns:0 frame:0
  TX packets:4474 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000
  RX bytes:8616516 (8.6 MB)  TX bytes:1121846 (1.1 MB)
  Interrupt:16 Memory:fbce-fbd0

loLink 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:238 errors:0 dropped:0 overruns:0 frame:0
  TX packets:238 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:0
  RX bytes:29523 (29.5 KB)  TX bytes:29523 (29.5 KB)

lxcbr0Link encap:Ethernet  HWaddr fe:a1:3c:60:a1:a7
  inet addr:10.0.3.1  Bcast:10.0.3.255  Mask:255.255.255.0
  inet6 addr: fe80::f025:12ff:fe20:a50d/64 Scope:Link
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:193 errors:0 dropped:0 overruns:0 frame:0
  TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:0
  RX bytes:13928 (13.9 KB)  TX bytes:8339 (8.3 KB)

vethNW6I9M Link encap:Ethernet  HWaddr fe:a1:3c:60:a1:a7
  inet6 addr: fe80::fca1:3cff:fe60:a1a7/64 Scope:Link
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:62 errors:0 dropped:0 overruns:0 frame:0
  TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000
  RX bytes:5656 (5.6 KB)  TX bytes:2422 (2.4 KB)

I created first lxc by lxc-create -t ubuntu -n Oksymoron and works fine.
And now i want to add additional ip which i bought - 91.121.239.228

I tried fast add alias /sbin/ifconfig eth0:X IP.FAIL.OVER netmask 
255.255.255.255 broadcast IP.FAIL.OVER

In my case:
sbin/ifconfig eth0:0 91.121.239.228 netmask 255.255.255.255 broadcast 
91.121.239.228


I tried ping and connet by ssh and works perfect.

eth0:0Link encap:Ethernet  HWaddr 00:30:48:bd:ee:08
  inet addr:91.121.239.228  Bcast:91.121.239.228 
Mask:255.255.255.255

  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  Interrupt:16