This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
howto:general:dhcp:multiple_dhcp [2015/05/10 13:23] admin [Apply configuration changes] |
howto:general:dhcp:multiple_dhcp [2018/05/24 09:05] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Multiple DHCP-Server instances ====== | ====== Multiple DHCP-Server instances ====== | ||
| - | It ist possible to run multiple instances of the dhcp server listening on different interfaces. | + | Having multiple DHCP-Servers running is very useful if you're dealing with [[documentation:general:network:vlan_support|VLAN's]], [[howto:use_cases:wireless:guest_ap|Guest AP]] or any kind of separating networks from another. To give each Network a different configuration of IP-Addresses, Netmasks or any settings which are provided to the clients by the DHCP-Server.\\ |
| - | + | ||
| ===== Overview ===== | ===== Overview ===== | ||
| Line 8: | Line 7: | ||
| ==== Level of difficulty === | ==== Level of difficulty === | ||
| - | Easy | + | Medium |
| ==== Related topics ==== | ==== Related topics ==== | ||
| - | * [[documentation:configuration:uci]] | + | * [[documentation:configuration:UCI]] |
| * [[documentation:configuration:config_files:config_dhcp|/etc/config/dhcp]] | * [[documentation:configuration:config_files:config_dhcp|/etc/config/dhcp]] | ||
| | | ||
| Line 19: | Line 18: | ||
| ==== GUI ==== | ==== GUI ==== | ||
| - | Not available, yet | + | Not available, yet |
| ==== UCI Config System ==== | ==== UCI Config System ==== | ||
| - | * __**Add DHCP instance for guest-interface**__ | + | * **Add DHCP instance** |
| <code> | <code> | ||
| - | uci delete dhcp.guest | + | uci add dhcp dhcp |
| - | uci set dhcp.guest=dhcp | + | uci set dhcp.@dhcp[-1].interface=guest |
| - | uci set dhcp.guest.interface=guest | + | uci set dhcp.@dhcp[-1].start=62 |
| - | uci set dhcp.guest.start=62 | + | uci set dhcp.@dhcp[-1].limit=192 |
| - | uci set dhcp.guest.limit=192 | + | uci set dhcp.@dhcp[-1].leasetime=600h |
| - | uci set dhcp.guest.leasetime=600h | + | |
| </code> | </code> | ||
| + | __Note:__ The option interface defines on which interface the dhcp-server is listening for dhcp-requests. | ||
| - | * __**Store changes**__ | + | * **Store changes** |
| <code> | <code> | ||
| uci commit | uci commit | ||
| + | </code> | ||
| + | |||
| + | * **Apply changes** | ||
| + | <code> | ||
| + | /etc/init.d/dnsmasq restart | ||
| </code> | </code> | ||
| ==== UCI config files ==== | ==== UCI config files ==== | ||
| - | The 'dhcp' options are stored in [[documentation:configuration:config_files:config_dhcp|/etc/config/dhcp]]. Look there for a full list of available section-options. | + | The 'dhcp' options are stored in [[documentation:configuration:config_files:config_dhcp|/etc/config/dhcp]] |
| - | An additional instance could look like this: | + | * **DHCP instance** |
| <code> | <code> | ||
| - | config 'dhcp' 'lan' | + | config 'dhcp' 'guest' |
| option 'interface' 'guest' | option 'interface' 'guest' | ||
| option 'start' '62' | option 'start' '62' | ||
| Line 50: | Line 54: | ||
| option 'leasetime' '600h' | option 'leasetime' '600h' | ||
| </code> | </code> | ||
| + | __Note:__ The option interface defines on which interface the dhcp-server is listening for dhcp-requests. | ||
| - | ==== Apply configuration changes ==== | + | * **Apply changes** |
| - | + | ||
| - | To activate your config changes, the service needs to be restarted. Rebooting is not necessary: | + | |
| <code> | <code> | ||
| /etc/init.d/dnsmasq restart | /etc/init.d/dnsmasq restart | ||
| Line 60: | Line 63: | ||
| ===== Troubleshooting ===== | ===== Troubleshooting ===== | ||
| - | Not available, yet | + | Not available, yet |