Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
docs:guide-user:network:protocol.dhcp [2023/10/04 01:00] – optimize code vgaeteradocs:guide-user:network:protocol.dhcp [2023/10/04 01:41] – [Providing ISP DNS with DHCP] update vgaetera
Line 125: Line 125:
 do DHCP_OPT="$(uci -q get dhcp.${DHCP_POOL}.dhcp_option)" do DHCP_OPT="$(uci -q get dhcp.${DHCP_POOL}.dhcp_option)"
 for DHCP_OPT in ${DHCP_OPT} for DHCP_OPT in ${DHCP_OPT}
-do if [ "${DHCP_OPT%%,*}" = "6" ] +do case ${DHCP_OPT%%,*} in 
-then uci del_list dhcp.${DHCP_POOL}.dhcp_option="${DHCP_OPT}" +(6|option:dns-server) 
-fi+uci del_list dhcp.${DHCP_POOL}.dhcp_option="${DHCP_OPT}" ;; 
 +esac
 done done
 uci add_list dhcp.${DHCP_POOL}.dhcp_option="6,${DNS_SERV// /,}" uci add_list dhcp.${DHCP_POOL}.dhcp_option="6,${DNS_SERV// /,}"
Line 164: Line 165:
  
 ==== Getting specific WAN IP address ==== ==== Getting specific WAN IP address ====
-Get specific WAN IP address.+Assuming your ISP provides dynamic IP address with DHCP. 
 +Reconnect until you get the one matching a specific regexp. 
 +Delay for 10 seconds between reconnects.
  
 <code bash> <code bash>
Line 179: Line 182:
 ==== Resolving WAN/LAN subnet conflicts ==== ==== Resolving WAN/LAN subnet conflicts ====
 Automatically resolve WAN/LAN subnet conflicts. Automatically resolve WAN/LAN subnet conflicts.
 +Change LAN subnet if it overlaps with WAN.
  
 <code bash> <code bash>
-cat << "EOF" > /etc/udhcpc.user.d/20-lan-ipaddr+cat << "EOF" > /etc/udhcpc.user.d/10-lan-ipaddr
 WAN_ADDR="${ip}" WAN_ADDR="${ip}"
 LAN_IF="lan" LAN_IF="lan"
  • Last modified: 2023/10/06 03:39
  • by vgaetera