Commit 4d6d611d authored by Adam Wujek's avatar Adam Wujek 💬

rootfs: create dummy script to configure VLANs

So far there are no VLANs configured in this script, but it is good start.
When one needs can populate this sctipt on his/her own.
NOTE: VLANs should be configured before any other traffic is allowed. This
is done by previous commits.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent b4ce6eb2
#!/bin/sh
start() {
echo -n "Setting up VLANs: "
# set-up VLANs
/wr/etc/vlan_config.sh
if [ $? -eq 0 ]; then
echo "OK"
else
echo "Failed"
fi
}
stop() {
echo -n "Clean VLANs' configuration: "
/wr/bin/wrs_vlans --ep 0-17 --emode 3
/wr/bin/wrs_vlans --clear
echo "OK"
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
;;
esac
../init.d/vlan.sh
\ No newline at end of file
#!/bin/sh
set -e
## vlan configuration
## fill this file with vlans configuration
## Please note:
## wr1 is marked as port 2 on the front panel of the switch
## in other words:
## --ep1 == wr1
## but:
## wr1 == port2
## example configuration:
# configure ports 1-4,6,8-18 as evid 1
# /wr/bin/wrs_vlans --ep 0-3,5,7-17 --emode 0 --evid 1
# configure ports 5,7 as evid 2
# /wr/bin/wrs_vlans --ep 4,6 --emode 0 --evid 2
## set VID=1 on all ports except 4 and 6
## - binary: 11 1111 1111 1010 1111
## - hex : 0x3FFAF
# /wr/bin/wrs_vlans --rvid 1 --rfid 1 --rmask 0x3FFAF
## set VID=2 at ports 5 and 7 - this is
## - binary: 00 0000 0000 0101 0000
## - hex : 0x00050
# /wr/bin/wrs_vlans --rvid 2 --rfid 2 --rmask 0x00050
## when VLANs are defined, comment out the line below
echo -n "no configuration "
exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment