Browse Source

fixed IPCMD for vlan

Artyom A Anikeev 7 years ago
parent
commit
79fac52a52
2 changed files with 43 additions and 11 deletions
  1. 11 9
      ipw
  2. 32 2
      man/man1/ipw.1

+ 11 - 9
ipw

@@ -235,6 +235,10 @@ case "$CMD" in
 		;;
 	delbr)
 		;;
+	addif) #allow to add interface without bridging
+		;;
+	delif)
+		;;
 	addipcmd) #allow to add ip commnds for bridges/vlans
 		NEWCONFIG=1	# we need to update the config after the command
 		NEW_BRIDGE="$1"; shift
@@ -521,6 +525,13 @@ case "$CMD" in
 							ip link set dev "$FULL_VLAN_NAME" up
 						fi
 					fi
+
+					ip addr flush dev "$FULL_VLAN_NAME"
+					IP_CMDS_VARIABLE="vlan${VLANNAME//[.]/_}_IP"
+					IP_CMDS_VARIABLE="${IP_CMDS_VARIABLE}[@]"
+					for IP_CMD in "${!IP_CMDS_VARIABLE}"; do
+						ip $IP_CMD dev "$FULL_VLAN_NAME"
+					done
 				fi
 
 				#BRIDGE STUFF
@@ -536,8 +547,6 @@ case "$CMD" in
 						#echo "ip link add "$BRNAME" type bridge"
 						ip link add "$BRNAME" type bridge
 					fi
-					[[ "$SUBVLAN" != "" ]] &&
-						ip link set dev "$BRNAME" mtu 1496
 
 					if [[ "$VLAN" != "" ]]; then
 						#OLD_BRNAME="`brctl show | grep "$FULL_VLANNAME" | awk '{print $1}'`"
@@ -569,13 +578,6 @@ case "$CMD" in
 						[[ "$IP_CMD" != "" ]] &&
 							ip $IP_CMD dev "$BRNAME"
 					done
-				else
-					ip addr flush dev "$VLANNAME"
-					IP_CMDS_VARIABLE="vlan${VLANNAME//[.]/_}_IP"
-					IP_CMDS_VARIABLE="${IP_CMDS_VARIABLE}[@]"
-					for IP_CMD in "${!IP_CMDS_VARIABLE}"; do
-						ip $IP_CMD dev "$VLANNAME"
-					done
 				fi
 			done
 		done

+ 32 - 2
man/man1/ipw.1

@@ -29,6 +29,36 @@ bringes all interfaces down, deletes bondings and bridges.
 .PP
 .RE
 
+.\" .B add1qif
+.\" $BONDING $SLAVE
+.\" .RS 8
+.\" changes
+.\" .I /etc/ipw/conf
+.\" by enslaving the $SLAVE interface into the $BONDING.
+.\" .PP
+.\" .RE
+
+.\" .B del1qif
+.\" $BONDING $SLAVE
+.\" .RS 8
+.\" changes 
+.\" .I /etc/ipw.conf
+.\" by setting nomaster for the $SLAVE.
+.\" .PP
+.\" .RE
+
+.\" .B addbrif
+.\" $BONDING $VLAN.$SUBVLAN $BRIDGE
+.\" .RS 8
+.\" changes
+.\" .I /etc/ipw.conf
+.\" by adding bridged vlan into the bonding. If $BRIDGE variable is not
+.\" set, then "vlan$VLAN.$SUBVLAN"/"vlan$VLAN" is used as bridge name.
+.\" \.$SUBVLAN should be used in case of QinQ interfaces for a daughter
+.\" (inner tag) vlan (see 802.1ad).
+.\" .PP
+.\" .RE
+
 .SH EXAMPLES
 TODO
 .RE
@@ -102,8 +132,8 @@ specifies bonding mode for each master. Default is 802.3ad.
 .HP 
 .BR $NAME _VLAN_N_BRIDGES
 specifies vlans and bridges for each master. Syntax is as foolow:
-vlan.subvlan:bridge-name. Subvlan means parent (outer tag) vlan for
-QinQ vlan (inner tag) interfaces (see 802.1ad).
+vlan.subvlan:bridge-name. Subvlan means daughter (inner tag) vlan
+for QinQ vlan (outer tag) interfaces (see 802.1ad).
 
 Symbol `.' in bridge name is not a special symbol.