Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Dynamic interface changes #5

Open
computergeek125 opened this issue Jun 9, 2018 · 0 comments
Open

Dynamic interface changes #5

computergeek125 opened this issue Jun 9, 2018 · 0 comments

Comments

@computergeek125
Copy link

computergeek125 commented Jun 9, 2018

First of all, great work! I was able to use two of these to get Steam in-home streaming working across a VPN (one server listens on the local subnets and a TAP site-to-site and the other server listens on the TAP site-to-site and a OpenVPN remote access TAP). I'm using Redux instead of the upstream since I am working on adding other protocols that Redux supports

Would it be possible add functionality to specify a wildcard interface (ex: vpns* which would accept vpns0, vpns1, ... vpnsN), and then an option to turn on a "dynamic interface" feature that automatically added new interfaces matching the pattern? Alternatively, rather than monitor when interfaces change, I could send udp-broadcast-relay a SIGHUP or SIGUSR1 from OpenConnect since I can set scripts for client connect and disconnect events. Right now I use the scripts to add and remove the client interfaces in firewalld.

The program could then be called as udp-broadcast-relay-redux --id 1 --port 27036 --dev tap0 --dev vpns* --dyn-int. It would then start work on the tap0 interface, and add or remove any interface matching the pattern vpns* as the were created or destroyed.

I work in IT with computer networking and know a bit of network programming, so I know that this is not a simple ask for these two problems. As an interim solution, I am working on a wrapper program/script that can kill and restart udp-broadcast-relay when the interface config changes, but this means that there is a chance of missing a packet on an already active interface in the narrow window that it goes down.


Background:

Recently, I was experimenting with the OpenConnect VPN server, which is an open-source implementation of Cisco's AnyConnect software. Internal to the VPN server, OpenConnect appears to dynamically create point-to-point links with each device. Even though they are point-to-point links, I found out via packet capture that they still support broadcast traffic. So, before any clients connect, the server looks like this (I don't actually have 80 interfaces, the server just has a really high uptime and weathered a lot of OpenConnect and OpenVPN restarts):

61: tap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
    link/ether 4e:4d:6c:bc:14:3d brd ff:ff:ff:ff:ff:ff
    inet 10.77.0.254/27 brd 10.77.0.255 scope global tap0
       valid_lft forever preferred_lft forever
    inet6 fe80::4c4d:6cff:febc:143d/64 scope link
       valid_lft forever preferred_lft forever
67: tap1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
    link/ether 0e:03:8d:b4:01:da brd ff:ff:ff:ff:ff:ff
    inet 10.77.4.126/26 brd 10.77.4.127 scope global tap1
       valid_lft forever preferred_lft forever
    inet6 fe80::c03:8dff:feb4:1da/64 scope link
       valid_lft forever preferred_lft forever
70: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
    link/none
    inet 10.77.4.190/26 brd 10.77.4.191 scope global tun0
       valid_lft forever preferred_lft forever

Then, after the first OpenConnect client connects, this interface is added to the list:

81: vpns0: <POINTOPOINT,UP,LOWER_UP> mtu 1353 qdisc pfifo_fast state UNKNOWN group default qlen 500
    link/none
    inet 10.77.4.193 peer 10.77.4.233/32 scope global vpns0
       valid_lft forever preferred_lft forever

Second client added:

82: vpns1: <POINTOPOINT,UP,LOWER_UP> mtu 1341 qdisc pfifo_fast state UNKNOWN group default qlen 500
    link/none
    inet 10.77.4.193 peer 10.77.4.231/32 scope global vpns1
       valid_lft forever preferred_lft forever

First client disconnected and reconnected, noting that the interface index changed:

83: vpns0: <POINTOPOINT,UP,LOWER_UP> mtu 1353 qdisc pfifo_fast state UNKNOWN group default qlen 500
    link/none
    inet 10.77.4.193 peer 10.77.4.233/32 scope global vpns0
       valid_lft forever preferred_lft forever
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant