forked from crossbowerbt/dhcpserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.sh
More file actions
25 lines (17 loc) · 688 Bytes
/
Copy pathconfig.sh
File metadata and controls
25 lines (17 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
INTERFACE='eth0'
# get IP address (of the DHCP server) cofigured on the specified interface
IP_ADDRESS=`ifconfig $INTERFACE | awk '/inet /{ print $2 }'`
# get network mask
NETWORK_MASK=`ifconfig $INTERFACE | awk '/netmask /{ print $4 }'`
# get default gateway router
DEFAULT_GATEWAY=`route -n | grep $INTERFACE | awk '/UG/{print $2}'`
# user defined pool of addresses
POOL_START='192.168.1.50'
POOL_END='192.168.1.99'
# default duration of the lease (in seconds)
DEFAULT_LEASE_TIME='1800'
# max acceptable lease time requested by a client (in seconds)
MAX_LEASE_TIME='3600'
# how long to consider an offered address in the pending state (in seconds)
PENDING_TIME='30'