Hi, colleagues. I’d like to connect my Mikrotik RB915Ui-HnD to some VPN provider (haven chosen yet which one, but definitely with OpenVPN protocol) therefore all my traffic passing to internet provider including DNS requests and BitTorrent will be encrypted.
My RB connected to the internet via PPPoE and my problem is I can’t figure out how to start. I need some generalized approach like “Create bridge with that” and “Add route here” (some schemes may be).
I’m not experienced much with OpenWRT OpenVPN configuration, but with Mikrotik you should start from:
Upload OpenWRT image
Create a new metarouter and assign uploaded image
Create a virtual ethernet interface and assign it to your new metarouter instance
Change your default PPPoE route 0.0.0.0/0 with new distance (2 or more)
IMPORTANT Add a static route to your OpenVPN server through the gateway of your ISP PPPoE with distance 1.
Add your new virtual ethernet interface to your LAN bridge
On your OpenWRT set up eth0 to get ip/gw by dhcp. It will take an IP from your Tik LAN dhcp (while it is bridged to LAN)
Set up OpenWRT with OpenVPN, you shall have a tun0 interface.
Add a new route to 0.0.0.0/0 network with a gateway ip address of your OpenWRT’s eth0 interface. Distance set to 1 .
How it works:
Now metarouter will use static route to allow nested metarouter to connect to OpenVPN and start tunnel.
Than Tik will use new route thru virtual eth0 as default.
OpenWRT internally routes traffic from it’s eth0 to tun0 (looping back the traffic inside metarouter’s virtual interface and routing it to meta openvpn, that is really returns back to Tik’s LAN towards your PPPoE GW)
A little bit complicated, but it should work in theory. I’ll try to make it myself within few days to proove the concept!
Thanks for the reply. As far as I understand when tunnel doesn’t exist (connection isn’t established yet or broken already) all my traffic will be sent unencrypted. If so — can I prevent this?
If you don’t want your traffic to be sent unencrypted through you PPPoE interface, you should switch off your 0.0.0.0/0 route to PPPoE interface, but leave one static route to your OpenVPN host. Don’t forget about DNS traffic to resolve OpenVPN’s hostname or just use IP address instead.
Some time ago that topic was really important to me, that’s the reason of my question.
What down/up speed you want to get? From my personal experience: router isn’t allways best place for VPN client.
I hope I’ll manage that and will post a how-to. Now I have 30 Mbps symmetrical channel and I’d like to keep the same speed with VPN if possible. If not — I can sacrifice speed down to maximum possible. The goal is to stay away from new anti-people surveillance law.
I bought Tik because it has enough memory to do the job. I don’t want yet another device. What do you propose?
I’d suggest RB850gx2. It costs ~150$ and is able to encrypt OpenVPN at least at 150Mbit+ due to it’s AES hardware encryption feature. I’g gonna take this device soon and share results.
Will I be able to connect to my Tik? AS far as I understand, incoming packet will go through ISP and outgoing — through VPN, like satellite/GSM scheme?
Got the same question and found solution yesterday:
Add second virtual interface to metarouter → bridge to WAN (in my case **) interface → add eth1 to WAN inside OpenWRT. Don’t forget remove default gateway from eth0, add default gateway to your eth1 and tun0 with different distances.
** PPPoE is bridged with BCP, but i dont exactly know how to do it. If you don’t want to overload your with extreme complicity, you’d better put any cheap and dummy router like dir-100 to perform as PPPoE → Ethernet box.
.. or just add one more meta %)
Do not expect good performance on soho boards using metarouter. I’d better take a separate device for OpenWRT or take something stronger like PowerPC single** core (RB450).
smips devices are weak in encryption, so you shouldn’t expect it better with meta
I’ve just taken RB850gx2 (~150usd with case) for heavy vpn encryption tasks.
This board rocks in encryption:
I got l2tp/ipsec 195mbit/s, but i should perform much better after some tunings.
In OpenVPN you may gain more than 100mbit/s due to current OpenVPN utilizes only one core… Waiting for ROS v7
** Metarouter doesnt work on multi core devices (Waiting for ROS v7, it will be KVM)