meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:openwrt [2019/06/21 07:43] – niziak | linux:openwrt [2021/03/05 14:09] (current) – niziak | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== OpenWRT ====== | ||
| + | |||
| ====== First steps ====== | ====== First steps ====== | ||
| To use SSH, first telnet to router and set root password. | To use SSH, first telnet to router and set root password. | ||
| Line 48: | Line 50: | ||
| </ | </ | ||
| - | ====== OpenVPN ====== | ||
| - | <code bash> | ||
| - | |||
| - | Enable incoming OpenVPN connections: | ||
| - | |||
| - | <code bash> | ||
| - | uci add firewall rule | ||
| - | uci set firewall.@rule[-1]._name=openvpn | ||
| - | uci set firewall.@rule[-1].src=wan | ||
| - | uci set firewall.@rule[-1].target=ACCEPT | ||
| - | uci set firewall.@rule[-1].proto=udp | ||
| - | uci set firewall.@rule[-1].dest_port=1194 | ||
| - | uci commit firewall | ||
| - | |||
| - | echo " | ||
| - | echo " | ||
| - | echo " | ||
| - | echo " | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | mkdir -o / | ||
| - | uci set openvpn.uservpn=openvpn | ||
| - | uci set openvpn.uservpn.config=/ | ||
| - | uci set openvpn.uservpn.enable=1 | ||
| - | uci commit openvpn | ||
| - | </ | ||
| - | |||
| - | cat > / | ||
| - | |||
| - | port 1194 | ||
| - | proto udp | ||
| - | dev tap0 | ||
| - | | ||
| - | | ||
| - | verb 3 | ||
| - | | ||
| - | |||
| - | Add VPN to local LAN bridge: | ||
| - | |||
| - | <code bash> | ||
| - | cat > / | ||
| - | #!/bin/sh / | ||
| - | | ||
| - | START=94 | ||
| - | | ||
| - | start() { | ||
| - | openvpn --mktun --dev tap0 | ||
| - | brctl addif br-lan tap0 | ||
| - | ifconfig tap0 0.0.0.0 promisc up | ||
| - | } | ||
| - | | ||
| - | stop() { | ||
| - | ifconfig tap0 0.0.0.0 down | ||
| - | brctl delif br-lan tap0 | ||
| - | openvpn --rmtun --dev tap0 | ||
| - | } | ||
| - | |||
| - | |||
| - | chmod 755 / | ||
| - | / | ||
| - | / | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | openvpn --genkey --secret / | ||
| - | </ | ||
| - | |||
| - | Start VPN: | ||
| - | <code bash> | ||
| - | / | ||
| - | / | ||
| - | </ | ||