Chon · 翀

The Neverland Blog

PPPoE

OpenWRT

vwnum=8
username=''
password=''

for i in $(seq 1 $vwnum)
do

  uci set network.vwan${i}=interface
  uci set network.vwan${i}.proto=pppoe
  uci set network.vwan${i}.ifname=veth${i}
  uci set network.vwan${i}.username=${username}
  uci set network.vwan${i}.password=${password}
  uci set network.vwan${i}.metric=${i}
  uci add_list firewall.@zone[1].network=vwan${i}

  ip link add link eth0.2 name veth${i} type macvlan

done

uci commit network
/etc/init.d/network restart