1. 由nvram指令, 將dhcpd_static值抓出. 更新韌體後, 再寫入dhcpd_static.
方法1
讀
nvram show 後找 dhcpd_static的值
寫
nvram set dhcpd_static="xxx"
如果資料太多,則利用變數
例如:
d1=xxx
d2=xxxx
d3=xxxxx
nvram set dhcpd_static="$d1""$d2""$d3"
方法2-1
保留dhcp的ip綁定MAC的設定值
將dhcpd_static值抓出
nvram get dhcpd_static >>Filename ;存檔
nvram get dhcpd_static >>3
變數=$(cat Filename) ;令變數內容=檔案
d1=$(cat 1.txt)
d2=$(cat 2.txt)
d3=$(cat 3.txt)
d4=$(cat 4.txt)
nvram set dhcpd_static="$變數"
nvram set dhcpd_static="$d1""$d2""$d3""$d4"
檔案最大為760ype
nvram set dhcpd_static="$(cat path/filename)"
nvram commit
沒有留言:
張貼留言