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-06-2004, 07:22 PM   #1
Usalabs
Member
 
Registered: Jan 2004
Distribution: OpenSUSE 42.1 Server
Posts: 158

Rep: Reputation: 15
Problem setting up DHCP.


After looking through the Linux->Networking forum, there is nothing to explain (in step by step instruction) on how to setup my Linux (RH9) machine to auto assign IP addresses such as 192.168.0.1.....2......3..... etc. to other windows machines connected to the network.

The windows machines do work with windows XP as the server with ICS (Internet Connection Sharing), but I'm trying to see how Linux stands up against windows for security. I can switch between XP and Linux, quite easily.

There are posts in the forum to say to type this and that and add this and that to whatever, but I would like to have a step by step instruction starting from as if Linux had just been installed, with the KDE desktop running, and nothing else added, and ending with a working network, with ICS and file sharing on the Linux server, and still be able to access the internet from the Linux server (all this can be setup in XP withn 5 minutes).

Everybody is referring to the /etc/dhcp.conf and /etc/dhcp.releases files but what do I do to the network configuration?, DNS? HOST? etc,etc. because when Linux boots it gets to the point where it open the network interface, then fails with something like 'Unable to determin IP address, no connection, check cable' then continues to the KDE desktop.

If someone can provide a step by step instruction based on a working model, it would be much appreciated, as ip addresses 192.168.0.1......2......3...... etc are common ip address for home networking, there shouldn't be any problem using a working model.
 
Old 02-07-2004, 05:33 AM   #2
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
Re: Problem setting up DHCP.

Quote:
Originally posted by Usalabs

Everybody is referring to the /etc/dhcp.conf and /etc/dhcp.releases files but what do I do to the network configuration?, DNS? HOST? etc,etc. because when Linux boots it gets to the point where it open the network interface, then fails with something like 'Unable to determine IP address, no connection, check cable' then continues to the KDE desktop.

If someone can provide a step by step instruction based on a working model, it would be much appreciated, as ip addresses 192.168.0.1......2......3...... etc are common ip address for home networking, there shouldn't be any problem using a working model.
/etc/dcph.conf holds the main configuration of your DCHP server including which addresses to hand out to computers asking.
A working configuration might look like this:

subnet 192.168.0.0 netmask 255.255.255.0
{
option broadcast-address 192.168.0.255;
deny bootp;
option domain-name "
your-domain.com";
option domain-name-servers 192.168.0.1;
default-lease-time 86400;
max-lease-time 604800;

option subnet-mask 255.255.255.0;
range 192.168.0.65 192.168.0.250;
option routers 192.168.0.1;
}


option domain-name-servers tell your clients which DNS server to use, in this case it tell them to use the router (the linux machine) as DNS server. You could echange this for your ISP's DNS servers if you donät have a caching DNS server on your linux machine.

range tell the server which addresses to hand out.
option routers tell the clients which default gateway to use.

Now all you have to do is configure your clients for dynamic IP addresses.

The error you get while starting your linux box is due to that the linux box tries to get a dynamic IP address but fails. Are your ISP handing out dynamic IP's or do you have a static?
 
Old 02-07-2004, 06:46 AM   #3
Usalabs
Member
 
Registered: Jan 2004
Distribution: OpenSUSE 42.1 Server
Posts: 158

Original Poster
Rep: Reputation: 15
I'm using an internal modem to dial to my ISP, whom issues a dynamic address.

To write this reply, I'm using the linux box. What I would like is the Linux box to issue IP addresses to windows boxes connected to a LAN, without disturbing the dial-up, so that the windows boxe(s) can share that dial-up connection.

I tried a configuration similar to the one you posted, but it keeps saying to add 'ddns-update-style ad-hoc;' to the beginning of the file.

Last edited by Usalabs; 02-07-2004 at 06:50 AM.
 
Old 02-07-2004, 07:06 AM   #4
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
That's right you need that line for newer versions of DHCP server.
Also you will have to enable ip forwarding to enable your LAN clients access to internet.
run echo '1' > /proc/sys/net/ipv4/ip_forward
this will enable ip forwarding for this session. to make it last you will have to edit the file /etc/sysctl.conf and add the following line
net.ipv4.ip_forward = 1
Last step is to configure IP Masquerading. Run:
iptables -t nat -I POSTROUTING -o ppp0 -j MASQUERADE
Change the ppp0 to the device name your modem has.
Not 100% on the iptables command.
 
Old 02-07-2004, 07:59 AM   #5
Usalabs
Member
 
Registered: Jan 2004
Distribution: OpenSUSE 42.1 Server
Posts: 158

Original Poster
Rep: Reputation: 15
I tried what you suggested, and also disabled the Linux firewall, (enabled now to use internet), I get the error 'not configured to listen on any devices' when I start the DHCP server with DHCPD -f at the root shell, and it's still looking for an IP address at bootup, when it tries to open the eth0 interface.

I also tried changing the settings in the network configuration, using the RH net config program, from 'automatically obtain IP address settings from (pulldown box) DHCP, to 'statically set IP address' and entered these addresses:-

Manual IP address settting:-
Address=192.168.0.0
Subnet mask=255.255.255.0
Default Gateway Address=192.168.0.1

then I saved the config, then enabled the interface, then issued (from the root) dhcpd -f and this is the displayed results:-

Internet Software Consortium DHCP Server V3.0pl1
Copyright 1995-2001 Internet Software Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP
Wrote 0 leases to leases file.
Listening on LPF/eth0/00:20:18:d5:80:a7/192.168.1.0/24
Sending on LPF/eth0/00:20:18:d5:80:a7/192.168.1.0/24
Sending on Socket/fallback/fallback-net

then after turning on one of the windows machines, and tried ping 192.168.0.1 I get 'Host unreachable' I then tried ping 127.0.0.1 this worked ok on both machines.

There's something wrong somewhere, and I just can't figure it out.

Last edited by Usalabs; 02-07-2004 at 09:41 AM.
 
Old 02-07-2004, 09:36 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
i presume you realised that "/etc/dcph.conf" was a typo make sure it's "/etc/dhcpd.conf". there are some slight differences in standards, but dhcpd.conf is that most standard config file name
 
Old 02-09-2004, 07:25 AM   #7
Usalabs
Member
 
Registered: Jan 2004
Distribution: OpenSUSE 42.1 Server
Posts: 158

Original Poster
Rep: Reputation: 15
I have succesfully setup the DHCP server and by using samba, I can share files between computers.

Thanks everyone.
 
  


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
setting up dhcp abunsair Debian 1 07-11-2005 09:31 AM
Setting up DHCP Baix Linux From Scratch 1 06-19-2005 11:52 PM
DHCP or general networking problem and setting half-duplex.. this is a tuffy xmnemonic Linux - Networking 5 09-09-2003 07:40 PM
setting up dhcp toddmvc Linux - Networking 2 08-20-2003 12:36 PM
Setting up a DHCP Server bselzler Linux - Networking 2 08-07-2001 04:28 AM

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

All times are GMT -5. The time now is 08:36 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