uxc: veth setup issues

Abierto
#38 4 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 4 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
linux
Área
networking

Línea de trabajo

Rastrea el ciclo de vida de uxc create y autostart junto con las instancias de netifd del host y del contenedor, comenzando por la configuración de veth y la llamada ubus network.interface.virt0 up descritas aquí. Reproduce la secuencia de arranque y verifica que el par veth se cree sin intervención manual, mientras que netifd del host y del contenedor ya no compitan por la interfaz.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

If I create a simple veth pair with the uxc jail settings...

config device
    option type 'veth'
    option name 'vhost0'
    option peer_name 'virt0'
    option ipv6 '0'

config interface 'virt0'
    option device 'vhost0'
    option proto 'dhcp'
    option jail 'alpine'
    option jail_device 'vhost'

..add virt0 to br-lan:

config device
    option name 'br-lan'
    option type 'bridge'
    list ports 'eth0'
    list ports 'virt0'

...and then create the container:

$ /etc/init.d/network restart
$ uxc create alpine

...then there's no set up veth pair on the host (while netifd is spawned in the container)

The only way I could find to get it working is call the ubus "up" function before create, using ip isn't sufficient:

$ uxc kill alpine
$ /etc/init.d/network restart
$ ubus call network.interface.virt0 up

Now I get:

netifd: Network device 'virt0' link is up
netifd: veth 'vhost0' link is up
netifd: Interface 'virt0' has link connectivity
netifd: Interface 'virt0' is setting up now

The veth pair exists, and the host netifd already set it up via dhcp.

Upon uxc create alpine the container netifd fights the host one:

netifd: virt0 (20): udhcpc: started, v1.37.0
netifd: virt0 (23837): udhcpc: SIOCGIFINDEX: No such device
netifd: virt0 (23837): udhcpc: received SIGTERM
netifd: virt0 (23837): udhcpc: unicasting a release of 192.168.0.183 to 192.168.0.1
netifd: virt0 (23837): udhcpc: sending release
netifd: virt0 (23837): udhcpc: can't bind to interface vhost0: No such device
netifd: virt0 (23837): udhcpc: bindtodevice: No such device
netifd: virt0 (23837): udhcpc: entering released state
netifd: virt0 (23837): Command failed: ubus call network.interface notify_proto { "action": 0, "link-up": false, "keep": false, "interface": "virt0" } (Permission denied)

While that doesn't seems to be a problem, now I have connectivity in both directions.

But obviously something is off. As netifd is spawned per container, I assume the intention is that's the instance supposed to set up veth. My ubus call makes it work for me, but that makes the host netifd setup the veth pair. And the fact that it doesn't come up without intervention breaks autostart upon host boot. What am I missing?

Lenguaje dominante
C
Estrellas
13
Forks
49
Merge medio
11 d 12 h
PR fusionados (30 d)
3

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de openwrt/procd

Todos los issues de openwrt/procd

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.