[lxc-users] multiple veths cannot configure for each default gateway

Nakayama Kenjiro nakayamakenjiro at gmail.com
Sat Apr 12 13:01:48 UTC 2014


Ahh... Sorry, I really mistook.

I re-read [1] and noticed that I took wrong "1" and "2".

[1] http://multipath-tcp.org/pmwiki.php/Users/ConfigureRouting

Thanks a lot.

Please close. I could solve another way.

Kenjiro




On Sat, Apr 12, 2014 at 5:57 PM, Nakayama Kenjiro <nakayamakenjiro at gmail.com
> wrote:

> Thank you for you advice.
>
> 1. Background
>
> Now I am testing MPTCP[1], and need to use multiple eths and each
> gateways. Since this may be special usecases, I might have to use virtual
> machines. (Actually, now I am using virtual machines.)
>
> [1] http://multipath-tcp.org/pmwiki.php/Users/ConfigureRouting
>
>
> 2. Same namespaces problem
>
>
> > Because the fist answer would be that you of course can't have more than
> one default route per stack and the advanced answer would be, that you may
> set up routing namespaces to archive
>
> Yes, right. Alotough I don't know yet about LXC, I thought I can solve
> this problem by routing configuration like[1].
>
>
> 3.
>
> > i politely, but strongly suggest you to first read some basics about the
> TCP/IP  stack like networks, packet routing etc. to learn about the meaning
> of the term "gateway", especial the "default gateway".
>
> Yes...that's right...
>
>
> Thanks,
>
> Kenjiro
>
>
>
> On Sat, Apr 12, 2014 at 5:02 PM, Guido Jäkel <G.Jaekel at dnb.de> wrote:
>
>> Dear Kenjiro,
>>
>> i politely, but strongly suggest you to first read some basics about the
>> TCP/IP  stack like networks, packet routing etc. to learn about the meaning
>> of the term "gateway", especial the "default gateway".
>>
>> Because the fist answer would be that you of course can't have more than
>> one default route per stack and the advanced answer would be, that you may
>> set up routing namespaces to archive it nevertheless to realize some very
>> special usecases. But for this, in the first you have to understand the
>> common cases in deep.
>>
>> greetings
>>
>> Guido
>>
>>
>> On 2014-04-12 05:38, Nakayama Kenjiro wrote:
>> > Hi,
>> >
>> > I tried to set up multiple veth and default GW for each veth in one
>> > container[1] by using docker with following command [2].
>> > But I got an error[3]. (When I setup with only one Default GW, it works
>> > well. So I think I can not default GW for each veth (eth0, eth1).)
>> >
>> > Is this my mis-configuration or impossible configuration or lxc's bug?
>> > Please tell me if anybody can figure out the cause of this problem.
>> >
>> > Thank you in advance.
>> >
>> > Kenjiro
>> >
>> > [1]
>> >      +-----------------+ Default GW
>> >      | +-------------+ | +-------+
>> >      | |    eth0     | | |  br1  |
>> >      | |172.16.42.20 |-|-|docker1|--
>> >      | +-------------+ | +-------+
>> >      |                 |
>> >      |                 | Default GW
>> >      | +-------------+ | +-------+
>> >      | |    eth1     | | |  br2  |
>> >      | |172.16.42.20 |-|-|docker2|--
>> >      | +-------------+ | +-------+
>> >      +-----------------+
>> >
>> > [2] docker execute command.
>> > docker run \
>> > -n=false \
>> > -lxc-conf="lxc.network.type = veth" \
>> > -lxc-conf="lxc.network.name = eth0" \
>> > -lxc-conf="lxc.network.ipv4 = 172.16.42.20/24" \
>> > -lxc-conf="lxc.network.ipv4.gateway = 172.16.42.1" \
>> > -lxc-conf="lxc.network.hwaddr = 00:FF:80:FF:FF:02" \
>> > -lxc-conf="lxc.network.link = docker1" \
>> > -lxc-conf="lxc.network.flags = up" \
>> > -lxc-conf="lxc.network.type = veth" \
>> > -lxc-conf="lxc.network.name = eth1" \
>> > -lxc-conf="lxc.network.ipv4 = 172.16.42.21/24" \
>> > -lxc-conf="lxc.network.hwaddr = 00:FF:80:FF:FF:01" \
>> > -lxc-conf="lxc.network.ipv4.gateway = 172.16.42.2" \
>> > -lxc-conf="lxc.network.link = docker2" \
>> > -lxc-conf="lxc.network.flags = up" \
>> > -i -t --name tmp1 mptcp-test /bin/bash
>> >
>> > [3] Error when executed docer run.
>> > ~~~
>> > Warning: '-lxc-conf' is deprecated, it will be removed soon. See usage.
>> > Warning: '-lxc-conf' is deprecated, it will be removed soon. See usage.
>> > Warning: '-lxc-conf' is deprecated, it will be removed soon. See usage.
>> > Warning: '-lxc-conf' is deprecated, it will be removed soon. See usage.
>> > Warning: '-lxc-conf' is deprecated, it will be removed soon. See usage.
>> > Warning: '-lxc-conf' is deprecated, it will be removed soon. See usage.
>> > Warning: '-lxc-conf' is deprecated, it will be removed soon. See usage.
>> > Warning: '-lxc-conf' is deprecated, it will be removed soon. See usage.
>> > Warning: '-lxc-conf' is deprecated, it will be removed soon. See usage.
>> > Warning: '-lxc-conf' is deprecated, it will be removed soon. See usage.
>> > Warning: '-lxc-conf' is deprecated, it will be removed soon. See usage.
>> > Warning: '-lxc-conf' is deprecated, it will be removed soon. See usage.
>> > Warning: '-lxc-conf' is deprecated, it will be removed soon. See usage.
>> > Warning: '-lxc-conf' is deprecated, it will be removed soon. See usage.
>> > lxc-start: failed to setup ipv4 gateway for 'eth1': File exists
>> > lxc-start: failed to setup netdev
>> > lxc-start: failed to setup the network for
>> > '41794d153bafe7dc14dcc28520ff9f82b432ffcaed91572b6414d785d60db0dc'
>> > lxc-start: failed to setup the container
>> > lxc-start: invalid sequence number 1. expected 2
>> > lxc-start: failed to spawn
>> > '41794d153bafe7dc14dcc28520ff9f82b432ffcaed91572b6414d785d60db0dc'
>> > lxc-start: Device or resource busy - failed to remove cgroup
>> >
>> '/sys/fs/cgroup/cpuset/lxc/41794d153bafe7dc14dcc28520ff9f82b432ffcaed91572b6414d785d60db0dc'
>> > lxc-start: Device or resource busy - failed to remove cgroup
>> >
>> '/sys/fs/cgroup/cpu,cpuacct/lxc/41794d153bafe7dc14dcc28520ff9f82b432ffcaed91572b6414d785d60db0dc'
>> > lxc-start: Device or resource busy - failed to remove cgroup
>> >
>> '/sys/fs/cgroup/memory/lxc/41794d153bafe7dc14dcc28520ff9f82b432ffcaed91572b6414d785d60db0dc'
>> > lxc-start: Device or resource busy - failed to remove cgroup
>> >
>> '/sys/fs/cgroup/devices/lxc/41794d153bafe7dc14dcc28520ff9f82b432ffcaed91572b6414d785d60db0dc'
>> > lxc-start: Device or resource busy - failed to remove cgroup
>> >
>> '/sys/fs/cgroup/freezer/lxc/41794d153bafe7dc14dcc28520ff9f82b432ffcaed91572b6414d785d60db0dc'
>> > lxc-start: Device or resource busy - failed to remove cgroup
>> >
>> '/sys/fs/cgroup/net_cls/lxc/41794d153bafe7dc14dcc28520ff9f82b432ffcaed91572b6414d785d60db0dc'
>> > lxc-start: Device or resource busy - failed to remove cgroup
>> >
>> '/sys/fs/cgroup/blkio/lxc/41794d153bafe7dc14dcc28520ff9f82b432ffcaed91572b6414d785d60db0dc'
>> > lxc-start: Device or resource busy - failed to remove cgroup
>> >
>> '/sys/fs/cgroup/perf_event/lxc/41794d153bafe7dc14dcc28520ff9f82b432ffcaed91572b6414d785d60db0dc'
>> > lxc-start: Device or resource busy - failed to remove cgroup
>> >
>> '/sys/fs/cgroup/hugetlb/lxc/41794d153bafe7dc14dcc28520ff9f82b432ffcaed91572b6414d785d60db0dc'
>> > [error] client.go:2298 Error getting size: bad file descriptor
>> > ~~~
>> >
>> > [4] Bridge setting
>> > ~~~
>> > #!/bin/sh
>> >
>> > # Name of the bridge
>> > FIRST_BRIDGE_NAME=docker1
>> >
>> > # Bridge address
>> > FIRST_BRIDGE_ADDRESS=172.16.42.1/24
>> >
>> > # Add the docker1 bridge
>> > brctl addbr $FIRST_BRIDGE_NAME
>> >
>> > # Set up the IP for the docker1 bridge
>> > ip a add $FIRST_BRIDGE_ADDRESS dev $FIRST_BRIDGE_NAME
>> >
>> > # Activate the bridge
>> > ip link set $FIRST_BRIDGE_NAME up
>> >
>> > ### ----------------------- ###
>> >
>> > # Name of the bridge
>> > SECOND_BRIDGE_NAME=docker2
>> >
>> > # Bridge address
>> > SECOND_BRIDGE_ADDRESS=172.16.42.2/24
>> >
>> > # Add the docker1 bridge
>> > brctl addbr $SECOND_BRIDGE_NAME
>> >
>> > # Set up the IP for the docker2 bridge
>> > ip a add $SECOND_BRIDGE_ADDRESS dev $SECOND_BRIDGE_NAME
>> >
>> > # Activate the bridge
>> > ip link set $SECOND_BRIDGE_NAME up
>> > ~~~
>> >
>> >
>> >
>> >
>> > _______________________________________________
>> > lxc-users mailing list
>> > lxc-users at lists.linuxcontainers.org
>> > http://lists.linuxcontainers.org/listinfo/lxc-users
>> >
>>
>>
>
>
> --
> Kenjiro NAKAYAMA <nakayamakenjiro at gmail.com>
> GPG Key fingerprint = ED8F 049D E67A 727D 9A44  8E25 F44B E208 C946 5EB9
>



-- 
Kenjiro NAKAYAMA <nakayamakenjiro at gmail.com>
GPG Key fingerprint = ED8F 049D E67A 727D 9A44  8E25 F44B E208 C946 5EB9
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20140412/0dd469d7/attachment.html>


More information about the lxc-users mailing list