cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
13314
Views
0
Helpful
14
Replies

Packet tracer help - 2 vlans with dhcp server

Shikk
Level 1
Level 1

Hi everyone, newbie here self studying.

 

I was creating a lab for myself but I cannot for the life of me figure this out. 

 

I have a switch with 2 vlans (vlans 1 and 2), each vlan with 2 hosts, and the switch connected to the router via trunk port. Also connected to the switch is a dhcp server. 

I have created 2 subnets, 192.168.1.0 /25 and 192.168.1.128 /25 for each vlan.

I manually assigned ip addresses to vlan 1, 2, the dhcp server, and router. 

 

My issue is that the hosts in vlan 1 were able to receive ip information via dhcp but my hosts in vlan 2 cant. What am I doing wrong here? 

*edit: the dhcp server is able to ping vlan 1 but not vlan 2, which is where i think the problem lies. However i dont know how to get it to ping vlan 2...

 

I hope its not against the rules but i've included the .pkt file if it makes it easier. 2 vlans with dhcp server.PNG

1 Accepted Solution

Accepted Solutions

Seb Rupik
VIP Alumni
VIP Alumni

Hi there,

you DHCP server is in VLAN1, so you need to configure an IP helper address on VLAN2.

On the router use:

!
int fa0/0.1
  ip helper-address 192.168.1.126
!

cheers,

Seb.

 

View solution in original post

14 Replies 14

Leo Laohoo
Hall of Fame
Hall of Fame
Try asking your instructor for guidance because we may give the answers the instructor may not accept.

I dont have an instructor, I am self studying with materials and videos online, did I post in the wrong section? I'm new to this site and wasnt aware if this section was just for classwork or anything like that.

Hello @Shikk

If you are studying for a certification, you might want to considering posting question in the Cisco Learning Community at 

 

Cheers,

Monica

 

I hope you and your love ones are safe and healthy
Monica Lluis
Community Manager Lead

Seb Rupik
VIP Alumni
VIP Alumni

Hi there,

you DHCP server is in VLAN1, so you need to configure an IP helper address on VLAN2.

On the router use:

!
int fa0/0.1
  ip helper-address 192.168.1.126
!

cheers,

Seb.

 

I already had that on the switch: 

interface Vlan2

mac-address 0001.9628.9501

ip address 192.168.1.130 255.255.255.128

ip helper-address 192.168.1.126

 

and after doing it on the router also as suggested:

interface FastEthernet0/0.1

encapsulation dot1Q 2

ip address 192.168.1.129 255.255.255.128

ip helper-address 192.168.1.126

 

still no dice =/

hmmm, typically you want a single gateway per subnet. Are the hosts configured to use the switch or router as their local gateway?

 

Also, does the DHCP server have a VLAN2 DHCP scope defined?

 

cheers,

Seb.

I thought the default gateway was to be set by the dhcp server, and if i had manually set them, it would defeat the purpose?

 

In my self studies, i've not yet come across what you mentioned regarding a second vlan scope defined so no idea. this is what my dhcp config looks like so far. 

 

dhcp server config.PNG

I just edited my main post to say that the dhcp server is able to ping vlan 1 but not vlan 2.

Correct that the default gateway is set via DHCP, but both the switch and router have Layer3 interfaces in both subnets, so I was curious which one clients were being configured to use.

Looking at your DHCP scope you are specifying the router interface, which makes the switch SVIs redundant.

 

If the DHCP server cannot reach the VLAN2 fa0/0.1 sub-interface, I suggest you check the config on the interface between the switch and router. Is it configured as a trunk (VLAN 1 and 2 being tagged)?

 

Can you share the switch config?

 

cheers,

Seb.

I just solved my original issue but now have a completely different issue x.x

 

I noticed i stupidly forgot to give the dhcp server itself a default gateway since i put it in manually. After i set the gateway to 192.168.1.1 i was able to go to my vlan 2 hosts and retrieve proper addresses and gateways.

 

Now my new problem; my vlan 1 hosts can ping everything in the network but nothing can ping them back. Everything else can ping everything except the hosts on vlan 1. For example, the the dhcp server can ping vlan 1, but cant ping any host on vlan 1.

 

Here is my switch (which i suspect is the culprit) config:

hostname Switch
!
no ip domain-lookup
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface FastEthernet0/1
switchport mode trunk
!
interface FastEthernet0/2
switchport access vlan 2
!
interface FastEthernet0/3
switchport access vlan 2
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/24
switchport mode trunk
!
interface Vlan1
ip address 192.168.1.2 255.255.255.128
ip helper-address 192.168.1.126
!
interface Vlan2
mac-address 0001.9628.9501
ip address 192.168.1.130 255.255.255.128
ip helper-address 192.168.1.126
!
line con 0
logging synchronous

Here is also my vlan and trunk config for it

Switch#sh vlan b

VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/4, Fa0/5, Fa0/6, Fa0/7 Fa0/8, Fa0/9, Fa0/10, Fa0/11 Fa0/12, Fa0/13, Fa0/14, Fa0/15
Fa0/16, Fa0/17, Fa0/18, Fa0/19 Fa0/20, Fa0/21, Fa0/22, Fa0/23 Gig0/1, Gig0/2

2 VLAN0002 active Fa0/2, Fa0/3

1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active


Switch#sh int trunk
Port Mode Encapsulation Status Native vlan
Fa0/1 on 802.1q trunking 1
Fa0/24 on 802.1q trunking 1

Port Vlans allowed on trunk
Fa0/1 1-1005
Fa0/24 1-1005

Port Vlans allowed and active in management domain
Fa0/1 1,2
Fa0/24 1,2

Port Vlans in spanning tree forwarding state and not pruned
Fa0/1 1,2
Fa0/24 1,2

Switch#

Just to clarify, the VLAN1 hosts can ping the DHCP server? But not the other way around? 

Can you share the ipconfig output from a VLAN1 host and the DHCP server?

 

Can you share the config from the router?

Correct, the VLAN1 hosts can ping the DHCP server but not the other way around:

PC to DHCP server

PC TO DHCP.PNG

 

DHCP to VLAN1, then to Host

DHCP TO PC.PNG

 

Router config:

interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.128
duplex auto
speed auto
!
interface FastEthernet0/0.1
encapsulation dot1Q 2
ip address 192.168.1.129 255.255.255.128
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface Serial0/1/0
no ip address
clock rate 2000000
!
interface Vlan1
no ip address
shutdown
!
ip classless
!
ip flow-export version 9
!
line con 0
logging synchronous
!
line aux 0
!
line vty 0 4
login
!
end

 

Can the DHCP server ping 192.168.1.3 (the host used in the first example)?

Is 192.168.1.4 actually online?

 

What is the output of sh ip arp on the router?

I reloaded the lab to the file i uploaded, ONLY applied the change in one of my previous answers (forgot to add the default gateway to the dhcp server), changed nothing else, and now everything works. Everything can ping everything; i must have accidentally changed something w/o realizing it, but everything works now. Thank you Seb for all your help!!

markobratic
Level 1
Level 1

I had a similar issue with my lab and then tried to use your pkt file to find what was wrong and found that the uploaded packet file couldn't have worked since VLAN 2 wasn't getting any DHCP addresses. VLAN 1 was functioning just because it was a native VLAN. I know this is an old thread but I'm uploading the "solved" pkt file.

Two things, among some tweaks, I corrected was adding a gateway on the DHCP server under Desktop/IP Configuration that wasn't configured and reconfigured the interfaces on the router for the VLAN routing to:

interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.1
 description VLAN 1
 encapsulation dot1Q 1 native
 ip address 192.168.1.1 255.255.255.128
 ip helper-address 192.168.1.126
 ip nat inside
!
interface FastEthernet0/0.2
 description VLAN 2
 encapsulation dot1Q 2
 ip address 192.168.1.129 255.255.255.128
 ip helper-address 192.168.1.126
 ip nat inside
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!

 Also configured VLAN 1 on ports for the PCs that should be in VLAN 1, but were actually just on untagged interfaces (undefined switchport VLAN).

hope it helps someone learning Cisco like this problem solving did for me

Review Cisco Networking products for a $25 gift card