LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   dhcpd.conf and 2nd NIC problem (https://www.linuxquestions.org/questions/linux-networking-3/dhcpd-conf-and-2nd-nic-problem-70358/)

KowCiller 07-05-2003 05:37 PM

dhcpd.conf and 2nd NIC problem
 
Hello all!

Please excuse my newbieness when it comes to Linux, but I'll get right to the point.

What I would like: Home network with my Redhat Linux 7.3 box as the server. Handing out IPs to my other computers and sharing the internet connection obtained from my cable modem.

Where I'm at now:
eth0 = NIC that obtains an IP from my cable modem
eth1 = NIC that should hand out ips through dhcp

I have successfully set up my eth0 network card to accept dhcp ips from my cable provider, so i'm online! :cool:

Previously (before the internet conneciton was present), I successfully got my Linux box to hand out IPs to my other computers :cool:

THE BAD PART NOW:

Now that I have the internet connection up, when i try to start DHCP so other computers can get an IP address, I get this msg:

"No subnet declaration for eth0" It then tells me to add eth0 to my dhcpd.conf.

What do syntax do I need to add eth0 to my dhcpd.conf ? Remember, eth0 gets it's IP address from my cable modem... not eth1 that hands out IPs to my other computers...

Sorry for long post! Thanks a ton in advance!!

Aaron (KowCiller)

andrew001 07-05-2003 06:24 PM

I don't know why you're getting that error, but just so you know, you're also going to have to set up Network Address Translation or NAT so that the machines can share the linux boxes' connection.

One thing that I can think of that would explain why you're getting the error is you're starting dhcpd incorrectly. You need to do '/usr/sbin/dhcpd eth1' not just '/usr/sbin/dhcpd'.

Good luck,
Andrew

KowCiller 07-05-2003 06:42 PM

Andrew,

Thanks so much for the help!

By starting dhcp through the command you gave (/usr/sbin/dhcpd eth1) it seems to work.

Before I was attempting to use this command: /sbin/service dhcpd start

What is the difference between the two commands?

I'll start looking at how to set up the NAT now...

Thanks,

Aaron (KowCiller)

cyph3r7 07-05-2003 07:59 PM

Yup you need to modify your rc init file to start the service on eth1 and you will be golden. Second IP forwarding will need to be turned on to get the internal traffic routed out. Add it to a rc init file also.....

andrew001 07-05-2003 08:01 PM

Great, I'm glad it worked out for you!

The only difference is that if you don't specify it will try and run dhcpd on all of the network interfaces. By passing it 'eth1', you told it to only run it on one. You were getting the error because eth1 was already using the dhcp client to get its ip address from your isp.

For NAT, you'll be able to find plenty of previous posts here on linux questions. You can do it yourself by using iptables, or use one of the many automatic firewall tools such as firestarter.

~Andrew


All times are GMT -5. The time now is 04:05 AM.