This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".
The branch, next has been updated
via d23fc9122091aea3581571e1367d4696d834cd1c (commit)
from 3eeb913b052a2debec285c5fa9ce9d108855931d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d23fc9122091aea3581571e1367d4696d834cd1c
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Fri Aug 24 15:58:38 2012 +0200
Add a script to create VLAN interfaces (on console).
-----------------------------------------------------------------------
Summary of changes:
config/cfgroot/ethernet-vlans | 9 +++
config/rootfiles/common/armv5tel/initscripts | 2 +
config/rootfiles/common/i586/initscripts | 2 +
config/rootfiles/core/62/filelists/files | 3 +
lfs/configroot | 1 +
lfs/initscripts | 1 +
src/initscripts/init.d/network-vlans | 101 ++++++++++++++++++++++++++
7 files changed, 119 insertions(+), 0 deletions(-)
create mode 100644 config/cfgroot/ethernet-vlans
create mode 100755 src/initscripts/init.d/network-vlans
Difference in files:
diff --git a/config/cfgroot/ethernet-vlans b/config/cfgroot/ethernet-vlans
new file mode 100644
index 0000000..08cb36a
--- /dev/null
+++ b/config/cfgroot/ethernet-vlans
@@ -0,0 +1,9 @@
+#GREEN_PARENT_DEV="eth0"
+#GREEN_VLAN_ID=20
+#GREEN_MAC_ADDRESS="00:11:22:33:44:55"
+#BLUE_PARENT_DEV="green0"
+#BLUE_VLAN_ID=30
+#BLUE_MAC_ADDRESS="00:22:33:44:55:66"
+#ORANGE_PARENT_DEV="green0"
+#ORANGE_VLAN_ID=40
+#ORANGE_MAC_ADDRESS="00:33:44:55:66:77"
diff --git a/config/rootfiles/common/armv5tel/initscripts b/config/rootfiles/common/armv5tel/initscripts
index c234166..ccb7bfb 100644
--- a/config/rootfiles/common/armv5tel/initscripts
+++ b/config/rootfiles/common/armv5tel/initscripts
@@ -58,6 +58,7 @@ etc/rc.d/init.d/mountkernfs
#etc/rc.d/init.d/mysql
#etc/rc.d/init.d/netsnmpd
etc/rc.d/init.d/network
+etc/rc.d/init.d/network-vlans
#etc/rc.d/init.d/networking
etc/rc.d/init.d/networking/any
etc/rc.d/init.d/networking/blue
@@ -213,6 +214,7 @@ etc/rc.d/rcsysinit.d/S70console
etc/rc.d/rcsysinit.d/S75firstsetup
etc/rc.d/rcsysinit.d/S80localnet
etc/rc.d/rcsysinit.d/S90sysctl
+etc/rc.d/rcsysinit.d/S91network-vlans
etc/rc.d/rc3.d/S15fireinfo
#etc/sysconfig
etc/sysconfig/createfiles
diff --git a/config/rootfiles/common/i586/initscripts b/config/rootfiles/common/i586/initscripts
index 63cd274..653060f 100644
--- a/config/rootfiles/common/i586/initscripts
+++ b/config/rootfiles/common/i586/initscripts
@@ -59,6 +59,7 @@ etc/rc.d/init.d/mountkernfs
#etc/rc.d/init.d/mysql
#etc/rc.d/init.d/netsnmpd
etc/rc.d/init.d/network
+etc/rc.d/init.d/network-vlans
#etc/rc.d/init.d/networking
etc/rc.d/init.d/networking/any
etc/rc.d/init.d/networking/blue
@@ -216,6 +217,7 @@ etc/rc.d/rcsysinit.d/S70console
etc/rc.d/rcsysinit.d/S75firstsetup
etc/rc.d/rcsysinit.d/S80localnet
etc/rc.d/rcsysinit.d/S90sysctl
+etc/rc.d/rcsysinit.d/S91network-vlans
etc/rc.d/rc3.d/S15fireinfo
#etc/sysconfig
etc/sysconfig/createfiles
diff --git a/config/rootfiles/core/62/filelists/files b/config/rootfiles/core/62/filelists/files
index 731daa0..34f0d16 100644
--- a/config/rootfiles/core/62/filelists/files
+++ b/config/rootfiles/core/62/filelists/files
@@ -1,5 +1,8 @@
etc/system-release
etc/issue
+etc/rc.d/init.d/network-vlans
+etc/rc.d/rcsysinit.d/S91network-vlans
srv/web/ipfire/cgi-bin/connections.cgi
usr/lib/gconv
+var/ipfire/ethernet/vlans
var/ipfire/outgoing/bin/outgoingfw.pl
diff --git a/lfs/configroot b/lfs/configroot
index f353614..90f5afa 100644
--- a/lfs/configroot
+++ b/lfs/configroot
@@ -100,6 +100,7 @@ $(TARGET) :
cp $(DIR_SRC)/config/cfgroot/time-settings $(CONFIG_ROOT)/time/settings
cp $(DIR_SRC)/config/cfgroot/logging-settings $(CONFIG_ROOT)/logging/settings
cp $(DIR_SRC)/config/cfgroot/useragents $(CONFIG_ROOT)/proxy/advanced
+ cp $(DIR_SRC)/config/cfgroot/ethernet-vlans $(CONFIG_ROOT)/ethernet/vlans
cp $(DIR_SRC)/langs/list $(CONFIG_ROOT)/langs/
# Oneliner configfiles
diff --git a/lfs/initscripts b/lfs/initscripts
index 03cec80..7210c0d 100644
--- a/lfs/initscripts
+++ b/lfs/initscripts
@@ -170,6 +170,7 @@ $(TARGET) :
ln -sf ../init.d/firstsetup /etc/rc.d/rcsysinit.d/S75firstsetup
ln -sf ../init.d/localnet /etc/rc.d/rcsysinit.d/S80localnet
ln -sf ../init.d/sysctl /etc/rc.d/rcsysinit.d/S90sysctl
+ ln -sf ../init.d/network-vlans /etc/rc.d/rcsysinit.d/S91network-vlans
ln -sf ../../dnsmasq /etc/rc.d/init.d/networking/red.up/05-RS-dnsmasq
ln -sf ../../firewall /etc/rc.d/init.d/networking/red.up/20-RL-firewall
diff --git a/src/initscripts/init.d/network-vlans b/src/initscripts/init.d/network-vlans
new file mode 100755
index 0000000..88733e6
--- /dev/null
+++ b/src/initscripts/init.d/network-vlans
@@ -0,0 +1,101 @@
+#!/bin/bash
+############################################################################
+# #
+# This file is part of the IPFire Firewall. #
+# #
+# IPFire is free software; you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation; either version 2 of the License, or #
+# (at your option) any later version. #
+# #
+# IPFire is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with IPFire; if not, write to the Free Software #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
+# #
+# Copyright (C) 2012 IPFire Team <info(a)ipfire.org> #
+# #
+############################################################################
+
+CONFIG_FILE="/var/ipfire/ethernet/vlans"
+
+# Skip immediately if no configuration file has been found.
+[ -e "${CONFIG_FILE}" ] || exit 0
+
+eval $(readhash ${CONFIG_FILE})
+
+# This is start or stop.
+action=${1}
+
+for interface in green0 blue0 orange0; do
+ case "${interface}" in
+ green*)
+ PARENT_DEV=${GREEN_PARENT_DEV}
+ VLAN_ID=${GREEN_VLAN_ID}
+ MAC_ADDRESS=${GREEN_MAC_ADDRESS}
+ ;;
+ blue*)
+ PARENT_DEV=${BLUE_PARENT_DEV}
+ VLAN_ID=${BLUE_VLAN_ID}
+ MAC_ADDRESS=${BLUE_MAC_ADDRESS}
+ ;;
+ orange*)
+ PARENT_DEV=${ORANGE_PARENT_DEV}
+ VLAN_ID=${ORANGE_VLAN_ID}
+ MAC_ADDRESS=${ORANGE_MAC_ADDRESS}
+ ;;
+ esac
+
+ case "${action}" in
+ start)
+ # Check if the interface does already exists.
+ # If so, we skip creating it.
+ if [ -d "/sys/class/net/${interface}" ]; then
+ echo "Interface ${interface} already exists."
+ continue
+ fi
+
+ # Check if the parent interface exists.
+ if [ -z "${PARENT_DEV}" ] || [ ! -d "/sys/class/net/${PARENT_DEV}" ]; then
+ echo "${interface}: Parent device is not set or does not exist: ${PARENT_DEV}"
+ continue
+ fi
+
+ if [ -z "${VLAN_ID}" ]; then
+ echo "${interface}: You did not set the VLAN ID."
+ continue
+ fi
+
+ echo "Creating VLAN interface ${interface}..."
+ vconfig add ${PARENT_DEV} ${VLAN_ID}
+ ip link set ${PARENT_DEV}.${VLAN_ID} name ${interface}
+
+ if [ -n "${MAC_ADDRESS}" ]; then
+ ip link set ${interface} address ${MAC_ADDRESS}
+ fi
+
+ # Bring up the parent device.
+ ip link set ${PARENT_DEV} up
+ ;;
+
+ stop)
+ if [ ! -e "/proc/net/vlan/${interface}" ]; then
+ echo "${interface} is not a VLAN interface. Skipping."
+ continue
+ fi
+
+ echo "Removing VLAN interface ${interface}..."
+ ip link set ${interface} down
+ vconfig rem ${interface}
+ ;;
+
+ *)
+ echo "Invalid action: ${action}"
+ exit 1
+ ;;
+ esac
+done
hooks/post-receive
--
IPFire 2.x development tree