Setting OpenVPN for OpenWrt v=19.07.4 via console
Setting OpenVPN for OpenWrt via console was made on OpenWrt 19.07.4
Connect via ssh
For Linux use console command ssh [email protected]
For Windows download Putty
and connect to 192.168.1.1
root@OpenWrt:~# cat /etc/banner
----------------------------------------------------- OpenWrt 19.07.4 -----------------------------------------------------
check internet connectionwget -qO- http://openwrt.su/ip
Install packages
In paragraph nano 1vpns.ovpn you need to copy and paste the vpn configuration for Windows taken from 1vpns.com
(CTRL+V not working in the Putty, you should use SHIFT+INSERT , then press CTRL+X, press Y and press ENTER)
Let`s go!
opkg update
opkg install openvpn-openssl luci-app-openvpn nano
cd /etc/openvpnnano 1vpns.ovpn
uci set openvpn.1vpns=openvpnuci set openvpn.1vpns.enabled='1'uci set openvpn.1vpns.config='/etc/openvpn/1vpns.ovpn'uci commit openvpn
uci set network.1vpnstun=interfaceuci set network.1vpnstun.proto='none'uci set network.1vpnstun.ifname='tun0'uci commit network
uci -q delete firewall.vpnuci set firewall.vpn="zone"uci set firewall.vpn.name="vpn"uci set firewall.vpn.input="REJECT"uci set firewall.vpn.output="ACCEPT"uci set firewall.vpn.forward="REJECT"uci set firewall.vpn.masq="1"uci set firewall.vpn.mtu_fix="1"uci -q delete firewall.lan_vpnuci set firewall.lan_vpn="forwarding"uci set firewall.lan_vpn.src="lan"uci set firewall.lan_vpn.dest="vpn"uci del_list firewall.wan.device="tun0"uci add_list firewall.vpn.device="tun0"uci set firewall.lan_wan.enabled="0"uci commit firewall/etc/init.d/firewall restart
cat << "EOF" > /etc/openvpn/dnsviavpn.sh#!/bin/shenv | sed -n -e "/^foreign_option_.*=dhcp-option.*DNS/s//nameserver/p/^foreign_option_.*=dhcp-option.*DOMAIN/s//search/p" | sort -u > /tmp/resolv.conf.vpncase ${script_type} in(up) uci set dhcp.@dnsmasq[0].resolvfile="/tmp/resolv.conf.vpn" ;;(down) uci revert dhcp ;;esac/etc/init.d/dnsmasq restart &EOFchmod +x /etc/openvpn/dnsviavpn.sh sed -i -e "/^script-security/s/^/#/\$a script-security 2/^up/s/^/#/\$a up /etc/openvpn/dnsviavpn.sh/^down/s/^/#/\$a down /etc/openvpn/dnsviavpn.sh" /etc/openvpn/1vpns.ovpn/etc/init.d/openvpn restart
Done, now you can use vpn connection on your clients via 1vpns.com
For switch kill use next commands:
#switch kill enable
uci set firewall.@zone[1].masq=0 uci commit firewall /etc/init.d/firewall restart /etc/init.d/openvpn restart reboot
disable switch kill:
#switch kill disable
uci -q delete firewall.vpnuci set firewall.vpn="zone"uci set firewall.vpn.name="vpn"uci set firewall.vpn.input="REJECT"uci set firewall.vpn.output="ACCEPT"uci set firewall.vpn.forward="REJECT"uci set firewall.vpn.masq="1"uci set firewall.vpn.mtu_fix="1"uci -q delete firewall.lan_vpnuci set firewall.lan_vpn="forwarding"uci set firewall.lan_vpn.src="lan"uci set firewall.lan_vpn.dest="vpn"uci del_list firewall.wan.device="tun0"uci add_list firewall.vpn.device="tun0"uci set firewall.lan_wan.enabled="0"uci commit firewall/etc/init.d/firewall restart
uci set firewall.@zone[1].masq=1 uci commit firewall /etc/init.d/firewall restart /etc/init.d/openvpn restart
The setup is complete.
Enjoy!

Tor v3
@FVPNS

82822222
EN
RU





