LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 02-13-2009, 10:23 AM   #1
xtremeclones
Member
 
Registered: Jan 2006
Posts: 70

Rep: Reputation: 15
DHCP on CentOs 5.2 with 2 NICs Help


Hi guys.

im running Centos 5.2 with dual nics, and cant get dicpd to start.

here is my ifconfig.

Code:
eth1      Link encap:Ethernet  HWaddr 00:11:43:5A:61:47
          inet addr:175.9.159.40  Bcast:175.9.159.47  Mask:255.255.255.240
          inet6 addr: fe80::211:43ff:fe5a:6147/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:70072 errors:0 dropped:0 overruns:0 frame:0
          TX packets:60326 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7542665 (7.1 MiB)  TX bytes:8727357 (8.3 MiB)
          Interrupt:193

eth2      Link encap:Ethernet  HWaddr 00:04:23:B3:AF:9C
          inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::204:23ff:feb3:af9c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:23983 errors:0 dropped:0 overruns:0 frame:0
          TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:8921931 (8.5 MiB)  TX bytes:12305 (12.0 KiB)
          Base address:0xccc0 Memory:fcda0000-fcdc0000

the eth1 goes to my router, then i want eth2 to go to the switch where the dhcp clients will connect to.

dhcpd.conf is:


Code:
subnet 192.168.1.100 netmask 255.255.255.0 {
range 192.168.1.101 192.168.1.253;
default-lease-time 43200;
max-lease-time 86400;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.100;
option domain-name-servers 68.87.74.162, 68.87.68.162;
option domain-name "candela.com";
var/log/messages shows:
Code:
Feb 13 11:13:09 candela dhcpd: /etc/dhcpd.conf line 3: subnet 192.168.1.100 netmask 255.255.255.0: bad subnet number/mask combination.
Feb 13 11:13:09 candela dhcpd: subnet 192.168.1.100 netmask 255.255.255.0


any help will greatly be appreciated.

thanks!

Last edited by xtremeclones; 02-13-2009 at 10:40 AM.
 
Old 02-13-2009, 12:37 PM   #2
JulianTosh
Member
 
Registered: Sep 2007
Location: Las Vegas, NV
Distribution: Fedora / CentOS
Posts: 674
Blog Entries: 3

Rep: Reputation: 90
In dhcpd.conf, change:
subnet 192.168.1.100 netmask 255.255.255.0 {
to:
subnet 192.168.1.0 netmask 255.255.255.0 {
 
Old 02-25-2009, 03:51 PM   #3
xtremeclones
Member
 
Registered: Jan 2006
Posts: 70

Original Poster
Rep: Reputation: 15
IT works!

Just got back from trip and intered what Captn recommended.

this worked well now whatever i put on that switch gets the IP correctly.

the issue i have now is that the systems cant reach the outside network, meaning i have no internet.

i did from an windows system an ipconfig /all and the system has a valid 192.168 IP along with the correct DNS, but it cant ping an external ip or yahoo.com.

i also tried disabling the firewall and still nothing happened.

what am i missing?

thanks.
 
Old 02-25-2009, 04:32 PM   #4
JulianTosh
Member
 
Registered: Sep 2007
Location: Las Vegas, NV
Distribution: Fedora / CentOS
Posts: 674
Blog Entries: 3

Rep: Reputation: 90
make sure the firewall is routing packets:

as root:

echo 1 > /proc/sys/net/ipv4/ip_forward

make sure you have a NAT rule in iptables to do the network address translation. something like:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

(you might have to do some research on this last one as it's off the top of my head) I'll check back later to see the results and help more if needed.
 
Old 02-25-2009, 04:32 PM   #5
JulianTosh
Member
 
Registered: Sep 2007
Location: Las Vegas, NV
Distribution: Fedora / CentOS
Posts: 674
Blog Entries: 3

Rep: Reputation: 90
oh, and it's admiral, not captain. LOL
 
Old 02-25-2009, 05:53 PM   #6
xtremeclones
Member
 
Registered: Jan 2006
Posts: 70

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Admiral Beotch View Post
oh, and it's admiral, not captain. LOL


LOL sorry Admiral.

ill try that in the iptables.
 
Old 02-25-2009, 06:04 PM   #7
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
FWIW, CentOS doesn't require a manual entry in /proc/sys/net/ipv4/ip_forward, but uses the method described here http://wiki.centos.org/TipsAndTricks/IPForwarding.

The former method still works (and is what I use on my boxes in fact), but I thought I'd let you know.
 
Old 02-25-2009, 06:06 PM   #8
JulianTosh
Member
 
Registered: Sep 2007
Location: Las Vegas, NV
Distribution: Fedora / CentOS
Posts: 674
Blog Entries: 3

Rep: Reputation: 90
g2k, thanks!
 
  


Reply



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
DHCP across 2 NICS? Daveddd Linux - Server 2 11-15-2007 12:05 PM
DHCP on two nics mgichoga Linux - Server 1 07-03-2007 10:00 AM
DHCP server with two NICs Infernal211283 Linux - Networking 2 02-14-2005 03:51 PM
dhcp and 2 nics mikz Linux - Networking 3 01-27-2005 03:38 PM
Slackware 8.1 - Two NICs and DHCP Gn0me Linux - Networking 5 05-15-2003 03:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:18 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
Open Source Consulting | Domain Registration