[lxc-users] Networking in Ubuntu with 2 ip failover in LXC
Fajar A. Nugraha
list at fajar.net
Wed Aug 13 16:43:42 UTC 2014
On Wed, Aug 13, 2014 at 10:55 PM, m.byryn1u <m.bryn1u at 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.
--
Fajar
More information about the lxc-users
mailing list