1

I will host a LAN party next week where we will create am isolated LAN without internet connection. Since I do not want to set up static IPs on some 8 computers, I thought about setting up a DHCP server on my computer. I found that there is the dhcp3-server.

The problem probably is that the DHCP server then will run all the time, causing problems when I am in another network. How can I set it up so that I just fire it up at the LAN party?

I use Kubuntu with KDE, if that makes any difference.


Okay, I have the dhcp server installed, but it does not start up. I attached the output of some commands, configuration files

/etc/dhcp/dhcpd.conf

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;
log-facility local7;
subnet 192.168.100.0 netmask 255.255.255.0 {
  range 192.168.100.100 192.168.100.200;
}

/etc/default/isc-dhcp-server

INTERFACES="eth0"

ifconfig

eth0      Link encap:Ethernet  HWaddr f0:de:f1:de:a2:90  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:20 Memory:f2500000-f2520000 

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:2830 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2830 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:405626 (405.6 KB)  TX bytes:405626 (405.6 KB)

wlan0     Link encap:Ethernet  HWaddr 10:0b:a9:bf:e8:fc  
          inet addr:131.220.201.217  Bcast:131.220.207.255  Mask:255.255.248.0
          inet6 addr: fe80::120b:a9ff:febf:e8fc/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:43878 errors:0 dropped:0 overruns:0 frame:0
          TX packets:27630 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:52123963 (52.1 MB)  TX bytes:2967812 (2.9 MB)

route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         131.220.207.254 0.0.0.0         UG    0      0        0 wlan0
131.220.200.0   0.0.0.0         255.255.248.0   U     2      0        0 wlan0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlan0

service isc-dhcp-server status

isc-dhcp-server stop/waiting

dhcpd

Internet Systems Consortium DHCP Server 4.1-ESV-R4
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Wrote 0 leases to leases file.

No subnet declaration for wlan0 (131.220.201.217).
** Ignoring requests on wlan0.  If this is not what
   you want, please write a subnet declaration
   in your dhcpd.conf file for the network segment
   to which interface wlan0 is attached. **


Not configured to listen on any interfaces!

dhcpd eth0

Internet Systems Consortium DHCP Server 4.1-ESV-R4
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Wrote 0 leases to leases file.

No subnet declaration for eth0 (no IPv4 addresses).
** Ignoring requests on eth0.  If this is not what
   you want, please write a subnet declaration
   in your dhcpd.conf file for the network segment
   to which interface eth0 is attached. **


Not configured to listen on any interfaces!

2 Answers2

2

dhcp3-server installs the ISC DHCP server variant.

  • Stop the server after booting or when you don't need it with:

    sudo service isc-dhcp-server stop
    sudo service isc-dhcp-server6 stop
    
  • When you are ready to party, start it with:

    sudo service isc-dhcp-server start
    sudo service isc-dhcp-server6 start
    
ish
  • 139,926
0

There are a lot of options, but the easiest way is to install it just before the party, and uninstall it afterwards, before connecting to another network.

Javier Rivera
  • 35,153