401 | | {{{ |
402 | | - `vlan n` - create/configure standard VLANs, n being the VLAN ID (some number) |
403 | | - `interface vlan n` - create/ configure a virtual interface with both Layer 2 and 3 characteristics |
404 | | - `interface gigabitethernet 0/n` - configure specific port, n being number between 1 and 48 |
405 | | - `line <vty|console> vtyrange<0-b>` - configure telnet or console parameters, respectively |
406 | | }}} |
| 402 | |
| 403 | * `vlan n` - create/configure standard VLANs, n being the VLAN ID (some number) |
| 404 | * `interface vlan n` - create/ configure a virtual interface with both Layer 2 and 3 characteristics |
| 405 | * `interface gigabitethernet 0/n` - configure specific port, n being number between 1 and 48 |
| 406 | * `line <vty|console> vtyrange<0-b>` - configure telnet or console parameters, respectively |
| 407 | |
417 | | As you can see above, when you make changes to the configurations (e.g. create vlan interfaces as in this example), you will see a "!" before the prompt. This is there to remind you that you've made changes that must be saved if you want them to survie a reboot. The command "save" intuitively saves the settings. |
418 | | |
| 419 | If you forget where you were in a context (i.e. which vlan you were configuring, ect.), typing "show" will display all of the configurations saved for that specific context (hopefully giving you enough information to let you recall what you were trying to configure). |
| 420 | {{{ |
| 421 | (config-if)# show |
| 422 | interface gigabitethernet 0/27 |
| 423 | switchport mode access |
| 424 | switchport access vlan 4 |
| 425 | ! |
| 426 | }}} |
| 427 | |
| 428 | When you make changes to the configurations (e.g. create vlan interfaces as in this example), you will see a "!" before the prompt. This is there to remind you that you've made changes that must be saved if you want them to survie a reboot. The command "save" intuitively saves the settings. |
| 429 | |
| 430 | '''exiting/ logging off.''' |
539 | | |
540 | | This cannot be done with interface VLANs (although you can configure multiple interface VLANs at once, if they exist, using context "interface range vlan <range>"). Hence when we need to generate many VLANs, we'd first create them with "vlan 1-n", then configure the VLANs as interface VLANs later. |
541 | | |
542 | | |
543 | | |
544 | | 2. '''Asssociate Ports.''' |
545 | | |
546 | | There are also contexts that support ranges of interfaces/ports/VLANs. For example, to configure ports 1-4 and 30 at once: |
| 555 | This cannot be done with interface VLANs (see step 3 for details and caveats) |
| 556 | |
| 557 | 2. '''Associate Ports.''' A VLAN is fairly useless without hosts. Hosts become part of a VLAN if they are connected to a port associated with it. By default, all ports on the IP8800 are associated to VLAN 1,so you must specify which ports are associated with which VLAN manually. Here we associate port 0/25 with the VLAN we just created. |
| 558 | {{{ |
| 559 | (config)# int gi 0/25 |
| 560 | (config-if)# switchport mode access |
| 561 | (config-if)# swi acc vlan 3 <<-- full command is "switchport access vlan 3" |
| 562 | (config-if)# exit |
| 563 | }}} |
| 564 | |
| 565 | * "switchport mode access" means that the port only has access to the VLAN 3 that exists on the local switch (no trunking - see next section ) |
| 566 | * "switchport access vlan 3" means that this port has access to VLAN 3 |
| 567 | |
| 568 | As with the VLANs, we can configure more than one port at a time using the "interface range" context. For example, to configure ports 1-4 and 30 at once: |
551 | | Note how the prompt becomes "(config-if-range)" in this case. |
552 | | |
| 573 | Note how the prompt becomes "(config-if-range)" in this case. The exact same sets of commands apply to this context as for the single-port context. |
| 574 | |
| 575 | 3. '''Configure the interface VLAN.''' If we need an IP address or some other higher-layer characteristic associated with our VLAN, we create an interface VLAN of the same VLAN ID (number) as the VLAN, and configure it. So, to assign an IP address to VLAN 3: |
| 576 | {{{ |
| 577 | (config)# interface vlan 3 |
| 578 | !(config-if)# ip address 172.16.100.10 255.255.255.0 |
| 579 | !(config-if)# exit |
| 580 | !(config)# |
| 581 | }}} |
| 582 | |
| 583 | When the "interface vlan" context is entered for a VLAN ID that the switch doesn't know about, a new interface VLAN and VLAN of that ID are created automatically. But, as stated before, the "interface range vlan" context cannot be used to create multiple interface VLANs at once. This range context is used when configuring multiple interface VLANs at once, ''given'' that the range of VLAN IDs exist on the switch. Hence, if we want to configure multiple interface VLANs at once, we must first create the VLANs using the "VLAN <range>" context. |
| 584 | |
| 585 | === Configuring Trunking === |