Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

veth interface disappears when veth interface name conflicts in host. #1600

Closed
ssup2 opened this issue May 30, 2017 · 4 comments
Closed

veth interface disappears when veth interface name conflicts in host. #1600

ssup2 opened this issue May 30, 2017 · 4 comments
Assignees
Labels
Bug Confirmed to be a bug

Comments

@ssup2
Copy link
Contributor

ssup2 commented May 30, 2017

Required information

  • Distribution: Ubuntu 16.04
  • Distribution version: Ubuntu 16.04.2 LTS
  • The output of

Issue description

veth interface disappears when veth interface name conflicts in host.

Steps to reproduce

  1. Make 2 containers with below configs.
  • veth_test_01 config
# Common configuration
lxc.include = /usr/share/lxc/config/ubuntu.common.conf

# Container specific configuration
lxc.rootfs = /var/lib/lxc/veth_test_01/rootfs
lxc.rootfs.backend = dir
lxc.utsname = veth_test_01
lxc.arch = amd64

# Network configuration
lxc.network.type = veth
lxc.network.link = lxcbr0
lxc.network.name = eth0
lxc.network.veth.pair = v-eth0
lxc.network.flags = up
lxc.network.hwaddr = 00:16:3e:2e:a5:f4
  • veth_test_02 config
# Common configuration
lxc.include = /usr/share/lxc/config/ubuntu.common.conf

# Container specific configuration
lxc.rootfs = /var/lib/lxc/veth_test_02/rootfs
lxc.rootfs.backend = dir
lxc.utsname = veth_test_02
lxc.arch = amd64

# Network configuration
lxc.network.type = veth
lxc.network.link = lxcbr0
lxc.network.name = eth0
lxc.network.veth.pair = v-eth0
lxc.network.flags = up
lxc.network.hwaddr = 00:16:3e:25:fa:7b
  1. Start veth_test_01 and check interface in veth_test_01
# lxc-start --name veth_test_01
root@veth_test_01:/# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:16:3e:2e:a5:f4  
          inet addr:10.0.3.2  Bcast:10.0.3.255  Mask:255.255.255.0
          inet6 addr: fe80::216:3eff:fe2e:a5f4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:26 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3442 (3.4 KB)  TX bytes:1374 (1.3 KB)

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:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
  1. Start veth_test_02 and check again interface in veth_test_01
  • Run veth_test_02 must fail to start. Because veth_test_01 and veth_test_02's lxc.network.veth.pair is the same. Failure of veth_test_02's is ok. But Problem is that v-eth0, eth0 veth interface that connects veth_test_01 container and host disappears.
root@veth_test_01:/# ifconfig
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:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Thanks.

@brauner
Copy link
Member

brauner commented May 30, 2017

Can you reproduce this and append the logs for both containers, please?

@brauner
Copy link
Member

brauner commented May 30, 2017

Nevermind, I've reproduced here locally. :)

@ssup2
Copy link
Contributor Author

ssup2 commented May 30, 2017

If you want to reproduce this bug and logs, Tell me thanks.

brauner pushed a commit to brauner/lxc that referenced this issue May 30, 2017
When we didn't delete a net dev we should make sure that we don't delete it.  We
can simply check whether we have index for it. If not, we didn't create it.

Closes lxc#1600.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
brauner pushed a commit to brauner/lxc that referenced this issue May 30, 2017
When we didn't create a net dev we should make sure that we don't delete it.  We
can simply check whether we have index for it. If not, we didn't create it.

Closes lxc#1600.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
@brauner
Copy link
Member

brauner commented May 30, 2017

I sent a branch that should fix this issue.

@brauner brauner self-assigned this May 30, 2017
@brauner brauner added the Bug Confirmed to be a bug label May 30, 2017
stgraber pushed a commit that referenced this issue Jul 1, 2017
When we didn't create a net dev we should make sure that we don't delete it.  We
can simply check whether we have index for it. If not, we didn't create it.

Closes #1600.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Confirmed to be a bug
Development

No branches or pull requests

2 participants