LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-11-2009, 11:06 AM   #1
andrews-mark
Member
 
Registered: Feb 2007
Location: London
Distribution: debian
Posts: 108

Rep: Reputation: 15
dhcpd.conf configuration and internet access


Hello,
I have a ubuntu machine with two NICs. This has internet access through one NIC. The other is connected to a switch to which other machines connect. I have set up this machine to be a dhcp server and serve out local IPs to the connecting clients. I have successfully done this so that any machine connecting up to the switch gets an IP address (e.g. 192.168.0.2). This allows the client to connect to the host. However, these clients can not get on to the internet. In other words, they are limited to communication with the machines on a LAN. I presume that I have not the written the dhcpd.conf properly.

Here is my dhcpd.conf on the host
Code:
ddns-update-style none;

default-lease-time 259200;
max-lease-time 5184000;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;
option routers 192.168.0.1;

subnet 192.168.0.0 netmask 255.255.255.0 {
  group {
  host amfortas{
        hardware ethernet 00:1d:60:e2:61:1a; 
        fixed-address 192.168.0.2;
  }
  host lohengrin{
        hardware ethernet 00:1F:D0:21:3C:66;
        fixed-address 192.168.0.3;
  }
  }
}
and here is /etc/network/interfaces on lohengrin (a client)
Code:
auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp
As I said, lohengrin can get an IP and can then ssh to and from the host. However, if I try to do something like "ssh 82.71.38.83" from lohengrin it does nothing (no errors messages, just hangs there until I control+c it), while I can successfully ssh into 82.71.38.83 from the host machine.

I presume there is something small that I am stupidly missing. Can anyone see what I have done wrong and how I could fix it?

-mark
 
Old 08-11-2009, 11:28 AM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
We can get more information if you post the output of ifconfig of one of the dhcp-clients.

Markus

Last edited by markush; 08-12-2009 at 02:46 AM.
 
Old 08-11-2009, 05:43 PM   #3
andrews-mark
Member
 
Registered: Feb 2007
Location: London
Distribution: debian
Posts: 108

Original Poster
Rep: Reputation: 15
Dear Markus,

Thanks for your offer of help. I don't have any command called "ifconf":

Code:
andrews@ssh.lohengrin ~> ifconf
-bash: ifconf: command not found
andrews@ssh.lohengrin ~> sudo ifconf
sudo: ifconf: command not found
but I have "ifconfig" and here is the output from "lohengrin"

Code:
andrews@ssh.lohengrin ~> ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:1f:d0:21:3c:66  
          inet addr:192.168.0.3  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::21f:d0ff:fe21:3c66/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:421774 errors:0 dropped:25396230342 overruns:0 frame:0
          TX packets:334552 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:156199763 (148.9 MB)  TX bytes:62962480 (60.0 MB)
          Interrupt:249 Base address:0x4000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:11700 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11700 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:807420 (788.4 KB)  TX bytes:807420 (788.4 KB)
For comparison, here is "ifconfig" on wotan (the dhcp server and host):
Code:
andrews@ssh.wotan ~> ifconfig
eth0      Link encap:Ethernet  HWaddr 00:16:e6:dd:ae:0c  
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::216:e6ff:fedd:ae0c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:336452 errors:0 dropped:0 overruns:0 frame:0
          TX packets:259489 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:22030669 (21.0 MB)  TX bytes:922941417 (880.1 MB)
          Interrupt:16 

eth1      Link encap:Ethernet  HWaddr 00:18:4d:ea:77:52  
          inet addr:128.40.26.160  Bcast:128.40.26.255  Mask:255.255.255.0
          inet6 addr: fe80::218:4dff:feea:7752/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20344104 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12455605 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3975717650 (3.7 GB)  TX bytes:15290659227 (14.2 GB)
          Interrupt:19 Base address:0x4000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:6369 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6369 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:504066 (492.2 KB)  TX bytes:504066 (492.2 KB)
 
Old 08-12-2009, 03:00 AM   #4
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Sorry, I meant ifconfig (as you stated).

I did still not understand how exactly your connection to the internet should work. If It is a ppp-connection there would b a 32bit mask (255.255.255.255) for eth1 on wotan. but I don't know.

Since the connection between the computers on your local lan works there dhcp should be properly.

What about the routes (between the two nics), what I mean is that this machine with the two nics should function as a router.

Markus
 
Old 08-12-2009, 03:45 AM   #5
andrews-mark
Member
 
Registered: Feb 2007
Location: London
Distribution: debian
Posts: 108

Original Poster
Rep: Reputation: 15
Markus,
Thanks for the reply again.
From what you said, it may be that the dhcp server config is not the issue, but rather I do not have the host set up properly to route between the two NICs. That makes sense, and I will look into it.
-m
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Installing dhcpd on a Linux machine without internet access Latitude Linux - Newbie 1 06-02-2009 02:09 PM
How to re-invoke dhcpd after changes were made to dhcpd.conf file. Azazwa Linux - Newbie 3 03-30-2009 04:44 AM
dhcpd internet access problem matux Linux - Server 2 06-14-2007 06:09 AM
dhcpd.conf multiple subnet / single physical network configuration kovert Linux - Server 0 09-02-2006 01:14 AM
dhcpd.conf configuration mcrosby Linux - Networking 2 07-28-2006 02:45 PM

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

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