Vous êtes sur la page 1sur 4

Contents

Base configuration 1
Configure a hostname . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Configure an IP address for the switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Configure an access to the switch from telnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Enable a password for privileged mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Configure a gateway . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Erase and reload the switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

SSH 2
Allow ssh access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Show ssh server state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Deactivate ssh server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

VLAN 3
Suppress the previous vlan configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Configure the vlan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Remove a host (pc) from a vlan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Delete a vlan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Show . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

VTP (VLAN Trunking Protocol) 4


Configuration on the server side . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Configuration on the client side . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Configure the trunk and the natif vlan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Configure the vlans on the server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Show . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Inter-VLAN routing 4

Base configuration

Configure a hostname

Switch# configure terminal


Switch(config)# hostname S
S(config)# end

Configure an IP address for the switch

Switch> enable # or en
Switch# configure terminal # or conf t
Switch(config)# interface vlan 1
Switch(config-if)# ip address 192.168.1.50 255.255.255.0
Switch(config-if)# no shutdown
Switch(config-if)# end
Switch#

Configure an access to the switch from telnet

Switch# conf t
Switch(config)# line vty 0 15
Switch(config-line)# password cisco

1
Switch(config-line)# login
Switch(config-line)# exit

Enable a password for privileged mode

Switch# conf t
Switch(config)# enable password cisco # or enable secret cisco
Switch(config)# end

Configure a gateway

Switch# conf t
Switch(config)# ip default-gateway 192.168.1.1

Erase and reload the switch

To erase the switch :


Switch# erase startup-config
Then press enter when this message is shown :
Erasing the nvram filesystem will remove all files! Continue? [confirm]
Press Enter to confirm.
And then reload the switch :
Switch# reload
We press ‘n’ when this message is shown
System configuration has been modified. Save ? [yes/no]: n

SSH

Allow ssh access

To active the ssh protocol, this configurations have to be done :


• Configure a hostname :
Switch(config)# hostname S
• Configure a domain name
S(config)# ip domain-name cisco.com
• Generate an RSA key
S(config)# crypto key generate rsa
• Configure a locale authentication
S(config)# username haha secret cisco
S(config)# line vty 0 15
S(config-line)# transport input ssh
S(config-line)# login local

2
Show ssh server state

S# show ip ssh # and show ssh

Deactivate ssh server

When an RSA key is removed, the ssh server is automatically deactivated.


crypto key zeroize rsa

VLAN

Suppress the previous vlan configuration

Switch# delete flash:vlan.dat


Then press enter when these messages appear :
Delete filename [vlan.dat]?
Delet flash:vlan.dat? [confirm]
Then erase and reload the switch :
Switch# erase startup-config
reload

Configure the vlan

Create the vlan :


Switch(config)# vlan 2 # We give the vlan id to configure
Switch(config-vlan)# name Etudiants # We give a name to the vlan
Affect ports to the created vlan :
Switch(config)# interface fa0/2
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan2
Configure the trunk mode on the desired ports :
Switch(config)# interface fa0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# end

Remove a host (pc) from a vlan

Switch(config)# interface f0/2


Switch(config-if)# no switchport access vlan2

Delete a vlan

Switch# vlan database


Switch(vlan)# no vlan 2
Before we remove a vlan, we have to re-affect all his hosts (pcs) to another vlan (vlan 1 may be).

3
Show

The command show vlan brief is used to show vlan configuration on the switch.
The command show interface vlan 1 is used to show a vlan interface configuration. The vlan interface has to be
created first.
The command show interface f0/1 switchport is used to show the switchport mode on a port.

VTP (VLAN Trunking Protocol)

Configuration on the server side

Switch(config)# vtp mode server


Switch(config)# vtp domain SSI # domain name
Switch(config)# vtp password cisco
Switch(config)# end

Configuration on the client side

Switch(config)# vtp mode client


Switch(config)# vtp domain SSI # domain name
Switch(config)# vtp password cisco
Switch(config)# end

Configure the trunk and the natif vlan

(I don’t understand what is natif vlan)


Switch(config)# interface fa0/10
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk native vlan 4
Switch(config-if)# no shutdown

Configure the vlans on the server

We create the vlans in the server normally (like we do without VTP), and automatically the same vlans get created
on the switchs that were configured as client.

Show

show vtp status

Inter-VLAN routing
The majority of the configuration is done on the router. The only thing that has to be done on the switch, is to put
the port connected to the router in trunk mode :
Switch(config)# interface fa0/15
Switch(config-if)# switchport mode trunk
Switch(config-if)# end

Vous aimerez peut-être aussi