cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2869
Views
5
Helpful
21
Replies

Unable to make DHCP relay work

tschertel
Level 1
Level 1

I'm trying to use the DHCP relay feature, with no success.

 

I've already tried on a SG300, on a SG350X and now on a CBS350, so clearly I'm letting something pass.
Today I have the CBS350 in my lab. It's connected to the network (port 2, connected to another switch) and I have a cable directly connected from my computer to it (port 47).
I'm doing everything through the web interface, as I'm not a network expert.


That's what I'm doing:
- I create a new VLAN (103);
- I add the port 47 to VLAN 103;
- change port 2 to trunk;
- enable DHCP relay and add the DHCP server (snooping and option 82 are disabled);

 

The DHCP server has two scopes: the regular one (xxx.xxx.93.0/24) and the new one (xxx.xxx.103.0/24);

 

Then, when I try to get a new IP, I get a "time out" message:
"An error occurred while renewing interface Ethernet 2 : unable to contact your DHCP server. Request has timed out."

 

I've tried all tutorials from internet
I've also tried some from Cisco:
https://www.cisco.com/c/en/us/td/docs/switches/lan/csbms/CBS_250_350/CLI/cbs-350-cli-/dhcp-relay-commands.html
https://www.cisco.com/c/en/us/support/docs/smb/switches/cisco-350-series-managed-switches/smb5406-configure-dynamic-host-configuration-protocol-dhcp-snooping.html

 

Any help would be appreciated.

21 Replies 21

balaji.bandi
Hall of Fame
Hall of Fame

can you post show run (from console to look)

 

where is your DHCP Server ? what IP address ?

 

 

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Hi, here is the "show run" output:

 

config-file-header
switchf27fed
v3.1.1.7 / RCBS3.1_930_871_081
CLI v1.0
file SSD indicator encrypted
@
ssd-control-start
ssd config
ssd file passphrase control unrestricted
no ssd file integrity control
ssd-control-end cb0a3fdb1f3a1af4e4430033719968c0
!
!
unit-type-control-start
unit-type unit 1 network gi uplink te
unit-type unit 2 network gi uplink te
unit-type unit 3 network gi uplink te
unit-type unit 4 network gi uplink te
unit-type-control-end
!
vlan database
vlan 103
exit
voice vlan oui-table add 0001e3 Siemens_AG_phone
voice vlan oui-table add 00036b Cisco_phone
voice vlan oui-table add 00096e Avaya
voice vlan oui-table add 000fe2 H3C_Aolynk
voice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone
voice vlan oui-table add 00d01e Pingtel_phone
voice vlan oui-table add 00e075 Polycom/Veritel_phone
voice vlan oui-table add 00e0bb 3Com_phone
ip dhcp relay address 192.168.93.3
ip dhcp relay enable
bonjour interface range vlan 1
hostname switchf27fed
username hi_there_:) password encrypted RWZYpw== privilege 15
ip ssh server
!
interface vlan 103
 name Servers
 ip address dhcp
 ip dhcp relay enable
!
interface GigabitEthernet1/0/2
 ip dhcp snooping trust
 switchport mode trunk
!
interface GigabitEthernet1/0/47
 ip dhcp snooping trust
 switchport access vlan 103
!
exit

You did not say where the DHCP server is. 

If the DHCP server is connected in the other switch you did right putting the port 2 as trunk. However, unless the DHCP is on the vlan 103 on the other switch, DHCP requests will not get to them.

 Also, the port 2 is connect to which port on the other switch? Does that port is in trunk as well?

 

If DHCP server is in a different vlan, you need to do inter-vlan routing in order your computer reach the DHCP server.

Hi Flavio.

Are you from Brazil?

 

The DHCP server is in our "regular" network (93.0).

The diagram would be something like this:

DHCP <-> switch <-> switch in lab <-> my computer

 

Just my lab's switch has a trunk port.

 

The other switch has no VLAN configured on it.


@Flavio Miranda wrote:

If DHCP server is in a different vlan, you need to do inter-vlan routing in order your computer reach the DHCP server.


The DHCP servers is on VLAN1.

Yeah, Brazil. You?

DHCP <-> switch <-> switch in lab <-> my computer

Well, in this case, either you create the vlan 103 on the switch, put the DHCP server port on this vlan 103 or you need to do inter-vlan routing.

Yeah, Brazil. You?

Me too

 

DHCP <-> switch <-> switch in lab <-> my computer

Well, in this case, either you create the vlan 103 on the switch, put the DHCP server port on this vlan 103 or you need to do inter-vlan routing.


OK. But this is not DHCP relay, right?

Don't we "have" DHCP relay, exactly to avoid having one DHCP server on each VLAN?

 Oh yeah, sorry. You not just trying to make it work right, you want to test DHCP relay.

Well, did you followed a guide like this and did not work?

 

https://9to5it.com/cisco-sg300-configure-dhcp-relay-to-allow-dhcp-server-to-support-multiple-subnets/ 


@Flavio Miranda wrote:

 Oh yeah, sorry. You not just trying to make it work right, you want to test DHCP relay.

Well, did you followed a guide like this and did not work?

 

https://9to5it.com/cisco-sg300-configure-dhcp-relay-to-allow-dhcp-server-to-support-multiple-subnets/ 


That's exactly what I did.

Maybe the problem is that I have more than one switch between the DHCP server and my computer.

interface vlan 103
 name Servers
 ip address dhcp
 ip dhcp relay enable

OK, the Broadcast will convert to unicast and send to DHCP server BUT it need IP source and I see the SVI ip address also assign IP form DHCP.
first check if the SVI have IP address and it better to manually add the IP address for SVI. 

Hi MHM,

The switch gets an IP from DHCP indeed.

So if I understood, I need to a fixed IP on my switch to have DHCP relay working?

Yes, try set ip then check dhcp

relay

Thanks for your suggestion, but unfortunately setting a static IP on SVI did not work.
At first, I put a static IP on SVI VLAN 1. All good. All working.
After that, I put a static IP on SVI VLAN 103. Then I lost access to the switch using its hostname. I had to use its static IP (from VLAN 1) to access it.
And the worst is, I lost the DHCP relay configuration menu in options. I need to factory reset it to get the menu back.

Does it matter, having another switch between the DHCP server and the switch I'm trying to configure?

can you share 
show ip route 
for this switch.

Hi MHM,

This is the "show ip route" output:

 

Maximum Parallel Paths: 1 (1 after reset)
IP Forwarding: enabled
Codes: > - best, C - connected, S - static,
       R - RIP


C   192.168.93.0/24 is directly connected, vlan 1
C   192.168.103.0/24 is directly connected, vlan 103

Maybe I have something wrong in DHCP server, because the switch gets an IP from the DHCP server for network 93.0. Just network 103.0 is not working.