- Posts: 75
- Thank you received: 0
dhcp config for vlans
15 years 6 months ago #30536
by pedenski
dhcp config for vlans was created by pedenski
this might sound noob, but thats what im here for.. to learn.. ^^ anyways. can you please explain to me how to properly set dynamic ip to switch. Im using packet tracer.
here's my config
switch(config)#interface vlan 1
switch(config-if)#ip address dhcp
switch(config-if)#no shutdown
after that, i connected a host pc and typed at the CMD ipconfig /renew.
but it replies with dhcp request failed
*is a switch can only be a dhcp client?
*how do i add a dhcp pool on the switch?
here's my config
switch(config)#interface vlan 1
switch(config-if)#ip address dhcp
switch(config-if)#no shutdown
after that, i connected a host pc and typed at the CMD ipconfig /renew.
but it replies with dhcp request failed
*is a switch can only be a dhcp client?
*how do i add a dhcp pool on the switch?
15 years 6 months ago #30541
by georbe
Replied by georbe on topic Re: dhcp config for vlans
1. First of all, you have to assign an IP address on the VLAN interface of the switch (if it is a Layer 3 switch).
switch(config)#interface vlan 1
switch(config-if)#ip address 10.20.30.1 255.255.255.0
switch(config-if)#no shutdown
2. Then you have to create a DHCP IP address pool for the IP addresses you want to assign to your clients.
switch(config)# ip dhcp pool mypool
3. You have to specify the network and subnet for the addresses you want to use from the pool.
switch(dhcp-config)# network 10.20.30.0
4. Then you can specify the DNS, the gateway, and other options to send to the clients.
switch(dhcp-config)#dns-server 10.1.1.1 10.10.10.2
switch(dhcp-config)#default-router 10.20.30.1
And you are done...
You can exlude IP addresses to be given to the clients, by using this command:
switch(config)#ip dhcp excluded-address 10.20.30.0 10.20.30.100
With this command, your switch will never give out the addresses below .100 to your clients.
This configuration can only be applied on a Layer 3 switch, or on a Router.
If you don't know if you have a Layer 3 or Layer 3 switch, post here the output of the "show ver" command, and I will tell you.
switch(config)#interface vlan 1
switch(config-if)#ip address 10.20.30.1 255.255.255.0
switch(config-if)#no shutdown
2. Then you have to create a DHCP IP address pool for the IP addresses you want to assign to your clients.
switch(config)# ip dhcp pool mypool
3. You have to specify the network and subnet for the addresses you want to use from the pool.
switch(dhcp-config)# network 10.20.30.0
4. Then you can specify the DNS, the gateway, and other options to send to the clients.
switch(dhcp-config)#dns-server 10.1.1.1 10.10.10.2
switch(dhcp-config)#default-router 10.20.30.1
And you are done...
You can exlude IP addresses to be given to the clients, by using this command:
switch(config)#ip dhcp excluded-address 10.20.30.0 10.20.30.100
With this command, your switch will never give out the addresses below .100 to your clients.
This configuration can only be applied on a Layer 3 switch, or on a Router.
If you don't know if you have a Layer 3 or Layer 3 switch, post here the output of the "show ver" command, and I will tell you.
15 years 6 months ago #30556
by pedenski
Replied by pedenski on topic Re: dhcp config for vlans
wow thanks for that. I finally know now..
anyway, can you just xplain, what differs a layer 3 switch?
anyway, can you just xplain, what differs a layer 3 switch?
Time to create page: 0.119 seconds