2012/12/02

Arch Linux - Setup dhcp daemon for local network

I want to setup a dhcp server for my local test network, here is  network scenario:
  1. usb0 - my internet access point connect to my WiMax box.(192.168.1.x)
  2. eth0 - my local testing network.(192.168.10.x)
Step 1. bind ip address to eth0

ifconfig eth0 192.168.10.1

Step 2. install required packages

pacman -S dhcp

Step 3. edit /etc/dhcpd.conf (remove all default dhcpd.conf)

# dhcp.conf
subnet 192.168.10.0 netmask 255.255.255.0 {
  option domain-name-servers 168.95.1.1,8.8.8.8;
  option routers 192.168.10.1;
  option subnet-mask 255.255.255.0;
  option broadcast-address 192.168.10.255;
  default-lease-time 600;
  max-lease-time 7200;
  range dynamic-bootp 192.168.10.100 192.168.10.10;
}

Step 4. start service

systemctl start dhcpd4

沒有留言: