OpenWrt/ImmortalWrt 配置南京大学的BRAS校外拨入(L2TP),添加策略路由仅让访问校内IP走VPN。
用 opkg 安装 xl2tpd 及其依赖包,在 /etc/config/network 中添加如下配置,其中将***替换为统一认证的用户名密码。完成后在网络-接口中可见名为nju的接口,开机会自动链接。
config interface 'nju'
option proto 'l2tp'
option server '202.119.36.101'
option username '***'
option password '***'
option ipv6 '0'
option mtu '1452'
option defaultroute '0'
option delegate '0'
option ip4table 'main'
config route
option interface 'nju'
option target '114.212.0.0/16'
option mtu '1452'
config route
option interface 'nju'
option target '180.209.0.0/20'
option mtu '1452'
config route
option interface 'nju'
option target '202.119.32.0/19'
option mtu '1452'
config route
option interface 'nju'
option target '202.127.247.0/24'
option mtu '1452'
config route
option interface 'nju'
option target '202.38.126.160/28'
option mtu '1452'
config route
option interface 'nju'
option target '202.38.2.0/23'
option mtu '1452'
config route
option interface 'nju'
option target '210.28.128.0/20'
option mtu '1452'
config route
option interface 'nju'
option target '210.29.240.0/20'
option mtu '1452'
config route
option interface 'nju'
option target '219.219.112.0/20'
option mtu '1452'
config route
option interface 'nju'
option target '58.192.32.0/20'
option mtu '1452'
config route
option interface 'nju'
option target '58.192.48.0/21'
option mtu '1452'
config route
option interface 'nju'
option target '58.193.224.0/19'
option mtu '1452'
config route
option interface 'nju'
option target '58.195.80.0/20'
option mtu '1452'