|
From: <abe...@us...> - 2013-02-12 20:16:59
|
Revision: 5952
http://astlinux.svn.sourceforge.net/astlinux/?rev=5952&view=rev
Author: abelbeck
Date: 2013-02-12 20:16:52 +0000 (Tue, 12 Feb 2013)
Log Message:
-----------
New system variable, EXTDHCP="no" by default, when "yes" the DHCP server will be enabled and allowed on a static IP external interface,
useful in very special situations, such as in a VM with a single interface.
Modified Paths:
--------------
branches/1.0/package/arnofw/arnofw.wrapper
branches/1.0/package/dnsmasq/dnsmasq.init
branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf
Modified: branches/1.0/package/arnofw/arnofw.wrapper
===================================================================
--- branches/1.0/package/arnofw/arnofw.wrapper 2013-02-12 01:51:21 UTC (rev 5951)
+++ branches/1.0/package/arnofw/arnofw.wrapper 2013-02-12 20:16:52 UTC (rev 5952)
@@ -207,6 +207,10 @@
EXT_IF_DHCP_IP=1
fi
+if [ "$EXTDHCP" = "yes" -a -n "$EXTIP" -a -z "$EXT2IF" -a -z "$PPPOEIF" ]; then
+ EXTERNAL_DHCP_SERVER=1
+fi
+
if isVPNtype racoon || isVPNtype ipsecmobile; then
RP_FILTER=0
fi
Modified: branches/1.0/package/dnsmasq/dnsmasq.init
===================================================================
--- branches/1.0/package/dnsmasq/dnsmasq.init 2013-02-12 01:51:21 UTC (rev 5951)
+++ branches/1.0/package/dnsmasq/dnsmasq.init 2013-02-12 20:16:52 UTC (rev 5952)
@@ -172,6 +172,19 @@
fi
}
+is_EXTDHCP_active()
+{
+
+ # Applies to static EXTIP address, no EXT2IF and no PPPoE
+ if [ "$EXTDHCP" = "yes" -a -n "$EXTIP" -a -z "$EXT2IF" -a -z "$PPPOEIF" ]; then
+ if [ -n "$EXTIF" -a "$EXTIF" != "none" ] && isDHCPinterface $EXTIF; then
+ return 0
+ fi
+ fi
+
+ return 1
+}
+
is_DHCP_active()
{
@@ -243,7 +256,7 @@
return
fi
- if is_DHCP_active; then
+ if is_DHCP_active || is_EXTDHCP_active; then
createDNSMASQbasic dhcp >> /tmp/etc/dnsmasq.conf
addDNSMASQnet "$INTIF" "$INTIP" "$INTNM" lan >> /tmp/etc/dnsmasq.conf
@@ -254,6 +267,10 @@
addDNSMASQnet "$DMZIF" "$DMZIP" "$DMZNM" dmz >> /tmp/etc/dnsmasq.conf
+ if is_EXTDHCP_active; then
+ addDNSMASQnet "$EXTIF" "$EXTIP" "$EXTNM" ext >> /tmp/etc/dnsmasq.conf
+ fi
+
addDHCPhosts_options >> /tmp/etc/dnsmasq.conf
else
createDNSMASQbasic nodhcp >> /tmp/etc/dnsmasq.conf
Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf
===================================================================
--- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2013-02-12 01:51:21 UTC (rev 5951)
+++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2013-02-12 20:16:52 UTC (rev 5952)
@@ -70,6 +70,10 @@
#EXTNM="255.255.255.0"
#EXTGW="192.168.25.1"
#DNS="192.168.1.1 192.168.1.2 192.168.1.3"
+## Enable DHCP Server on the external interface with a static IP address.
+## If the firewall is enabled, DHCP requests will be allowed automatically.
+## Note: Only use in very special situations.
+#EXTDHCP="no" # "no" or "yes", defaults to "no"
## Internal Interface
#INTIF=eth1
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|