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;

}

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM