Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Dhcp not working

hi,

   I have a made a topology in pkt tracer. i have made use of a router and switches. i placed dhcp in vlan 2 and my clients are in various vlans ranging from 3-7. Now i have made sub-interfaces on my router to implement router-on-a-stick technique and have assigned ip addresses to all the sub-interrfaces. The issue is that when i try to assign ip to my clients in any vlan thy dont get ip from the dhcp server. Provided that i set the gateway in dhcp the same as the ip on that sub-interface. Please help me out here. i know i am making a silly mistake somewhere so i am attaching the pkt tracer file along.Also the switches are also assigned ip addresses from 192.168.1.2 - 1.8. The Fa0/0 interface on the router is also assigned an ip address its 192.168.1.1.

Everyone's tags (2)
2 ACCEPTED SOLUTIONS

Accepted Solutions
New Member

Dhcp not working

You got 2 problems here. The first problem i saw was that on your router, you got a subinterface fa0/0.2 for vlan 2 which your DHCP server are at.

But you haven't configure the subinterface IP address correct yet.

Try and replace following:

interface FastEthernet0/0.2

encapsulation dot1Q 2

ip address 192.168.2.1 255.255.255.0

with

encapsulation dot1Q 2

ip address 192.168.1.1 255.255.255.0

ip helper-address 192.168.1.8

As you can see vlan2 got the IP 192.168.2.1 as default gateway and your DHCP-server trying to access 192.168.1.1.

Second problem is your dhcp-pool

The DHCP pool you trying to give out is 192.168.1.0.

First of all you can't put a start address with the netID, Second try and put the start IP address for the right vlan.

For an example to give vlan 3 (Block 1) DHCP address you have to make a pool with the start address like: 192.168.3.1

vlan4 (Block 2): 192.168.4.1

etc....

I hope this help you!

New Member

Re: Dhcp not working

Hello Ahmed,

My bad about the ip-helper on that interface, abit tired here now. No you're right you don't need ip-helper on that interface.

But still your DHCP server got a default gateway to 192.168.1.1 for vlan2.

But when you check the conf on your router at FastEthernet0/0.2 you got a IP address 192.168.2.1.

As you can see in your conf you got the IP 192.168.1.1 on FastEthernet0/0 but that's the wrong interface... you need that IP address on the subinterface Fa0/0.2 instead.

I just tested your pkt file.

This is the steps i did:

Router0

2800_Rtr(config)#int fa0/0

2800_Rtr(config-if)#no ip address

2800_Rtr(config-if)#int fa0/0.2

2800_Rtr(config-subif)#ip address 192.168.1.1 255.255.255.0

And yea, i know that packet tracer can change those settings sometimes. But if you set the DHCP pool again for vlan3 with a start address 192.168.3.2 (because default gateway is 192.168.3.1) and move the ip address on the router fa0/0 to fa0/0.2 it should work just fine. (I tried it myself, and it worked.)

Your conf on router:

interface FastEthernet0/0

description Link For Telnet To Switches

ip address 192.168.1.1 255.255.255.0

ip helper-address 192.168.1.8

duplex auto

speed auto

!

interface FastEthernet0/0.2

encapsulation dot1Q 2

ip address 192.168.2.1 255.255.255.0

!

Mine:

interface FastEthernet0/0

description Link For Telnet To Switches

no ip address

ip helper-address 192.168.1.8

duplex auto

speed auto

!

interface FastEthernet0/0.2

encapsulation dot1Q 2

ip address 192.168.1.1 255.255.255.0

!

Method 2: You can change the default gateway on the dhcp server to 192.168.2.2 but then you have to change the ip-helper address on all subinterfaces (except vlan1 and 2). So i would stick to move the fa0/0 address to fa0/0.2 instead.

I hope this works better for you.

13 REPLIES
Bronze

Re: Dhcp not working

As I can see, you did not put command ip helper-address anywhere except interface f0/0.3 (VLAN 3). This command is neccessary on all sub-ifs where your clients are situated. And also check if you can ping DHCP server from router. May be something wrong with your switching topology.

New Member

Re: Dhcp not working

Hey,

      I can ping my server from my router the issue is with clients not getting ips from dhcp. do i have to put it on all sub-interfaces first and then check if the clients are getting IPs? i only assisgned it to fa0/0.3 to see if its working or not.

Ok i did put the ip helper-address 192.168.1.8 on all the sub-interfaces and still not working.

Regards,

Ali

Message was edited by: Ahmed Malik

Gold

Re: Dhcp not working

Hi there,

I could not see ur file since im on a Mac.

Look, you have to make a separate dhcp pool for every vlan that u need to be served by dhcp, network range depends on each VLAN.

then you have to issue the ip helper-address on all the interfaces/subif except for the one with the dhcp server on it.

when a client sends a dhcp request, the router takes it from the segment and sends it to the dhcp server, RTR requests an IP address from the pool with the appropriate range with regards to the subif's ip address, one which router received the packet from.

plz Rate if it helped.

Soroush.

Hope it Helps!

Soroush.
New Member

Re: Dhcp not working

Hello Soroush,

                     Yeah i did make a seperate dhcp pool for each vlan and also i used the ip helper-address on each sub-interface and still no luck.

Regards,

Ali

Purple

Dhcp not working

Hi,

can you repost the newest PT file.

Regards.

Alain

Don't forget to rate helpful posts.
New Member

Dhcp not working

couple questions:

are the vlans set up correctly on your switches and trunked on the switch interface the router is plugged into?

can you statically assign an IP on a workstation and ping the sub interface and the dhcp server?

I also noticed in your reply post you assigned the helper addres 192.168.1.8 which in your original post is assigned to one of your switches.  The IP helper address needs to be the address of your DHCP server.

example:  if you dhcp server IP was 192.168.1.100 then your command would be ip helper-address 192.168.1.100

New Member

Dhcp not working

Hi jim,

yes the vlans are setup correctly and trunked too. ok i statically assigned the ip of 192.168.3.2 to a pc in block 1 and now it pings it default-gateway andalso the dhcp server which is in another sub-interface and i changed the ip of the dhcp to 192.168.2.2 and now its in sub-interface 192.168.2.1. Now what?

New Member

Dhcp not working

You got 2 problems here. The first problem i saw was that on your router, you got a subinterface fa0/0.2 for vlan 2 which your DHCP server are at.

But you haven't configure the subinterface IP address correct yet.

Try and replace following:

interface FastEthernet0/0.2

encapsulation dot1Q 2

ip address 192.168.2.1 255.255.255.0

with

encapsulation dot1Q 2

ip address 192.168.1.1 255.255.255.0

ip helper-address 192.168.1.8

As you can see vlan2 got the IP 192.168.2.1 as default gateway and your DHCP-server trying to access 192.168.1.1.

Second problem is your dhcp-pool

The DHCP pool you trying to give out is 192.168.1.0.

First of all you can't put a start address with the netID, Second try and put the start IP address for the right vlan.

For an example to give vlan 3 (Block 1) DHCP address you have to make a pool with the start address like: 192.168.3.1

vlan4 (Block 2): 192.168.4.1

etc....

I hope this help you!

New Member

Dhcp not working

Hi Henrikp92,

                   The vlan2 is for dhcp server so why would i put ip-helper address [dhcp address] on that interface? ok the dhcp pool, i was giving it 192.168.3.2 for block 3 start ip address but each time i would open the file in pkt tracer it would reset the ip to a net address.

Ok i changed the ip address of dhcp to 192.168.2.2 for fa0/0.2 as it has ip of 192.168.2.1 but still nothing changed.

New Member

Re: Dhcp not working

Hello Ahmed,

My bad about the ip-helper on that interface, abit tired here now. No you're right you don't need ip-helper on that interface.

But still your DHCP server got a default gateway to 192.168.1.1 for vlan2.

But when you check the conf on your router at FastEthernet0/0.2 you got a IP address 192.168.2.1.

As you can see in your conf you got the IP 192.168.1.1 on FastEthernet0/0 but that's the wrong interface... you need that IP address on the subinterface Fa0/0.2 instead.

I just tested your pkt file.

This is the steps i did:

Router0

2800_Rtr(config)#int fa0/0

2800_Rtr(config-if)#no ip address

2800_Rtr(config-if)#int fa0/0.2

2800_Rtr(config-subif)#ip address 192.168.1.1 255.255.255.0

And yea, i know that packet tracer can change those settings sometimes. But if you set the DHCP pool again for vlan3 with a start address 192.168.3.2 (because default gateway is 192.168.3.1) and move the ip address on the router fa0/0 to fa0/0.2 it should work just fine. (I tried it myself, and it worked.)

Your conf on router:

interface FastEthernet0/0

description Link For Telnet To Switches

ip address 192.168.1.1 255.255.255.0

ip helper-address 192.168.1.8

duplex auto

speed auto

!

interface FastEthernet0/0.2

encapsulation dot1Q 2

ip address 192.168.2.1 255.255.255.0

!

Mine:

interface FastEthernet0/0

description Link For Telnet To Switches

no ip address

ip helper-address 192.168.1.8

duplex auto

speed auto

!

interface FastEthernet0/0.2

encapsulation dot1Q 2

ip address 192.168.1.1 255.255.255.0

!

Method 2: You can change the default gateway on the dhcp server to 192.168.2.2 but then you have to change the ip-helper address on all subinterfaces (except vlan1 and 2). So i would stick to move the fa0/0 address to fa0/0.2 instead.

I hope this works better for you.

New Member

Re: Dhcp not working

Hi Henrikp,

               ok now its working fine and now all my blocks are getting ips from the dhcp. thanks for the help. Now my second question is that once i have achieved this portion and now if i want to connect my 2811 Router to the ISP i have to use nat and to achieve this do i have to put ip on the inside physical interface of the 2800 router or not ?

Regadrs,

Ali

New Member

Re: Dhcp not working

Hi Ahmed,

     Ah glad to hear it worked out for you.

     Yes you have to set an public IP address on your public interface, in your case Fa0/1.

     After that you have to cretate an access list for your NAT. Which should look something like:

     ip access-list standard nat

     permit 192.168.3.0 0.0.0.255 <-- this is for vlan 3

     You have to do the "permit" command with all the vlans you want internet access with.

     After you done with the access-list you have to put the access-list at the fa0/1 (public) interface.

     Which should look something like this:

     ip nat inside source list nat interface FastEthernet0/1 overload.

     Cheers,

     Henke

New Member

Re: Dhcp not working

Hello Henrikp92,

                      Thanks for the reply back. I dont need a routing protocol in this scenario i think because my 2800 rtr will directly connect to the ISP router. right? i will try this and will get back to you asap.

Regards,

Ali

13496
Views
12
Helpful
13
Replies
CreatePlease login to create content