cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
18381
Views
18
Helpful
4
Replies

Configure Vlan with mutiple ports, not consecutive

mdaugomah11
Level 1
Level 1

Hello all,

 I am new to the Cisco world and am trying to configure a switch with 2 different vlans on multiple ports.

Example: G1/0/1 is Vlan 1, while G1/0/5 is Vlan 4. So Vlan 1 must be applied to ports  1,7,10-13, 15,16 ect... And Vlan 4 must be applied to ports 5,9, 18-20.

Is there a command that will allow me to configure the ports with each Vlan in this manner. Since some of the ports are not consecutive I am not sure how to apply that? Will I need to apply the Interface Range G/x/x - x to the ports that are in a row and do the individual ports separately? 

Thank you in advance for any help, its much appreciated as I have about 30 more switches that I need to setup in a similar manner.

4 Replies 4

Harsha A.
Level 1
Level 1

Hey mdaugomah11,

You can still use interface range command to include all the ports.

Switch(config)#int range gi 1/0/5, gi 1/0/9, gi 1/0/18-20

Switch(config)#switchport access vlan 4 

Switch(config)#exit

-Harsha

Thank you Harsha, it worked like a charm.

Disclaimer

The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.

Liability Disclaimer

In no event shall Author be liable for any damages wha2tsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.

Posting

A few usage notes to what Harsha posted.

The range statement can take up to five arguments.

Some (older?) platforms need you to delimit the command argument with a space.

On some platforms, especially those with many, many ports included in the range statement, it may take a while to process a line command (i.e. it may take long enough you start to wonder if command hung).

Sweet and short.

Many thanks!!

Review Cisco Networking for a $25 gift card