diff --git a/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst b/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst index 538e223ba..68446e443 100644 --- a/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst @@ -450,7 +450,7 @@ OPTIONS \ **vlan**\ - Get or set vlan ID. For get vlan ID, if vlan is not enabled, 'BMC VLAN disabled' will be displayed. For set vlan ID, the valid value are [1-4096]. + Get or set VLAN ID. Valid VLAN IDs are 1-4094. On IPMI managed nodes, use \ **vlan=off**\ or \ **vlan=disable**\ to disable VLAN tagging. diff --git a/xCAT-client/pods/man1/rspconfig.1.pod b/xCAT-client/pods/man1/rspconfig.1.pod index f452dc2cc..4c70d966a 100644 --- a/xCAT-client/pods/man1/rspconfig.1.pod +++ b/xCAT-client/pods/man1/rspconfig.1.pod @@ -352,7 +352,7 @@ Get or set hostname on the service processor. =item B -Get or set vlan ID. For get vlan ID, if vlan is not enabled, 'BMC VLAN disabled' will be displayed. For set vlan ID, the valid value are [1-4096]. +Get or set VLAN ID. Valid VLAN IDs are 1-4094. On IPMI managed nodes, use B or B to disable VLAN tagging. =item B diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index b6962c9c8..09c19aed8 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -946,18 +946,22 @@ sub setnetinfo { } @cmd = (0x01, $channel_number, 12, @mask); } elsif ($subcommand =~ m/vlan/) { - unless ( int($argument) == $argument ) { - $callback->({ errorcode => [1], error => ["The input $argument is invalid, please input an integer"] }); - return; + if ($argument =~ /^(off|disable|disabled)$/i) { + @cmd = (0x01, $channel_number, 0x14, 0x00, 0x00); + } else { + unless ( $argument =~ /^\d+$/ ) { + $callback->({ errorcode => [1], error => ["The input $argument is invalid, please input an integer or 'off'"] }); + return; + } + unless (($argument>=1) && ($argument<=4094)) { + $callback->({ errorcode => [1], error => ["The input $argument is invalid, valid value [1-4094] or 'off'"] }); + return; + } + my @vlanparam = (); + $vlanparam[0] = ($argument & 0xff); + $vlanparam[1] = 0x80 | (($argument & 0xf00) >> 8); + @cmd = (0x01, $channel_number, 0x14, @vlanparam); } - unless (($argument>=1) && ($argument<=4096)) { - $callback->({ errorcode => [1], error => ["The input $argument is invalid, valid value [1-4096]"] }); - return; - } - my @vlanparam = (); - $vlanparam[0] = ($argument & 0xff); - $vlanparam[1] = 0x80 | (($argument & 0xf00) >> 8); - @cmd = (0x01, $channel_number, 0x14, @vlanparam); } elsif ($subcommand =~ m/ip/ and $argument =~ m/dhcp/) { @cmd = (0x01, $channel_number, 0x4, 0x2); } elsif ($subcommand =~ m/ip/) {