summaryrefslogtreecommitdiffstats
path: root/netconfig
diff options
context:
space:
mode:
authorDarren 'Tadgy' Austin <darren@afterdark.org.uk>2019-11-18 16:57:48 +0000
committerRobby Workman <rworkman@slackware.com>2019-11-20 00:40:41 -0600
commit6778b18e8a3550eff78ba4b5a5eb160ad767590c (patch)
tree2a1839121c5e4c915368254552db0e85096d9e11 /netconfig
parent4a21ea93e6e12ce8a1aa3923e1c397d744528fe8 (diff)
downloadslacknetsetup-6778b18e8a3550eff78ba4b5a5eb160ad767590c.tar.xz
Add VLAN configuration support to netconfig.
Diffstat (limited to 'netconfig')
-rw-r--r--netconfig30
1 files changed, 30 insertions, 0 deletions
diff --git a/netconfig b/netconfig
index 533f9f4..f8f62f9 100644
--- a/netconfig
+++ b/netconfig
@@ -42,6 +42,13 @@ fi
# =============================================================================
# IPv4 config information for eth0:
+ENDFILE
+
+if [ -n "$VLAN" ]; then
+ echo "IFNAME[0]=\"eth0$VLAN\"" >>$RC
+fi
+
+/bin/cat << ENDFILE >> $RC
IPADDR[0]="$RCIPCOPY"
NETMASK[0]="$RCMASKCOPY"
IPALIASES[0]=""
@@ -466,6 +473,29 @@ echo $HOSTNM.$DOMAIN > etc/HOSTNAME
# sed -i "s/^hostname=.*$/hostname=$HOSTNM/g" etc/NetworkManager/NetworkManager.conf
#fi
+dialog --title "CONNECT VIA VLAN" --defaultno --yesno \
+"Some advanced networking set ups require a VLAN ID in order to \
+connect to the network. Do you wish to configure a VLAN now? \n\n\
+Unless you are sure you require a VLAN, select 'No'." 8 68
+if [ $? = 0 ]; then
+ while true; do
+ dialog --title "VLAN ID" --cancel-label "Skip" --inputbox \
+ "Enter the VLAN ID used on this network." 8 45 2>$TMP/reply
+ if [ $? = 0 ]; then
+ if ! (($(cat $TMP/reply))) 2>/dev/null; then
+ dialog --title "VLAN ID" --ok-button "Back" --msgbox \
+ "That doesn't appear to be a valid VLAN ID." 5 46
+ continue
+ else
+ VLAN=".`cat $TMP/reply`"
+ break
+ fi
+ else
+ break
+ fi
+ done
+fi
+
dialog --title "CONFIGURATION TYPE FOR '$HOSTNM.$DOMAIN'" \
--default-item NetworkManager \
--menu \