Recovered from the older tannerjc.net wiki snapshot dated January 23, 2016.

  • DHCP**

example dhcpd.conf

authoritative;

shared-network dj-edm-cracker-org {

# dj.edm subnet
subnet 192.168.2.0 netmask 255.255.255.0 {
    option domain-name dj.edm;
    option routers 192.168.2.1;
    option subnet-mask 255.255.255.0;
    option domain-name-servers 192.168.2.1;
    option time-offset -18000; # EST
    next-server 192.168.2.1;
    filename pxelinux.0;

    range 192.168.2.50 192.168.2.100;
    default-lease-time 21600; # 6 hours
    max-lease-time 43200;     # 12 hours
    range dynamic-bootp 192.168.2.101 192.168.2.180;
}

# cracker.org subnet
subnet 192.168.1.0 netmask 255.255.255.0 {
        option domain-name cracker.org;
        option routers 192.168.1.1;
        option subnet-mask 255.255.255.0;
        option domain-name-servers 192.168.1.1;
}
}

# dj.edm statically assigned clients
host hawtin {
    hardware ethernet 00:11:09:D9:15:52;
    fixed-address 192.168.2.2;
}

host graybox {
    hardware ethernet 00:e0:4d:2f:96:3c;
    fixed-address 192.168.2.3;
}

host gibson {
    hardware ethernet 00:01:29:d0:19:74;
    fixed-address 192.168.2.4;
}

host laptop {
    hardware ethernet 00:24:8c:83:f2:b0;
    fixed-address 192.168.2.5;
}
host xbox {
    hardware ethernet 00:0d:3a:17:d5:bf;
    fixed-address 192.168.2.6;
}
host wap {
    hardware ethernet 00:0f:66:dc:fe:df;
    fixed-address 192.168.2.7;
}
host knuckles {
    hardware ethernet 00:e0:18:dd:f0:57;
    fixed-address 192.168.2.8;
}
host aaronjae {
    hardware ethernet 00:24:8c:43:75:f8;
    fixed-address 192.168.2.9;
}
host mom-laptop {
    hardware ethernet 00:1c:23:97:cf:41;
    fixed-address 192.168.2.10;
}
host farina {
    hardware ethernet 00:24:8C:6C:31:DF;
    fixed-address 192.168.2.11;
}
host vandyk {
    hardware ethernet 00:15:AF:DD:E4:0F;
    fixed-address 192.168.2.12;
}

host carlcox {
    hardware ethernet 08:00:27:22:66:7D;
    fixed-address 192.168.2.13;
}
host sasha {
    hardware ethernet 90:e6:ba:2e:2c:bb;
    fixed-address 192.168.2.14;
}
host server102 {
    hardware ethernet 52:54:00:23:e9:38;
    fixed-address 192.168.2.15;
}
host station2 {
    hardware ethernet 52:54:00:55:ae:c7;
    fixed-address 192.168.2.16;
}
host digweed {
   hardware ethernet 52:54:00:C6:87:B1;
   fixed-address 192.168.2.17;
}

host db {
        hardware ethernet 00:40:F4:A6:65:39;
        fixed-address 192.168.2.18;
}

host deadmau5 {
        hardware ethernet 52:54:00:52:E5:6F;
        fixed-address 192.168.2.19;
}

host jaytech {
        hardware ethernet 52:54:00:25:5D:2A;
        fixed-address 192.168.2.20;
}

host vission {
        hardware ethernet 52:54:00:6A:8C:E8;
        fixed-address 192.168.2.21;
}

## Reserved for static assignments
# 192.168.2.190 switch.dj.edm
# 192.168.2.192 doublevission.dj.edm

# wireless static entries

host laptop-wireless {
    hardware ethernet 00:13:e8:cd:6f:59;
    fixed-address 192.168.2.200;
}

# cracker.org statically assigned clients
host cracker2 {
    hardware ethernet 52:54:00:36:e2:f4;
    fixed-address 192.168.1.2;
}

Multiple subnets on one interface

  • shared-network**

  • man 5 dhcpd.conf*

       Some installations have physical networks on which more than one IP  subnet  oper-
       ates.    For  example, if there is a site-wide requirement that 8-bit subnet masks
       be used, but a department with a single physical ethernet network expands  to  the
       point  where it has more than 254 nodes, it may be necessary to run two 8-bit sub-
       nets on the same ethernet until such time as a new physical network can be  added.
       In this case, the subnet declarations for these two networks must be enclosed in a
       shared-network declaration.
  • configure shared-network option similar to dhcpd.conf example in the beginning of wiki
  • configure an alias IP address on existing interface for the new subnet:
[root@trainwreck named]# cat /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
BOOTPROTO=none
DEFROUTE=yes
IPV6INIT=no
ONBOOT=yes
OPTIONS=layer2=1
TYPE=Bridge
#UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
IPADDR=192.168.2.1
NETMASK=255.255.255.0
[root@trainwreck named]# cat /etc/sysconfig/network-scripts/ifcfg-br0\:1
DEVICE=br0:1
BOOTPROTO=none
#DEFROUTE=yes
IPV6INIT=no
ONBOOT=yes
OPTIONS=layer2=1
#TYPE=Bridge
#UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
IPADDR=192.168.1.1
NETMASK=255.255.255.0
  • restart network
  • check working config
[root@trainwreck named]# ifconfig br0
br0       Link encap:Ethernet  HWaddr 00:0E:0C:9F:FC:A1
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::20e:cff:fe9f:fca1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:35998659 errors:0 dropped:0 overruns:0 frame:0
          TX packets:35891890 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:32306672786 (30.0 GiB)  TX bytes:30840266156 (28.7 GiB)

[root@trainwreck named]# ifconfig br0:1
br0:1     Link encap:Ethernet  HWaddr 00:0E:0C:9F:FC:A1
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
[root@trainwreck named]# ip addr show br0
4: br0: BROADCAST,MULTICAST,UP,LOWER_UP mtu 1500 qdisc noqueue state UNKNOWN
    link/ether 00:0e:0c:9f:fc:a1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.1/24 brd 192.168.2.255 scope global br0
    inet 192.168.1.1/24 brd 192.168.1.255 scope global br0:1
    inet6 fe80::20e:cff:fe9f:fca1/64 scope link
       valid_lft forever preferred_lft forever