ros下pppoe拨号上网自动绑定mac地址及内网ip脚本

在profile的on-up脚本中定义以下脚本:

#判断当前账号连接方式是否pppoe
:if ([/ppp active get [find name=$user] service]="pppoe") do={

    #获取当前账号分配的IP地址
    :local ip [/ppp active get [find name=$user] address];

    #获取当前账号的mac地址
    :local mac [/ppp active get [find name=$user] caller-id];

    :log error "账号:$user,分配的内网IP:$ip,mac地址:$mac"

    #设置账号绑定的内网ip及mac地址
    /ppp secret set [find name=$user] remote-address=$ip caller-id=$mac;

}

  

原文地址:https://www.cnblogs.com/qingshang/p/13757021.html