Article ID: 13918
Products
S-Series
Goals
Run a Dynamic Host Configuration Protocol (DHCP) Server on multiple routed interfaces.
Solution
In addition to providing its DHCP clients a dynamic IP address within the proper subnet, this sample configuration also passes the clients their DHCP Lease time ('
<
days hours minutes
>'), their Default Gateway's IP address ('
<
IP
>'), and their Domain Name Server's IP address ('
<
IP
>'): interface vlan.0.100
ip address 192.168.1.1 255.255.255.0 primary
ip dhcp server
no shutdown
exit
interface vlan.0.110
ip address 192.168.2.1 255.255.255.0 primary
ip dhcp server
no shutdown
exit
interface vlan.0.120
ip address 192.168.3.1 255.255.255.0 primary
ip dhcp server
no shutdown
exit
ip local pool pool1 192.168.1.0 255.255.255.0
exit
ip local pool pool2 192.168.2.0 255.255.255.0
exit
ip local pool pool3 192.168.3.0 255.255.255.0
exit
ip dhcp pool pool1
lease 30 0 0
default-router 192.168.1.1
dns-server 10.26.190.12
exit
ip dhcp pool pool2
lease 30 0 0
default-router 192.168.2.1
dns-server 10.26.190.12
exit
ip dhcp pool pool3
lease 30 0 0
default-router 192.168.3.1
dns-server 10.26.190.12
exit