Changeset 1435d00 in freewrt
- Timestamp:
- Jun 18, 2006, 7:16:02 PM (19 years ago)
- Branches:
- freewrt_1_0, freewrt_2_0
- Children:
- 76c5e9f
- Parents:
- 5f931bf9
- Location:
- package/dnsmasq/files
- Files:
-
- 2 edited
-
dnsmasq.conf (modified) (1 diff)
-
dnsmasq.init (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
package/dnsmasq/files/dnsmasq.conf
r5f931bf9 r1435d00 10 10 expand-hosts 11 11 12 @ifdef dhcp_enable 13 dhcp-range=@@start@@,@@end@@,@@netmask@@,@@lease@@ 14 @endif 15 @ifdef wan_ifname 16 except-interface=@@wan_ifname@@ 17 @endif 12 # add more dhcp-range options for every subnet 13 dhcp-range=192.168.1.100,192.168.1.254,255.255.255.0,24h 14 except-interface=vlan1 18 15 19 # enable dhcp (start,end,netmask,leasetime)20 16 dhcp-authoritative 21 17 dhcp-leasefile=/tmp/dhcp.leases 22 18 23 # use /etc/ethers for static hosts ; same format as --dhcp-host19 # use /etc/ethers for static hosts 24 20 # <hwaddr> <ipaddr> 25 read-ethers21 #read-ethers 26 22 27 23 # other useful options: -
package/dnsmasq/files/dnsmasq.init
r5f931bf9 r1435d00 1 1 #!/bin/sh 2 . /etc/config/network3 4 # The following is to automatically configure the DHCP settings5 # based on config settings. Feel free to replace all this crap6 # with a simple "dnsmasq" and manage everything via the7 # /etc/dnsmasq.conf config file8 2 9 3 [ -f /etc/dnsmasq.conf ] || exit 10 4 11 args="" 12 iface=lan 13 eval "ifname=\${${iface}_ifname}" 5 case $1 in 6 start) 7 /usr/sbin/dnsmasq 8 ;; 9 stop) 10 killall dnsmasq 11 restart) 12 $0 stop 13 $0 start 14 ;; 15 *) 16 echo "Usage: $0 {start | stop | restart}" 17 ;; 18 esac 19 exit 0 14 20 15 dhcp_enable="${dhcp_enable:-1}"16 dhcp_start="${dhcp_start:-100}"17 dhcp_num="${dhcp_num:-50}"18 dhcp_lease="${dhcp_lease:-12h}"19 20 # if dhcp_enable is unset and there is a dhcp server on the network already, default to dhcp_enable=021 [ -z "$dhcp_enable" ] && udhcpc -n -q -R -s /bin/true -i $ifname >&- && dhcp_enable="${dhcp_enable:-0}"22 23 # dhcp_enable=0 disables the dhcp server24 (25 [ -z "$dhcp_enable" -o "$dhcp_enable" -eq 1 ] && {26 # no existing DHCP server?27 28 # calculate settings29 eval "ipaddr=\${${iface}_ipaddr}"30 eval "netmask=\${${iface}_netmask}"31 eval $(ipcalc $ipaddr $netmask ${dhcp_start:-100} ${dhcp_num:-150})32 33 # and pass the args via config parser defines34 echo "@define dhcp_enable 1"35 echo "@define netmask $NETMASK"36 echo "@define start $START"37 echo "@define end $END"38 echo "@define lease ${dhcp_lease:-12h}"39 }40 41 # ignore requests from wan interface42 [ -z "$wan_proto" -o "$wan_proto" = "none" ] || echo "@define wan_ifname $wan_ifname"43 44 cat /etc/dnsmasq.conf45 ) | awk -f /usr/lib/parse-config.awk | dnsmasq -C /proc/self/fd/0
Note:
See TracChangeset
for help on using the changeset viewer.
