cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1061
Views
4
Helpful
10
Replies

DHCP Server on one VLAN and user machines on another VLAN

wfirth2012
Level 1
Level 1

Hello,

I currently have an ubuntu machine running as DHCP server that distributes the IP's to two user machines however i have moved the server and user machines onto their own separate VLANs (as a bit of a challenge) and want them to still receive IPs from DHCP but to be on different VLANS. Do i need to setup a SVI? i have tired the ip helper address however i just get wrong destination ip address when putting the IP address of the DHCP on the interfaces

Any help would be very appreciated

10 Replies 10

M02@rt37
VIP
VIP

Hello @wfirth2012 

Yes, you'll need to have a L3 interface (either an SVI on a switch or a routed subinterface on a router) for each VLAN that requires DHCP relay functionality.

The ip helper-address command is configured on these interfaces, which are the default gateways for the client VLANs, to forward broadcast DHCP requests to your Ubuntu DHCP server.

When you saw the "wrong destination IP address" error ; it means that the IP address you provided wasn't reachable from that VLAN's routing context or there was a misconfiguration in the helper setup. 

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Hello,

 

You should just be able to put the helper address on the SVI interface you configured as the default GW of that VLAN. The device also needs to be able to reach the DHCP server address through routing or being directly connected.

Can you provide your configuration/diagram?

-David

You have two VLANs (10 for the server and 20 for users) defined and corresponding SVIs created, but note that neither interface VLAN 10 nor VLAN 20 has an IP address configured ??!!!! ....which is essential if the switch is to perform any routing or relay functions.

Since your DHCP server (with a range of 192.168.1.100–200 and IP address 192.168.1.20) is on a separate VLAN from the user machines, you must enable DHCP relay on the VLAN where the clients reside. To do that, configure an IP address on the SVI for VLAN 20 (for example, 192.168.1.1/24) so that it can serve as the default gateway for user devices, and then add the command “ip helper-address 192.168.1.20” under interface VLAN 20; this will forward the broadcast DHCP requests from VLAN 20 to the DHCP server. Also, make sure that proper inter-VLAN routing is enabled on your switch or routed device so that traffic between VLAN 10 and VLAN 20 can flow correctly, and that the DHCP server’s configuration is aware of the correct default gateway for each VLAN.

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Thankyou so much for the help i will try this now 

@wfirth2012 

Yes, you need to create an SVI:

For example, if:

DHCP server IP: 192.168.1.10
VLAN 10 subnet: 192.168.10.0/24
VLAN 20 subnet: 192.168.20.0/24

You need config sw :
interface Vlan10
ip address 192.168.10.1 255.255.255.0
ip helper-address 192.168.1.10

interface Vlan20
ip address 192.168.20.1 255.255.255.0
ip helper-address 192.168.1.10


and be sure that Ubuntu DHCP scop:

subnet 192.168.10.0 netmask 255.255.255.0 {
range 192.168.10.100 192.168.10.200;
option routers 192.168.10.1;
}

subnet 192.168.20.0 netmask 255.255.255.0 {
range 192.168.20.100 192.168.20.200;
option routers 192.168.20.1;
}

Thanks !

Hi sorry, i have only just been able to try this, when putting the ip-helper address in it says wrong destination address 

To help you with this we need more details about your environment. A good starting point would be to post the current running config (with sensitive information obscured) and details of where the clients are and where the server is. If you don't want to provide the complete configuration then give us the configuration of the vlan where the clients are and the vlan where the server is. Are both vlans on the same switch? If on different switches then also provide the output of show ip route on the switch where the clients are.

HTH

Rick

Hi Richard Apologies as when posting this last time i was reported for abuse so not sure why. Both VLANS are on the same switch. I will provide a basic network diagram i quickly made below, i cant add the ip address helper to the VLANS even after going into the interface of each VLAN and typing it 


config-file-header
switch
v3.0.0.69 / RCBS3.0_930_770_008
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 10,20
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
bonjour interface range vlan 1
hostname switch
username admin password encrypted xxx
!
interface vlan 10
name server
ip address 192.168.2.1 255.255.255.0
!
interface vlan 20
name users
ip address 192.168.1.1 255.255.255.0
!
interface GigabitEthernet1/0/12
switchport access vlan 20
!
interface GigabitEthernet1/0/36
switchport access vlan 20
!
interface GigabitEthernet1/0/48
switchport access vlan 10
!
exit
ip helper-address 192.168.1.20 255.255.255.255 37 42 49 53 137 138

 

diagram.PNG

 

Thanks for the additional information. I have these points:

- so the server is in vlan 10 and the clients are in vlan 20. I would expect the helper address command to be associated with interface vlan 20. But this output seems to show it not associated with an interface.

- the helper address command should point to the server address. So I would expect it to be something in vlan 10 but it points to 192.168.1.20 which is in vlan 20.

- for this to work ip routing needs to be enabled. I can not tell from the posted partial config whether ip routing is enabled or not.

HTH

Rick

Hi wfirth2012

Base on your configuration do the follow commands under interface vlan20:

interface vlan 20
name users
ip address 192.168.1.1 255.255.255.0

ip helper-address (DHCP ip address) 

# DHCP server, ip address has to be in the subnet of vlan 20, if the IP address of DHCP server is in the same subnet with the users you don't need a dhcp ip helper-address )

# remove this comment it will not help " ip helper-address 192.168.1.20 255.255.255.255 37 42 49 53 137 138"

no ip helper-address 192.168.1.20 255.255.255.255 37 42 49 53 137 138

Let me know if that helped.