OpenVPN Site-to-Site VPN between Asus Merlin And Ubnt EdgeRouter

前言

Network Topology
Network Topology

RT-AC68U 使用PPPoE拨号上网,但是分配的IP是100.64.204.111, 看着像公网IP实际却是Carrier-grade NAT.

现在需要将RT-AC68U与一台在公网的EdgeRouter使用OpenVPN Site-to-Site连接起来,并在RT-AC68U端实现policy-based routing。
需要让RT-AC68U下的所有设备能访问EdgeRouter LAN的网络,并根据需求透过VPS访问指定互联网。

本实验参考下列文章:
Set up OpenVPN Site-to-Site on UBNT EdgeRouter Lite
EdgeRouter OpenVPN Connectivity Monitor
EdgeRouter 策略路由实现分析
EdgeRouter Policy Based Routing Using DNSMASQ IPSET

Continue reading “OpenVPN Site-to-Site VPN between Asus Merlin And Ubnt EdgeRouter” »

OpenVPN Site-to-Site VPN between Asus Merlin And Ubnt EdgeRouter by @sskaje: https://sskaje.me/2017/10/openvpn-site-to-site-vpn-asus-merlin-ubnt-edgerouter/

EdgeRouter 部署 WireGuard

安装

从 https://github.com/Lochnair/vyatta-wireguard/releases 下载对应的包
ERL, ER等 mips架构的,下载 octeon 版本
ERX 下载 ralink版本。

可以选择上传到路由上,或者ssh登录路由,sudo suroot,执行类似如下的命令

下载完成后

配置

执行下列命令生成私钥、共享密钥,公钥

将最后一个命令的输出复制下来,配置到服务器端

获取服务器端的公钥,替换下文的“公钥”并执行命令

配置好设备后,配置nat服务

剩下就是配置路由规则了,可以参考我的其他blog.

EdgeRouter 部署 WireGuard by @sskaje: https://sskaje.me/2017/06/deploy-wireguard-on-edgerouter/

Incoming search terms:

WireGuard wg-quick PostUp的高级玩法

真的很高级。

wg-quick是WireGuard用来启动网络设备的**脚本**。

注意了,迄今为止,wg-quick是用bash写的一个脚本,不知道未来会不会变,至少目前shebang是

Continue reading “WireGuard wg-quick PostUp的高级玩法” »

WireGuard wg-quick PostUp的高级玩法 by @sskaje: https://sskaje.me/2017/06/wireguard-wg-quick-postup%e7%9a%84%e9%ab%98%e7%ba%a7%e7%8e%a9%e6%b3%95/

EdgeRouter 策略路由实现分析

最近家里的路由规则越来越复杂,而且越来越好用。正好昨天跟朋友讨论他的家用路由改造方案,所以研究了一下EdgeRouter的策略路由(Policy-based Routing,PBR)的实现。

我家里的路由是EdgeRouter Lite,固件1.9.1.1,这个实现跟固件关系不大。

首先,我们可以参考一下官方的文档:EdgeRouter – Policy-based routing (source address based)

Continue reading “EdgeRouter 策略路由实现分析” »

EdgeRouter 策略路由实现分析 by @sskaje: https://sskaje.me/2017/06/edgerouter-policy-based-routing-analysis/

EdgeRouter + SoftEther Policy-based Routing Error

I have protocol config like

SoftEther TAP device name is tap_se, local ip is 192.168.10.2, remote ip 192.168.10.1.

Internet is connected via pppoe0.

Policy-based routing modified to table 4 route traffic to pppoe0 rather than tap_se.

Check current route table:

In my previous post, I added a softether start-up script in /config/scripts/post-config.d/.
I guess vpnserver is launched after policy-based routing rules been applied, that causes policy-based routing find no device/connected routes for 192.168.10.1, then pppoe0 is picked.

I don’t have any good idea (add custom config template is a good choice, but i’m lazy zzZZ..), just disable and re-enable that route table after router is booted.

EdgeRouter + SoftEther Policy-based Routing Error by @sskaje: https://sskaje.me/2017/06/edgerouter-softether-policy-based-routing-error/