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

Translation of wireless interface name to physical interface fails #22

Closed
sumpfralle opened this issue Apr 25, 2019 · 1 comment
Closed

Comments

@sumpfralle
Copy link
Contributor

sumpfralle commented Apr 25, 2019

I am using olsr2 v0.15.1 on OpenWrt.

Given the following olsrd configuration:

root@AP-1-211:~# uci show olsrd2
olsrd2.@global[0]=global
olsrd2.@global[0].failfast='no'
olsrd2.@global[0].pidfile='/var/run/olsrd2.pid'
olsrd2.@global[0].lockfile='/var/lock/olsrd2'
olsrd2.@log[0]=log
olsrd2.@log[0].syslog='true'
olsrd2.@log[0].stderr='true'
olsrd2.@telnet[0]=telnet
olsrd2.@olsrv2[0]=olsrv2
olsrd2.@olsrv2[0].originator='-0.0.0.0/0' '-::1/128' 'default_accept'
olsrd2.@interface[0]=interface
olsrd2.@interface[0].bindto='-0.0.0.0/0' '-::1/128' 'default_accept'
olsrd2.@interface[0].name='on_eth_0' 'on_eth_1' 'on_wifi_0' 'on_loopback'
olsrd2.@domain[0]=domain
olsrd2.@domain[0].name='0'
olsrd2.@domain[0].table='14'

The olsrd2 init script outputs the following:

root@AP-1-211:~# /etc/init.d/olsrd2 restart
section: global
section: log
section: telnet
section: olsrv2
section: interface
section: domain
olsrd2: wrote '/var/run/olsrd2_dev'
02:54:02.123 WARN(os_interface) u 797: Error, cannot open proc entry /proc/sys/net/ipv4/conf/on_wifi_0/send_redirects: No such file or directory (2)
02:54:02.126 WARN(os_interface) u 665: WARNING! Could not disable ICMP redirects! You should manually ensure that ICMP redirects are disabled!
02:54:02.129 WARN(os_interface) u 797: Error, cannot open proc entry /proc/sys/net/ipv4/conf/on_wifi_0/rp_filter: No such file or directory (2)
02:54:02.132 WARN(os_interface) u 673: WARNING! Could not disable the IP spoof filter! You should mannually ensure that IP spoof filtering is disabled!

The above already indicates that on_wifi_0 is not translated to the physical interface name wlan0.

This is confirmed by the status details:

root@AP-1-211:~# echo /layer2info interface | nc localhost 2009
eth0.1  4       44:d9:e7:55:ee:a3       wireless        false                           0Hz     0Hz     0Hz     0Hz     0mdBm   0ns     0ns     0ns     0ns   0byte    false   false   false
eth0.2  5       44:d9:e7:55:ee:a3       wireless        false                           0Hz     0Hz     0Hz     0Hz     0mdBm   0ns     0ns     0ns     0ns   0byte    false   false   false
lo      1       00:00:00:00:00:00       wireless        false                           0Hz     0Hz     0Hz     0Hz     0mdBm   0ns     0ns     0ns     0ns   0byte    false   false   false
on_wifi_0       0       -       wireless        false                           0Hz     0Hz     0Hz     0Hz     0mdBm   0ns     0ns     0ns     0ns     0byte false    false   false

In fact no connections at all are established:

root@AP-1-211:~# echo /nhdpinfo link | nc localhost 2009
root@AP-1-211:~#

Falling back to ifname (instead of name) when referencing interfaces works:

root@AP-1-211:~# /etc/init.d/olsrd2 restart
section: global
section: log
section: telnet
section: olsrv2
section: interface
Interface: on_eth_0 = eth0.1
Interface: on_eth_1 = eth0.2
Interface: on_wifi_0 = wlan0
Interface: on_loopback = lo
section: domain
olsrd2: wrote '/var/run/olsrd2_dev'
root@AP-1-211:~# echo /layer2info interface | nc localhost 2009
eth0.1  4       44:d9:e7:55:ee:a3       wireless        false                           0Hz     0Hz     0Hz     0Hz     0mdBm   0ns     0ns     0ns     0ns   0byte    false   false   false
eth0.2  5       44:d9:e7:55:ee:a3       wireless        false                           0Hz     0Hz     0Hz     0Hz     0mdBm   0ns     0ns     0ns     0ns   0byte    false   false   false
lo      1       00:00:00:00:00:00       wireless        false                           0Hz     0Hz     0Hz     0Hz     0mdBm   0ns     0ns     0ns     0ns   0byte    false   false   false
wlan0   7       44:d9:e7:54:ee:a3       wireless        false   Philo-Kroepitor.on-i.de                 5.2GHz  0Hz     20MHz   0Hz     -95dBm  82.39ks 5.696ks5.588ks 14.563s 0byte   true    false   false   nl80211 nl80211 nl80211 nl80211 nl80211 nl80211 nl80211 nl80211 nl80211         nl80211
root@AP-1-211:~# echo /nhdpinfo link | nc localhost 2009
wlan0   fe80::46d9:e7ff:fe42:7f76       20      2       19.898  19.998  39.998  symmetric       -       44:d9:e7:42:7f:76       true    true    7       fd32:d8d3:87da:0:44d9:e7ff:fe42:7f76   -       0       ff_dat_metric   79.536Mbit/s    27      38.347Mbit/s    56      p_recv=49,p_total=75,speed=151414784,success=4137,missed_hello=0,lastseq=8568,lneigh=1

The documentation recommends to use name instead of ifname since olsrd2 v0.12.

@HRogge
Copy link
Contributor

HRogge commented Jul 1, 2019

"ifname" is handled by some ugly shell script... Olsrd2 handles "name" internally by using libuci... it seems something changed, either the position or the structure of the OpenWRT configuration file to set these special interface names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants