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

El nombre de la tarjeta de red "bridged" está fijado en el Vagrantfile #1

Open
onthedock opened this issue Aug 20, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@onthedock
Copy link
Owner

onthedock commented Aug 20, 2021

Ver

node.vm.network "public_network", ip: "192.168.1.10#{i}", bridge: 'wlp5s0'

@onthedock onthedock self-assigned this Aug 20, 2021
@onthedock onthedock added the bug Something isn't working label Aug 20, 2021
@onthedock
Copy link
Owner Author

ip link show | grep -i 'state UP' | awk '{gsub(/:/,"") ; print $2}'

Funciona si sólo una tarjeta de red está UP.

$  ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
    link/ether XX:YY:ZZ:2c:de:58 brd ff:ff:ff:ff:ff:ff
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000
    link/ether XX:YY:ZZc6:ec:6f brd ff:ff:ff:ff:ff:ff
4: br-ad180e80edaa: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default 
    link/ether 02:42:50:bd:70:39 brd ff:ff:ff:ff:ff:ff
5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default 
    link/ether 02:42:d1:e7:c5:d8 brd ff:ff:ff:ff:ff:ff

$ ip link show | grep -i 'state UP' | awk '{gsub(/:/,"") ; print $2}'
wlp3s0

Requiere hacer alguna prueba adicional para validar que funciona en general.

@onthedock
Copy link
Owner Author

Una opción más sencilla, aunque menos general es usar el hecho de que los dispositivos wireless se identifican como wl: Predictable network interface device names on the x86_64 platform explained

Los equipos suelen tener únicamente una tarjeta de red wifi, aunque no tiene porqué ser la que esté activa; al final modifica el proceso para identificar la tarjeta del comando, en vez de usar 'state UP' se usaría wl.

@onthedock
Copy link
Owner Author

No he encontrado cómo ejecutar el resultado de un comando en la máquina host (no en la guest, creada por Vagrant).

Lo único que se me ocurre que podría funcionar es usar un script que genere una variable de entorno, y usar la variable en el Vagrantfile. Ver https://stackoverflow.com/questions/42249989/how-to-pass-windows-host-env-into-vagrantfile/42250314#42250314

@onthedock
Copy link
Owner Author

Otra opción sería cambiar el nombre de la tarjeta de red "previsible" (enp2s0, wlp3s0) por un valor conocido, como eth0 o similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant