LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 11-09-2005, 11:32 PM   #1
srikanthrao_d
Member
 
Registered: Oct 2005
Posts: 32

Rep: Reputation: 15
DHCP Sever Different VLAN


Hi

I have four VLANs on my network, i want maintain single DHCP server, how can i do that thing on single sever? is i need add vitual interface on the server? I need add too many LAN card on the server ? what are steps i need to do ?

Thanks,
Srikanth
 
Old 11-10-2005, 05:36 PM   #2
fr_laz
Member
 
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384

Rep: Reputation: 32
Hi,

if your IP addressing is correctly set (a subnet per vlan), then it's very easy.

in dhcpd.conf, you'll have a declaration of every subnet, with the range of IPs you want to "offer" in it.
i'm sorry i don't have a sample config file... i moved from france to ireland and my former flatmates inherited of the dhcp server

from man dhcpd.conf it should look like this:
Code:
subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.1 192.168.1.200;
    option routers 192.168.1.254;
  }
subnet 192.168.2.0 netmask 255.255.255.0 {
    range 192.168.2.1 192.168.2.200;
    option routers 192.168.2.254;
  }
of course, you can add all the options you want, either global or in the subnet declarations.
you need to have a subnet declaration for every IP subnet declared on your machine.

then you install support for vlan on your machine (vconfig), and the esaiest way should be to set up a 802.1q trunk port on your net interface:

Code:
vconfig add eth0.1 1 # associate eth0.1 (subinterface of eth0) to vlan 1
vconfig add eth0.2 2 # associate eth0.2 (subinterface of eth0) to vlan 2
ifconfig eth0 0.0.0.0 up # eth0 is up, but has no IP, cause we'll only use the vlans
ifconfig eth0.1 192.168.1.254 up # give an ip to this interface, it should match the dhcpd.conf subnets
ifconfig eth0.2 192.168.2.254 up # give an ip to this interface, it should match the dhcpd.conf subnets
restart dhcpd and, it should work (provided the switch you're plugged in is configured to allow you the access these vlans, ie you're on a trunk/802.1Q port)

when a client makes a dhcp request in vlan 1, eth0.1 will get it, and dhcpd.conf will know from which subnet it should give an IP according to the IP address configured on eth0.1.

Note 1: my exemple might be bad as some switches have special use for vlan 1...

Note 2: cool, but my vlans are routed, so my dhcp server cannot use all these IP addresses, it must be in a different vlan and subnet...
no prob, see dhcrelay which allows you to use the same config without using vlans on the dcp server... but the router that interconnects the vlan must be a dhcrelay (Linux box and cisco are no prob, i believe major vendors are ok as well)
 
Old 11-14-2005, 11:48 AM   #3
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 875

Rep: Reputation: 179Reputation: 179
You can connect your DHCP server to each vlan if you want, however if you are allready routing between the VLANs with a router or L3 switch, the all you need to do is enable your router or L3 switch to forward bootp requests to the DHCP server. Cisco call this "bootp helper", I think Nortel call it a "DHCP Relay", you'll normally find a similar function. This forwards DHCP broadcasts, which are basically extended bootp requests, to the unicast address of your DHCP server. It also source stamps the request so that the DHCP server knows which pool to assign from and where to return the response.
 
Old 11-17-2007, 11:11 PM   #4
hafeezisbad
LQ Newbie
 
Registered: Nov 2007
Posts: 10

Rep: Reputation: 0
hi i am memeber of linux,org

i am a linux user but i am facing a problem to setup a dhcp server on fedora for a vlan setup with layer 3 switch

my vlan 10 shuld be 192.168.10.x series ip
vlan 20 shuld be 192.168.20.x

vlan30 shuld be 192.168.30.x

its so easy with windows creating scopes but in linux , the service fails when i enter subnet

ddns-update-style interim;
dynamic-bootp-lease-length 86400;
max-lease-time 604800;
default-lease-time 604800;

subnet 192.168.10.0 netmask 255.255.255.0 {
option routers 192.168.10.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.10.255;
option nis-domain "xyz.net";
option domain-name "xyz.net";
option domain-name-servers 192.168.10.2;
option time-offset -18000;
authoritative;
option ntp-servers 192.168.10.2;
option netbios-name-servers 192.168.10.2;
option netbios-node-type 2;
range 192.168.10.50 192.168.10.220;
}

it works and when i try to create other subnets or scopes below ,, it fails to restart , i checked /var/log/messages ,, its says dhcp exited multiple subnet not supported i am using fedora 7

ddns-update-style interim;
dynamic-bootp-lease-length 86400;
max-lease-time 604800;
default-lease-time 604800;

subnet 192.168.10.0 netmask 255.255.255.0 {
option routers 192.168.10.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.10.255;
option nis-domain "xyz.net";
option domain-name "xyz.net";
option domain-name-servers 192.168.10.2;
option time-offset -18000;
authoritative;
option ntp-servers 192.168.10.2;
option netbios-name-servers 192.168.10.2;
option netbios-node-type 2;
range 192.168.10.50 192.168.10.220;
}
subnet 192.168.20.0 netmask 255.255.255.0 {
option routers 192.168.20.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.10.255;
option nis-domain "xyz.net";
option domain-name "xyz.net";
option domain-name-servers 192.168.10.2;
option time-offset -18000;
authoritative;
option ntp-servers 192.168.10.2;
option netbios-name-servers 192.168.10.2;
option netbios-node-type 2;
range 192.168.20.50 192.168.20.220;
}

plz help me with this problem , is linux not a good opeating system for dhcp server , when compared to windows2003

i am fan of linux but this is dissapointing me now ,

thanks in advance , try to suggest some solution
 
Old 04-28-2011, 10:43 AM   #5
rporro
LQ Newbie
 
Registered: Apr 2011
Distribution: Debian (now Squeeze)
Posts: 16

Rep: Reputation: 6
PROBLEMS DHCP debian lenny huawey L3

Hi every one, I have a problem in my network, it's that I have created a dhcp in debian lenny servicing 4 vlan my config is the one as fallow:

shared-network MI_EMPRESA{
next-server 172.16.30.10;
filename "VLDRMI13.BIN";
option domain-name-servers 172.16.30.22;
option domain-name "cubatel.cu";
subnet 172.16.30.0 netmask 255.255.255.0{
option routers 172.16.30.253;
}
subnet 172.16.31.0 netmask 255.255.255.0{
range 172.16.31.1 172.16.31.100;
option routers 172.16.31.253;
}
subnet 172.16.32.0 netmask 255.255.255.0{
range 172.16.32.1 172.16.32.100;
option routers 172.16.32.253;
}
subnet 172.16.33.0 netmask 255.255.255.0{
range 172.16.33.1 172.16.33.100;
option routers 172.16.33.253;
}
}

and the problem is that computers on the network 33.0 (and only this one)recieve ip's from others scopes and of course they don't have access to my network services.

Let my tell you that I have a switch huawey l3 and dhcp relay is confured and tested because previusly I had a WIN DHCP the one that is working now.

PLEASE I accept any suggestions and thank's every body

P.D. Sorry about my English wish is kind of rusty

Last edited by rporro; 04-28-2011 at 10:45 AM. Reason: private info released, sorry
 
Old 04-29-2011, 06:13 AM   #6
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 875

Rep: Reputation: 179Reputation: 179
Try using wireshark on the server, or tshark or tcpdump. Get a trace of the DHCP request. If the source of the request is set as 172.16.33.0 then the problem is likely internal to the server. If the source is still set as 0.0.0.0 then the problem is the L3 switch not source stamping the DHCP request.

The server relies on the source stamp to know which scope to assign from or typically it will assign from the first scope.
 
1 members found this post helpful.
Old 04-29-2011, 10:31 AM   #7
rporro
LQ Newbie
 
Registered: Apr 2011
Distribution: Debian (now Squeeze)
Posts: 16

Rep: Reputation: 6
thanks baldy I havent thought that and when I tried I realized that My switch L3 ask with the Vlan he likes, thank's again
 
Old 05-03-2011, 05:36 AM   #8
mark.
LQ Newbie
 
Registered: Apr 2009
Distribution: Centos,Fed,Ubuntu,Linpus
Posts: 3

Rep: Reputation: 1
Hi,

I have been working on a project like this over the last few days and found some of the help here useful.
But i also wanted to add something else for rporro:

You have used the shared network statement at the top of your config.
As i gather this pools all of your available IP's together and the server will issue IP's as it gets them from the pool.
I was finding a machine on any vlan that was requesting an IP was being given one from the last vlan IP pool as it hadn't been used up.

As soon as i removed the shared network statement the issue was resolved and each vlan machine got an IP from the correct pool.

Hope this helps someone now or in the future.
Mark
 
1 members found this post helpful.
Old 05-04-2011, 01:53 PM   #9
rporro
LQ Newbie
 
Registered: Apr 2011
Distribution: Debian (now Squeeze)
Posts: 16

Rep: Reputation: 6
Thanks mark for your opinion, I've tried that to and it did't work, now I'm trying to configure the VLANS variant on the begining of the page Them I will ask if there is anything that didn't work
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vlan switching fr_laz Linux - Networking 1 07-08-2005 10:49 PM
Vlan not sepparate collen Linux - Networking 0 06-08-2004 07:22 AM
Vlan Markvw Linux - Networking 1 09-29-2003 08:33 AM
Mandrake DHCP sever setup woas... AudioMechanic Linux - Networking 1 06-15-2003 07:54 PM
manual setup for dhcp sever using redhat 7.0 for newbie Shaun Linux - Networking 1 06-07-2002 11:35 AM


All times are GMT -5. The time now is 04:34 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration