LinuxQuestions.org
Visit Jeremy's Blog.
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-23-2010, 12:24 AM   #1
Umanga
Member
 
Registered: Aug 2004
Location: Sri Lanka
Distribution: Debian Etch
Posts: 36

Rep: Reputation: 15
Question Newbie :DHCP server setup?


greetings friends,

I am new to linux administration and I want to setup a DHCP server in my Debian server.

This server has a global IP (61.108.45.101 ) and my dhcpd.conf is configured as follows:

Code:
ddns-update-style none;
option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 600;
max-lease-time 7200;

authoritative;

subnet 192.0.0.0 netmask 255.255.255.0 {
  range 192.0.0.1 192.0.0.254;
  option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
}
when I ran the 'dhcp' server it fails and the error in log is:

Quote:
Feb 23 15:22:23 biggjapan01 dhcpd: No subnet declaration for eth0 (61.108.45.101).
Feb 23 15:22:23 biggjapan01 dhcpd: ** Ignoring requests on eth0. If this is not what
Feb 23 15:22:23 biggjapan01 dhcpd: you want, please write a subnet declaration
Feb 23 15:22:23 biggjapan01 dhcpd: in your dhcpd.conf file for the network segment
Feb 23 15:22:23 biggjapan01 dhcpd: to which interface eth0 is attached. **
Feb 23 15:22:23 biggjapan01 dhcpd:
Feb 23 15:22:23 biggjapan01 dhcpd:
Feb 23 15:22:23 biggjapan01 dhcpd: Not configured to listen on any interfaces!
How can I configure DHCP for my lan ? I want the IP ranges 192.168.XXX.XXX ?


thanks in advance.
 
Old 02-23-2010, 03:02 AM   #2
Lexus45
Member
 
Registered: Jan 2010
Distribution: Debian, Centos, Ubuntu, Slackware
Posts: 361
Blog Entries: 3

Rep: Reputation: 48
First of all, you've written that you want to give 192.168.x.x addresses to your clients. But why do you have a strange subnet 192.0.0.0 netmask 255.255.255.0 parameter? You must write something like subnet 192.168.20.0 netmask 255.255.255.0 instead.

You may read this article to find some necessary parameters like INTERFACES="ethX" to understand, from what interface your computer must give the addresses to the local network.

And I insist on reading articles about private networks addressing
10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)

http://en.wikipedia.org/wiki/Private_network
http://tools.ietf.org/html/rfc1918

Last edited by Lexus45; 02-23-2010 at 03:06 AM.
 
1 members found this post helpful.
Old 02-24-2010, 12:12 AM   #3
Umanga
Member
 
Registered: Aug 2004
Location: Sri Lanka
Distribution: Debian Etch
Posts: 36

Original Poster
Rep: Reputation: 15
Thanks for the tips Lexus45,

But my server has only one networkcard.
Can I use single network card to connect the server to internet using global IP (eg: 61.203.12.32) and use as DHCP server which serve local IP ranges (192.168.XX.XX) ??

thanks

Quote:
Originally Posted by Lexus45 View Post
First of all, you've written that you want to give 192.168.x.x addresses to your clients. But why do you have a strange subnet 192.0.0.0 netmask 255.255.255.0 parameter? You must write something like subnet 192.168.20.0 netmask 255.255.255.0 instead.

You may read this article to find some necessary parameters like INTERFACES="ethX" to understand, from what interface your computer must give the addresses to the local network.

And I insist on reading articles about private networks addressing
10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)

http://en.wikipedia.org/wiki/Private_network
http://tools.ietf.org/html/rfc1918
 
Old 02-24-2010, 02:50 AM   #4
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
You cannot configure a DHCP server for a subnet which is not on one of your NIC's.

The IP address you mention (61.108.45.101) is a public IP address. I can't imagine that you want to give out addresses for that subnet, do you?

So you want to use 192.168.n.n on your local LAN, and your local LAN should pass thru this server to get to the Internet?

It can be done with just one network card if you give the card a second address:
Code:
ifconfig eth0:1 192.168.20.10 up
But then you'd still need a NAT router like iptables to route traffic from your local LAN to the internet.

Something like shorewall would do: http://www.shorewall.net/

Generally is it considered unsafe practice to have both internal and external network on just one interface they way I describe it. Invest the equivalent of US$ 19 for a second NIC. Give it the address 192.168.20.10. You DHCP server will work and you can route traffice to the internet trhu this box.

jlinkels
 
1 members found this post helpful.
  


Reply

Tags
dhcp3, switch



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
Trying to setup a DHCP server linuxnoob001 Linux - Newbie 21 05-11-2008 11:07 AM
Trying to setup a DHCP server cwwilson721 Slackware 2 02-09-2006 02:22 AM
manual setup for dhcp sever using redhat 7.0 for newbie Shaun Linux - Networking 1 06-07-2002 11:35 AM
Local DHCP Server Setup ddepuemd Linux - Newbie 1 05-16-2002 05:46 PM

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

All times are GMT -5. The time now is 03:42 PM.

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