1

I'm trying to create a lab on PT and I've attached an image. But for some reason my PC is not able to get an IP address from the DHCP server. There is no issues with layer 1 and layer 2. I checked routing and that seems to be fine too. Any help is appreciated :)

enter image description here

Switch Config:

interface FastEthernet0/1
 switchport access vlan 10
 switchport mode access
 switchport nonegotiate
!
interface FastEthernet0/2
 switchport access vlan 20
 switchport mode access
 switchport nonegotiate
!
interface FastEthernet0/3
 switchport trunk encapsulation dot1q
 switchport mode trunk
!

interface Vlan1
 no ip address
 shutdown
!
interface Vlan10
 mac-address 00e0.a341.0e01
 no ip address
!
interface Vlan20
 mac-address 00e0.a341.0e02
 no ip address

end

Router Config:

interface GigabitEthernet0/0
 ip address 10.0.0.1 255.255.255.0
 duplex auto
 speed auto
!
interface GigabitEthernet0/0.10
 encapsulation dot1Q 10
 ip address 20.0.0.1 255.255.255.0
!
interface GigabitEthernet0/0.20
 encapsulation dot1Q 20
 ip address 30.0.0.1 255.255.255.0
 ip helper-address 30.0.0.1

interface Vlan1
 no ip address
 shutdown

closed as too broad by Ron Maupin Apr 30 at 0:46

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • You must have routing enabled and configure a DHCP relay. – Ron Maupin Apr 19 at 18:24
  • I've configured sub interface g0/0.20 for vlan 20. And I've configured ip helper address on that same interface. Should I do anything different? – iiTechii Apr 19 at 18:25
  • You need to edit your question with the configurations. We cannot simply guess what may be wrong. – Ron Maupin Apr 19 at 18:26
  • Please enter the full configurations because there are other configurations that could affect this. Also, use the Preformatted-text option ({}). – Ron Maupin Apr 19 at 18:32
  • I'm so sorry! I edited the question with the running config of switch and router. I committed some parts of the config . – iiTechii Apr 19 at 18:33
2

As DHCP is broadcast (v4) or link-local multicast (v6) nothing will happen unless you configure a DCHP relay on the router. This will listen to the broadcast / mutlicast turn it to a unicast message towards the DHCP server and the DHCP server will answer the clients request.

1

We really need to see the full configurations. For example, you can have a problem if you do not create the VLANs with the global vlan command, and your configuration doesn't show that:

vlan 10
 name Users
 exit
!
vlan 20
 name Servers
 exit
!

You do not need to name the VLANs, you only need to create them with the global vlan command, but naming them is a best practice.

You also put the ip helper-address on the wrong VLAN. It needs to be on the VLAN of the hosts trying to get DHCP, not on the DHCP server VLAN.


There could aslo be other problems, but you have not given us the full configurations.

Not the answer you're looking for? Browse other questions tagged or ask your own question.