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

add ffuplink-package to use the routers-wan connection #125

Merged
merged 13 commits into from
Jan 30, 2018

Conversation

SvenRoederer
Copy link
Contributor

add a package to use the wan-connection directly (w/o VPN)

@bobster-galore
Copy link
Contributor

It would be nice to have an underhood construction which can be used by any wizard or sthg. to configure the system. Much more which kind of connection could be used.

@SvenRoederer
Copy link
Contributor Author

at the moment branch "packages/notunnel" of the firmware gets build an can then be tested.

@SvenRoederer
Copy link
Contributor Author

one issue with this code is, that the veth-link to the ffuplink interface is setup via a hotplugscript. this should be converted to a uci-setting, as we have patched the lede-17.01 netifd to support this.

@SvenRoederer
Copy link
Contributor Author

This code has been tested and verified to work with

Probably it's morre elegant to put the uci-setting ffberlin-uplink.uplink.auth directly into network.ffuplink.authtype.

@SvenRoederer
Copy link
Contributor Author

merged into Hedy-1.0.0-rc1

this is some uplink-type to directly route the freifunk-
traffic via the uplink on the wan-interface. So there
will be no tunnel at all.

include both setup-stages inside the hotplug-script
stage 1: WAN
* setup up veth-pair
* add one end of veth-pair to br-wan
* enable interface "ffuplink"

stage 2: ffuplink
* set default-route for ff-clients via gateway over
  "ffuplink"-device
* via policy-routing in table "olsr-tunnel"
add uci "ffberlin-uplink.uplink.auth"to give each uplink-provider
a way to have the assistent asking for different kinds of
authentication. Following types are supported:
- none: the uplink-type don't need additional parameters
- x509: the uplink-type requires a set of X.509 certificate
        (stored in /etc/openvpn/, as for VPN03 and tunnel-berlin)
- pass: todo - just ask for a simple password / psk
- userpass: todo - ask for username and password
to ensure current settings and do not interfer with any previous setup
or tunnel-type of ffuplink
- this requires a recent enough netifd (was implemented in 2017-02-11)
- also take care of reconfiguring alternative uplink-types and
  don't have them relying on any assumption of "ffuplink"
implement dedicated ip-rule to manage traffic for ffuplink-interface
this hotplug-script probibits all traffic to nodes on the
upstream-network of ffuplink-interface. Only traffic to not
directly attached networks is accepted.
This script also sets up the default route for all traffic
reaching the "ffuplink" routing-table.

this all honors the settings of
* ffwizard.sharenet
* freifunk-policyrouting.enable
On every setup of ffuplink add some ip-rules to route
all traffic received on interfaces of zone freifunk
out via ffuplink.
When shutting down the interface we remove the manually
created rules, to not create the same rules over and
over again.
as this is done by the tunnel-provider scripts
to keep it in sync with a "no-tunnel" uplink.
As we had no separate ip-rules for ffuplink before, it was
put into "olsr-tunnel", which did not made sense at all.
As OpenVPN networkparameters are not configured via UCI,
"network_get_subnet" returns noting. In this case we query
the IP-config directly.
If this also returns nothing valid, we will not setup a
policy to protect the uplink-lan and give an error-log.
@SvenRoederer SvenRoederer merged commit 8664d2c into master Jan 30, 2018
@SvenRoederer SvenRoederer deleted the feature/notunnel branch March 12, 2018 17:45
@SvenRoederer
Copy link
Contributor Author

btw: a similar feature seems to be on the way for gluon (freifunk-gluon/gluon#1094)

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

Successfully merging this pull request may close these issues.

2 participants