Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Nics

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a Linux Server running RH 7.2 I,m trying to set up a test network for myself to play around with linux. I've installed two NIC's into this machine. Eth0 has an I.P. that is on our company's network and Eth1 has an address that is going to be the private test network. I want this server to do DHCP for my test network.

I've tried to configure everything properly but obviously haven't when I try to start the dhcpd service I get the following error

"Listening on Socket/eth1/192.168.1.0
Sending on Socket/eth1/192.168.1.0
No subnet declaration for eth0 (xxx.xxx.0.45).
Please write a subnet declaration in your dhcpd.conf file for the network segment to which interface eth0 is attached.
exiting."

Any help would be appreciated.
Below I've included the pertinent files.

dhcp.conf:

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.20;
default-lease-time 604800;
max-lease-time 604800;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
option routers xxx.xxx.0.45;
}
###########################################################
My ifconfig looks like this:

eth0 Link encap:Ethernet HWaddr 00:03:6D:14:27:EB
inet addr:xxx.xxx.0.45 Bcast:xxx.xxx.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

eth1 Link encap:Ethernet HWaddr 00:04:5A:64:31:26
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MTU:1500 Metric:1

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
############################################################

My route table:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
xxx.xxx.0.0 * 255.255.0.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
############################################################

Thanks again.
 
Hi,

You need to have a line like this in dhcpd.conf if you have multiple nics :

server-identifier 192.168.1.1;

Its just saying where is the 'range' for the subnet attached to eth0 ?

Or you could add a 'dummy' entry for the eth0 subnet :

subnet x.x.0.0 netmask 255.255.0.0 {
}

Hope this helps
 
I tried the server-identifier and it didn't work for me but the dummy entry did. Thank You.

Now that I have the DHCP server running and giving private addresses I wanted to use the other nic as my gateway to the internet. I can hit the internet from the server itself but can't from a pc on the private network. How would I resolve this? eth0 nic XXX.XXX.0.45 uses the gateway xxx.xxx.0.251 on one side of the network. My route table is set up like this.

Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
xxx.xxx.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 xxx.xxx.0.251 0.0.0.0 UG 0 0 0 eth0

Is there anything that should be added or modified to get this to work?

TIA
Alain
 
I had the same problem earlier, and adjusted my /etc/rc.d/init.d/dhcpd file

start() {
# Start daemons.
echo -n $"Starting $prog: "
daemon /usr/sbin/dhcpd eth1 <<< === add eth1( usually does not have eth entry)
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcpd
return $RETVAL AV
tnedor@yahoo.com

Did this post help? Click below to let me know.
 
yeah, how about setting up routing and masquerading for your little internal net there? You haven't done that yet.

 
Would I need to set up both routing and masquerading?

As it stands now PC A has two NICs one eth0 is connected to the side of the network that uses a gateway to access the internet eth0 is handing out ip addresses as the dhcp server on a private network. PC B is getting a private ip address from the DHCP server but I can't ping the outside world. My route table and ifconfig are in the posts above.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top