LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-28-2013, 12:11 PM   #1
pablobhz
LQ Newbie
 
Registered: Aug 2012
Posts: 7

Rep: Reputation: Disabled
Lightbulb Two DHCP ranges in one DHCP server using one NIC on a MPLS network - centos6 6.3 x64


Hello boys.

I've searched around the forum and got some clues about what i'm doing - but i'm still not having any success.

As my topic's title describes, i want to serve dhcp for two networks - connected trough an MPLS link using only one NIC.

They're on the same subnet (255.255.255.) and only the range is different(network A is 192.168.1.0 , network B 192.168.2.).

I think i've built my dhcpd.conf right but the other network (192.168.2.0) can't get any ip address. I'm on the network 192.168.1.0 and i can get ip from my dhcp server without problems.

I'm posting my dhcpd.conf here - if anyone finds out there's something wrong just tell me.
Thanks in advance

Pablo

***
dhcpd.conf
***
Code:
deny-unknown-clients;
ddns-update-style interim;
default-lease-time 86400;
max-lease-time 345600;

        subnet 192.168.3.0 netmask 255.255.255.0{} 
# Pharmascience Betim e SJL
shared-network Pharmascience {

        ###################################
        #Range Pharmascience - Betim      #
        ###################################
        subnet 192.168.1.0 netmask 255.255.255.0{

        range  192.168.1.1 192.168.1.254;
        option routers 192.168.1.238;
        option domain-name "pharma-bet.intranet";
        option ip-forwarding off;
        option broadcast-address 192.168.1.255;
        option subnet-mask 255.255.255.0;
        option ntp-servers 192.168.1.247;
        option domain-name-servers 192.168.1.253;
        option domain-name-servers 192.168.1.254;

                host TI002 {
                hardware ethernet 00:1C:C0:6E:2E:13;
               fixed-address 192.168.1.236;
                        }
                                                }


        ###################################
        #Range Pharmascience -  SJL       #
        ###################################

        subnet 192.168.2.0 netmask 255.255.255.0{

        range  192.168.2.1 192.168.2.254;
        option routers 192.168.2.254;
        option domain-name "pharma-sjl.intranet";
        option ip-forwarding off;
        option broadcast-address 192.168.2.255;
        option subnet-mask 255.255.255.0;
        option ntp-servers 192.168.1.247;
        option domain-name-servers 192.168.2.253;

                host TI005 {
             hardware ethernet 00:1B:11:04:BC:56;
             fixed-address 192.168.2.210;
                        }
                                                }
                }
Those two fixed hosts are for testing purposes - each one is on a network.
 
Old 02-28-2013, 09:16 PM   #2
TJNII
LQ Newbie
 
Registered: Aug 2011
Distribution: Gentoo, Debian, RHEL
Posts: 12

Rep: Reputation: Disabled
Does Linux see the subnets as separate at L2? So when it receives a broadcast packet it knows which vlan (or equivalent for MPLS - never used that) the packet came from?

Please post the output of "ifconfig -a"
 
Old 03-01-2013, 05:49 AM   #3
pablobhz
LQ Newbie
 
Registered: Aug 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
There it goes
Code:
[root@icebird dhcp]# ifconfig -a
em1       Link encap:Ethernet  HWaddr D4:AE:52:85:14:BC
          inet addr:192.168.1.247  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::d6ae:52ff:fe85:14bc/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:84532101 errors:0 dropped:0 overruns:0 frame:0
          TX packets:84246302 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:54587451244 (50.8 GiB)  TX bytes:70359471322 (65.5 GiB)
          Interrupt:36 Memory:da000000-da012800

em2       Link encap:Ethernet  HWaddr D4:AE:52:85:14:BD
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:48 Memory:dc000000-dc012800

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:38737 errors:0 dropped:0 overruns:0 frame:0
          TX packets:38737 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:5117589 (4.8 MiB)  TX bytes:5117589 (4.8 MiB)
Also, i'm posting a part of dhcp log on /var/log/messages

Code:
Mar  1 07:45:11 localhost dhcpd: Internet Systems Consortium DHCP Server 4.1.1-P1
Mar  1 07:45:11 localhost dhcpd: Copyright 2004-2010 Internet Systems Consortium.
Mar  1 07:45:11 localhost dhcpd: All rights reserved.
Mar  1 07:45:11 localhost dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Mar  1 07:45:11 localhost dhcpd: WARNING: Host declarations are global.  They are not limited to the scope you declared them in.
Mar  1 07:45:11 localhost dhcpd: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Mar  1 07:45:11 localhost dhcpd: Wrote 0 deleted host decls to leases file.
Mar  1 07:45:11 localhost dhcpd: Wrote 0 new dynamic host decls to leases file.
Mar  1 07:45:11 localhost dhcpd: Wrote 0 leases to leases file.
Mar  1 07:45:11 localhost dhcpd: Listening on LPF/em1/d4:ae:52:85:14:bc/Pharmascience
Mar  1 07:45:11 localhost dhcpd: Sending on   LPF/em1/d4:ae:52:85:14:bc/Pharmascience
Mar  1 07:45:11 localhost dhcpd: Sending on   Socket/fallback/fallback-net
Mar  1 07:45:29 localhost dhcpd: Unable to add forward map from ASR011.pharma-bet.intranet to 192.168.1.11: timed out
Mar  1 07:45:29 localhost dhcpd: DHCPREQUEST for 192.168.1.11 from 78:2b:cb:c3:44:65 via em1
Mar  1 07:45:29 localhost dhcpd: DHCPACK on 192.168.1.11 to 78:2b:cb:c3:44:65 (ASR011) via em1
Mar  1 07:45:35 localhost dhcpd: DHCPINFORM from 192.168.1.11 via em1: not authoritative for subnet 192.168.1.0
Mar  1 07:45:35 localhost dhcpd: If this DHCP server is authoritative for that subnet,
Mar  1 07:45:35 localhost dhcpd: please write an `authoritative;' directive either in the
Mar  1 07:45:35 localhost dhcpd: subnet declaration or in some scope that encloses the
Mar  1 07:45:35 localhost dhcpd: subnet declaration - for example, write it at the top
Mar  1 07:45:35 localhost dhcpd: of the dhcpd.conf file.
Also, i didn't understood your question man.
I dont think linux see those networks as separates ones - since there is only one connected interface.
 
Old 03-01-2013, 06:10 AM   #4
leigh8904
LQ Newbie
 
Registered: Nov 2012
Location: Melbourne, Australia
Distribution: Slackware + FreeBSD
Posts: 10

Rep: Reputation: Disabled
The first question: how are dhcp requests getting to your host (in 192.168.1.0 network) from 192.168.2.0 network? You need to configure a router to forward them, and include the router's IP address. See "Using a Single DHCP Server to Serve Multiple Networks" at: http://www.linuxhomenetworking.com/w...he_DHCP_Server for some more details.
 
Old 03-01-2013, 06:21 AM   #5
pablobhz
LQ Newbie
 
Registered: Aug 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Allright - i think i got it.
Only one question

Do i need another DHCP server on the other network or the ip-helper will only forward and clients there will listen ?

Thanks in advance !
 
Old 03-01-2013, 08:39 AM   #6
pablobhz
LQ Newbie
 
Registered: Aug 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
My current scenario is:

Local -> Microtik router -> MPLS LINK <- Microtik Router <- Another Network

Wich one has to be the ip helper ?
 
Old 03-01-2013, 05:40 PM   #7
leigh8904
LQ Newbie
 
Registered: Nov 2012
Location: Melbourne, Australia
Distribution: Slackware + FreeBSD
Posts: 10

Rep: Reputation: Disabled
Quote:
Originally Posted by pablobhz View Post
My current scenario is:

Local -> Microtik router -> MPLS LINK <- Microtik Router <- Another Network

Wich one has to be the ip helper ?
I think the router connected to "Another Network" (assuming DHCP server is connected to Local network).

Also, I don't think the shared-network configuration in your dhcpd.conf is appropriate, as shared-network applies to "physical networks on which more than one IP subnet operates"; see man dhcpd.conf for more details. Am I correct in assuming you have 2 physical networks?

Disclaimer: I am no expert in this area.
 
Old 03-04-2013, 05:22 PM   #8
Suncoast
Member
 
Registered: Apr 2009
Location: Largo, Florida
Distribution: Slackware
Posts: 208

Rep: Reputation: 35
Quote:
Originally Posted by pablobhz View Post
Allright - i think i got it.
Only one question

Do i need another DHCP server on the other network or the ip-helper will only forward and clients there will listen ?

Thanks in advance !
Just passing through today...
Yes, you need some device on the remote network to either be the DHCP server or you need a DHCP relay agent, which is less common thus typically more complicated. The WAN link (normally) does not transmit DHCP discover packets, so these packets will never reach your current server. Not familiar with Microtik routers, but the one on the remote end might have a DHCP ability.

And your EM2 interface is not appropriate for your configuration and should be shut. Seeing zero packets on a single virtual interface/sub interface when others are showing activity is usually a good sign an interface is not properly configured.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] how to specify what nic dhcp server should operate on? dave247 Linux - Networking 1 09-22-2011 02:23 AM
[SOLVED] network failing with BCM57788 - NIC not found, DHCP not functioning alex.t Debian 13 11-06-2010 02:24 PM
Exclude NIC from DHCP Server daveginorge Linux - Networking 2 05-28-2009 07:13 AM
Using 2 IP ranges on one DHCP server codenjanod Linux - Networking 2 10-29-2008 08:01 AM
DHCP Server and 2 NIC's NVETHIS Linux - Networking 4 07-10-2003 10:26 AM


All times are GMT -5. The time now is 06:49 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration