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
 
Search this Thread
Old 03-31-2006, 02:14 PM   #1
terp4life2001
LQ Newbie
 
Registered: Dec 2005
Posts: 26

Rep: Reputation: 15
dhcpd.conf for 2 NICS (PXE)


Hello everyone,

I currently have a computer which I run a dhcp and dns server on. It serves my home network and does a pretty good job of it. What I want to do is extend this servers functionality so that I can PXE boot of it's second NIC. I think that I will use a cross-over cable to connect the target system with the PXE server. Also, I'm attempting statically assigned dhcp, so the ifcfg-ethX files use dhcp but the dhcpd assigns static addresses. I'm slightly confused about a few things.

1) I think that I want two subnets, one for each NIC. I.e. 192.168.1.x for the general purpose home network and 192.168.3.x for the PXE server and client. The only reason that I'd can think to do this is just for organization, so that when a client has a 192.168.3.x IP I know he's connected to the correct NIC. Does this sound right?

2) Frankly I'm confused about the syntax of the dhcpd.conf file and how I associate a subnet with a NIC. I thought that using the MAC address I'd be able to force a NIC into a certian subnet but I must be missing something. I would think that without the PXE NIC connected to anything it should be able to give itself an address. However, I know that NICs broadcast the dhcp request, so maybe if the NIC isn't connected it can't broadcast correctly. Here is my dhcpd.conf and ifcfg-eth0, when I restart the eth0 interface it doesn't get an IP. Am I doing something obviously wrong?

[rwlove@LOVE_file ~]$ cat /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;

subnet 192.168.1.0 netmask 255.255.255.0 {

# --- default gateway
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option ip-forwarding off;

# option nis-domain "LOVESHACK.org";
option domain-name "LOVESHACK.org";
option domain-name-servers 192.168.1.201;

# option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
option netbios-name-servers 192.168.1.201;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;

range dynamic-bootp 192.168.1.200 192.168.1.254;
default-lease-time 21600;
max-lease-time 43200;

# we want the nameserver to appear at a fixed address
# gigabit nic interface
host LOVE_file {
hardware ethernet 00:0E:0C:65:1E:18;
fixed-address 192.168.1.201;
option host-name "LOVE_file.LOVESHACK.org";
}

# Eth0 interface
# hardware ethernet 00:07:E9:EF:7C:8B;

host MythTVClient {
hardware ethernet 00:50:70:26:4F:9E;
fixed-address 192.168.1.202;
}

host LOVE_media {
hardware ethernet 00:11:95:B9:279;
fixed-address 192.168.1.203;
}

host LOVE_mobile {
hardware ethernet 00:90:4B:12:31:26;
fixed-address 192.168.1.204;
}

host PictureFrame {
hardware ethernet 00:03:47:B4:7F:5F;
fixed-address 192.168.1.205;
}

host TrueMobile2300 {
hardware ethernet 00:90:4b:35:29:9a;
hardware ethernet 00:90:4b:35:29:9b;
fixed-address 192.168.1.206;
}
}


subnet 192.168.3.0 netmask 255.255.255.0 {

allow booting;
allow bootp;

range dynamic-bootp 192.168.3.0 192.168.3.10;

# --- default gateway
option routers 192.168.3.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.3.255;
option ip-forwarding off;

# option nis-domain "LOVESHACK.org";
option domain-name "LOVESHACK.org";
option domain-name-servers 192.168.3.1;

# option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
option netbios-name-servers 192.168.3.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;

range dynamic-bootp 192.168.3.1 192.168.3.10;
default-lease-time 21600;
max-lease-time 43200;

option domain-name "LOVESHACK.org";

host PXEServer {
hardware ethernet 00:07:E9:EF:7C:8B;
fixed-address 192.168.3.1;
option host-name "PXEServer";

}

filename "pxelinux.0";

}


[root@LOVE_file ~]# ifconfig eth0 down ; ifconfig eth0 up
[root@LOVE_file ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:07:E9:EF:7C:8B
inet6 addr: fe80::207:e9ff:feef:7c8b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:306 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:63670 (62.1 KiB) TX bytes:896 (896.0 b)

eth1 Link encap:Ethernet HWaddr 00:0E:0C:65:1E:18
inet addr:192.168.1.201 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20e:cff:fe65:1e18/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:108255131 errors:3 dropped:0 overruns:0 frame:2
TX packets:116303168 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2564484497 (2.3 GiB) TX bytes:527943314 (503.4 MiB)
Base address:0xdf00 Memory:feac0000-feae0000

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:48028027 errors:0 dropped:0 overruns:0 frame:0
TX packets:48028027 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:911761205 (869.5 MiB) TX bytes:911761205 (869.5 MiB)


Thanks in advance!!

//Rob
 
Old 04-01-2006, 06:44 PM   #2
michaelsanford
Member
 
Registered: Feb 2005
Location: Ottawa/Montréal
Distribution: Slackware + Darwin (MacOS X)
Posts: 468

Rep: Reputation: 30
"Frankly I'm confused about the syntax of the dhcpd.conf file and how I associate a subnet with a NIC. I thought that using the MAC address I'd be able to force a NIC into a certian subnet but I must be missing something."

I had the same problem a while back (when I started working at an ISP actually). You included a lot of info, so I'll try to help you address problems one at a time, starting with that one (above).

I will assume that you actually have three NICs, eth0, eth1 and eth2 (one of which is used to connect to the internet, the other two for routing). When you bring up an interface you will specify its IP address if it is not asking for a DHCP lease from somewhere else (which it's not since YOU are the DHCP server).

eth0 192.168.1.1 netmask 255.255.255.0 up
eth1 192.168.3.1 netmask 255.255.255.0 up

When you run `dhcpd' it will automatically bind to the interfaces whose netmasks and IP addresses match an antry in dhcpd.conf. So, dhcpd will listen for 192.168.1.X DHCP_REQs on eth0.

Try dealing with that and then we'll see.

Herer's a small section of mine, I'll explain what it means below:
Code:
####
# eth1
subnet 10.0.0.0 netmask 255.255.0.0 {
        option routers 10.0.0.1;
        option ip-forwarding on;
        option domain-name-servers 206.47.244.13, 206.47.244.60;

        host airport {
                hardware ethernet 00:11:24:06:53:ca;
                fixed-address 10.0.0.2;
        }
}
As you can see I assign a netmask of 255.255.0.0 on the subnet of 10.0.0.0. This means that dhcpd will assign addresses from 10.0.0.2 - 10.0.1.254 on that interface and that all machines in that range can see each other. You can stick in whatever static-ip mappings you want.

So unless you have a physical reason to split it into two NICs you can, but you may not need to...

Overwhelmed yet :P
 
  


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
dhcpd subnet declaration problems in dhcpd.conf vcrispo Linux - Networking 6 07-15-2005 11:32 AM
Dhcpd two IP ranges via two nics rvjaarsveld Linux - Networking 10 10-14-2004 09:29 AM
dhcpd.conf with 2 NICS TheRealDeal Linux - General 1 11-19-2003 04:23 PM
need help with dhcpd.conf file running two nics hwb0014 Linux - Networking 4 08-28-2002 12:47 PM
dhcpd.master or dhcpd.conf rickg Linux - Networking 0 04-11-2002 04:34 PM


All times are GMT -5. The time now is 04:10 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration