Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've installed an isc-dhcp-server on Ubuntu 12.10 and I'm trying to setup a DHCP server on a head node for six worker computers in the local network. The head node itself is a DHCP client receiving the IP-address 192.168.20.1 (on eth0) from an other computer in the network.

IPv4 IP forwarding is enabled on the head node. In /etc/sysctl.conf the following line was added:

net.ipv4.ip_forward = 1

The following rules are set in /etc/rc.local:

/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables --table nat -A POSTROUTING -o eth0 -j MASQUERADE

Furthermore, INTERFACES="eth0" is set in /etc/default/isc-dhcp-server.

The dhcpd.conf file contains (for the moment only one worker computer is in the file):

ddns-update-style none;

default-lease-time 3600;
max-lease-time 7200;

authoritative;

subnet 192.168.20.0 netmask 255.255.255.0 {
  range 192.168.20.2 192.168.20.200
  host hostName {
    hardware ethernet macOfHost;
    fixed-address 192.168.20.20;
  }
  option subnet-mask 255.255.255.0;
  option broadcast-address 192.168.20.255;
  option routers 192.168.20.1;
}

The worker node effectively gets the IP address 192.168.20.20, but it has no internet connection. A ping to 192.168.20.1 is successful, as well as a ping to the computer that serves as a DHCP server for the head node (a ping to 192.168.1.1). The problem doesn't seem to have something to do with DNS as a ping to an IP-address (such as 8.8.4.4) fails.

Update

The network topology is as follows. There is switch connecting a computer (with internet access and running a DHCP server, IP address 192.168.1.1) and 7 other computers. One of these 7 computers gets an IP from the 192.168.1.1 computer. The IP it gets is 192.168.20.1 and the internet on that computer works fine. Now we have a DHCP server running on 192.168.20.1 in order to provide internet access to the other 6 computers, but that fails. They get IP addresses but have no internet access. We are not allowed to modify anything on the 192.168.1.1 node so it should be feasible to make internet work with this setup.

Does someone know what the problem could be?

share|improve this question
    
Crosspost of serverfault.com/questions/525671/… –  Dubu Jul 23 '13 at 16:22

2 Answers 2

up vote 1 down vote accepted

Everything is working now. It turned out to be a DNS problem; changing the option routers to option routers 192.168.1.1 fixed the issue. Pings must have been blocked somewhere in the network as responses never came through, but surfing in the browser to a specific IP-address was possible, which made me realise that DNS was the problem. Thanks everyone for your help.

share|improve this answer

Looks like eth0 is your internal interface. If that is the case, what is your external interface? On your "router" server, the external interface, not the internal one (which should forward the packets), needs to MASQUERADE.

share|improve this answer
    
There is only one interface (eth0) except for the loopback. –  user2611216 Jul 23 '13 at 16:08
1  
in that case, how do you get to the internet? the iptables rules indicate that you are forwarding your traffic to somewhere from the internal network, but with only one interface, there is nowhere to forward to. –  johnshen64 Jul 23 '13 at 16:10
    
The head node itself is a DHCP client of some other computer which is also in the local network. That other computer is connected to the internet. It looks something like this: 192.168.1.1 (Router and DHCP server) -> 192.168.20.1 (other local router and DHCP server) -> 192.168.20.20 (DHCP client) –  user2611216 Jul 23 '13 at 16:32
    
Does the 20.1 computer have internet access? Also, the 20.1 computer MUST have two interfaces, if you're connecting it to the router and to the 20.20 computer. –  trpt4him Jul 23 '13 at 16:46
    
The 20.1 computer has internet access. It has only one NIC however, everything is connected via a switch. –  user2611216 Jul 23 '13 at 16:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.