Setup the network interface.
Edit the file /etc/network/interfaces.
- auto lo
- iface lo inet loopback
- auto eth0
- iface eth0 inet static
- address 192.168.1.1
- netmask 255.255.255.0
- network 192.168.1.0
- broadcast 192.168.1.255
- auto eth1
- iface eth1 inet dhcp
Edit DHCP server config file /etc/udhcpd.conf
- start 192.168.1.100
- end 192.168.1.199
- interface eth0
- opt lease 86400
- opt router 192.168.1.1
- opt subnet 255.255.255.0
- opt dns 192.168.1.1
- opt domain localdomain
- max_leases 101
- lease_file /var/lib/udhcpd.leases
- auto_time 5
View udhcp's DHCP client table, use the command
- # dumpleases -f /var/lib/udhcpd.leases
If there are previous/old mac address and IP's stored in this file, to make udhcp use the new IP range the old udhcp.leases must be removed.
- # /etc/init.d/udhcpd stop ( Stop the udhcpd deamon )
- # rm /var/lib/udhcpd.leases ( Remove the old lease file )
- # touch /var/lib/udhcpd.leases ( Create a new empty lease file )
- # /etc/init.d/udhcpd start ( Start the udhcpd deamon )
沒有留言:
張貼留言