RouterOS macvlan
Macvlan是LInux网卡虚拟化的解决方案,该技术能将 一块物理网卡虚拟成多张MAC地址不同的虚拟网卡,主要用于虚拟化和容器的应用RouterOSv7.12开始支持macvlan,当前支持两种模式bridge和private 。
简单设置
设置父级网卡为ether1,取名macvlan1,mac-address设置为D2:49:1F:FE:59:C9
/interface macvlan add mac-address=D2:49:1F:FE:59:C9 mode=private name=macvlan1 parent=ether1
单网卡多PPPoE拨号
由于macvlan能虚拟不同mac地址的网卡,那可以代替VRRP做相同接口下,进行多pppoe拨号,VRRP的MAC地址自动生成是无法被修改,但macvlan可以完全自定义mac地址。
测试中发现目前不能支持parent=vlan子接口,无法将macvlan绑定到interface vlan的vlan子接口下,也就意味着无法间接修改vlan子接口的MAC地址,不知道RouterOS后续是否能支持
创建三个macvlan接口分别是macvlan1,macvlan2,macvlan3,从属于ether1,并修改各自的mac地址使用macvlan配置pppoe拨号
/interface macvlan add mac-address=D2:49:1F:FE:59:C1 mode=private name=macvlan1 parent=ether1 add mac-address=D2:49:1F:FE:59:C2 mode=private name=macvlan2 parent=ether1 add mac-address=D2:49:1F:FE:59:C3 mode=private name=macvlan3 parent=ether1
创建PPPoE拨号客户端配置
/interface pppoe-client add disabled=no interface=macvlan1 name=pppoe-out1 user=yus password=yus add disabled=no interface=macvlan2 name=pppoe-out2 user=yus password=yus add disabled=no interface=macvlan3 name=pppoe-out3 user=yus password=yus
文章很值,打赏犒劳作者一下