Changes

435 bytes removed ,  11:42, 29 March 2023
m
Line 499: Line 499:  
This example will provide instructions on how configure RUT routers' DHCP Server using only UCI commands. For the sake of the example lets say that you want to change the dhcp range to ''192.168.1.2'' - ''192.168.1.200'' and the lease time to ''30 minutes''  
 
This example will provide instructions on how configure RUT routers' DHCP Server using only UCI commands. For the sake of the example lets say that you want to change the dhcp range to ''192.168.1.2'' - ''192.168.1.200'' and the lease time to ''30 minutes''  
   −
To achieve such a task, the first relevant piece of required information is the config name, '''dhcp''', where all the necessary configuration settings are stored. Another important thing to know is that when changing the lease time, three options are relevant - the time (option ''time''), the unit of time measurement (option ''letter'') and lease time(option ''leasetime), which is basically ''time'' ''+'' ''letter'', e.g., 12 hour lease time is ''12h''. Other options in question are start address (option ''start'') and address limit (option ''limit''). Lets start:
+
To achieve such a task, the first relevant piece of required information is the config name, '''dhcp''', where all the necessary configuration settings are stored. ''Lets start:''
    
Setting start address and limit:
 
Setting start address and limit:
Line 506: Line 506:     
Setting lease time
 
Setting lease time
# uci set dhcp.lan.letter=m
  −
# uci set dhcp.lan.time=30
   
  # uci set dhcp.lan.leasetime=30m
 
  # uci set dhcp.lan.leasetime=30m
    
Final steps:
 
Final steps:
 
  # uci commit dhcp
 
  # uci commit dhcp
  # luci-reload
+
  # /etc/init.d/dhcp restart
    
The first step sets the start address to 2 and the limit of addresses to 199. The value of the ''start'' option is associated with the last section of an IP address (if start value is '''2''' then the starting IP address is 192.168.1.'''2'''(provided that the router's LAN IP is in the 192.168.1.0/24 network)), the value of the ''limit'' option denotes how many IP addresses can be leased out starting from and including the the start address. Then the second step is used to set the lease time. The ''letter'' option specifies the unit of time measurement (either ''m'' for minutes or ''h'' for hours). The ''time'' option specifies number of minutes (or hours in other cases) and the ''leasetime'' option is just the representation (nonetheless, it's still mandatory) of the previous two values, i.e., 30m - thirty minutes.
 
The first step sets the start address to 2 and the limit of addresses to 199. The value of the ''start'' option is associated with the last section of an IP address (if start value is '''2''' then the starting IP address is 192.168.1.'''2'''(provided that the router's LAN IP is in the 192.168.1.0/24 network)), the value of the ''limit'' option denotes how many IP addresses can be leased out starting from and including the the start address. Then the second step is used to set the lease time. The ''letter'' option specifies the unit of time measurement (either ''m'' for minutes or ''h'' for hours). The ''time'' option specifies number of minutes (or hours in other cases) and the ''leasetime'' option is just the representation (nonetheless, it's still mandatory) of the previous two values, i.e., 30m - thirty minutes.

Navigation menu