cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
213
Views
0
Helpful
12
Replies
Beginner

Packet tracer help - 2 vlans with dhcp server

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
Highlighted
VIP Advisor

Re: Packet tracer help - 2 vlans with dhcp server

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.

 

12 REPLIES 12
Hall of Fame Community Legend

Re: Packet tracer help - 2 vlans with dhcp server

Try asking your instructor for guidance because we may give the answers the instructor may not accept.
Beginner

Re: Packet tracer help - 2 vlans with dhcp server

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.

Highlighted
VIP Advisor

Re: Packet tracer help - 2 vlans with dhcp server

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.

 

Beginner

Re: Packet tracer help - 2 vlans with dhcp server

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 =/

VIP Advisor

Re: Packet tracer help - 2 vlans with dhcp server

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.

Beginner

Re: Packet tracer help - 2 vlans with dhcp server

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.

VIP Advisor

Re: Packet tracer help - 2 vlans with dhcp server

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.

Beginner

Re: Packet tracer help - 2 vlans with dhcp server

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#
VIP Advisor

Re: Packet tracer help - 2 vlans with dhcp server

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?

Beginner

Re: Packet tracer help - 2 vlans with dhcp server

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

 

VIP Advisor

Re: Packet tracer help - 2 vlans with dhcp server

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?

Beginner

Re: Packet tracer help - 2 vlans with dhcp server

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!!

CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards