vyos有两个网卡,分别是eth0和eth1,eth0是外网卡,用于承载pppoe虚接口,eth1是内网卡,IP10.222.222.1/24。
需求:在eth0接口上配置pppoe虚接口,并配置src-nat使10.222.222.0/24能上网。
我这有北京联通tr069网做实验,如需在vyos使用pppoe拨号上网需在vlan3961中进行。
如下图所示,电脑可以拨通tr069网的pppoe。

1,配置pppoe连接。
设置pppoe虚接口名称为pppoe069,用户名[email protected]
set interfaces pppoe pppoe069 authentication user [email protected]
设置pppoe虚接口名称为pppoe069,密码s1b5x7z9
set interfaces pppoe pppoe069 authentication password s1b5x7z9
设置pppoe虚接口名称为pppoe069,在eth0物理接口承载
set interfaces pppoe pppoe069 source-interface eth0
设置pppoe虚接口名称为pppoe069,自动使用接口获得的默认路由,如不使用或强制使用则将auto参数改为none或 force。
set interfaces pppoe pppoe069 default-route auto
提交
commit
完