Joachim M. Giæver 65689dbe4c Added nat-start script to re-establish routing when some changes to the NAT routing, e.g WAN port forwarding | 7 роки тому | |
---|---|---|
aiop | 7 роки тому | |
client1 | 7 роки тому | |
screenshots | 7 роки тому | |
.gitignore | 7 роки тому | |
LICENSE | 7 роки тому | |
README.md | 7 роки тому | |
dnsmasq.postconf | 7 роки тому | |
nat-start | 7 роки тому | |
openvpn-event | 7 роки тому |
(Private Internett Access - https://privateinternettaccess.com)
This code is used to assign a new DHCP range to an interface and route the traffic over an OpenVPN for PIA (may work with others).
Code is based on
The main reason for doing this was that I wanted several Wi-Fi networks with traffic routed over different kind of VPN-connections. See screenshots below.
assign_ip "<interface>" "<dhcp>" "<range from>" "<range to>"
e.g assign_ip "wl0.1" "192.168.2.1" "2" "254"
will start a DHCP server on IP 192.168.2.1 with a range from 192.168.2.2 - 192.168.2.254.route_vpn "<interface g.network>" "<interface vpn>"
, e.g route_vpn "wl0.1" "tun11"
to route wl0.1 over tun11./jffs/scripts
.scp /path/to/aiop/* <username>@ip-address:/jffs/scripts/aiop
scp dnsmasq.postconf <username>@ip-address:/jffs/scripts/
scp openvpn-event <username>@ip-address:/jffs/scripts/
You will find an example on how I've done it, with 6 guest networks and 5 VPN-clients, in the files "dnsmasq.postconf" and "openvpn-event". Note that wl0.1 and wl0.3 shares VPN-client. This way you can create several VPN-clients, i.e with different locations, and connect to the respective Wi-Fi when you want to change VPN-connetion.
You will also find an configuration file in the "client" directory, that I have exported from my setup, that you can import in the WebUI. I have included the two certificates you need to copy/paste into the WebUI certificate-forms in the directory as well.