Vous êtes sur la page 1sur 3

User EXEC Password Protection

Router(config)# line aux 0


Router(config-line)# password console_password
Router(config-line)# exit
To set up a telnet password for your VTYs, use this configuration:
IOS(config)# line vty 0 15
IOS(config-line)# password telnet_password
IOS(config-line)# login

IOS(config)# username name secret|password password


IOS(config)# line vty 0 15
IOS(config-line)# login local

Vlan
Your VTP configuration is done from Global Configuration mode on the 2960:
switch(config)# vtp domain VTP_domain_name
switch(config)# vtp mode server|client|transparent
switch(config)# vtp password VTP_password
switch(config)# vtp pruning

VLAN configuration
switch# vlan database
switch(vlan)# vlan VLAN_# [name VLAN_name]
or
switch(config)# vlan VLAN_#
switch(config-vlan)# name VLAN_name

Switch(config)#vlan 10
Switch(config-vlan)#name Engineering
Switch(config-vlan)#exit

Assigning Ports to VLANs


Switch(config)#interface fastethernet 0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10

Switches and Redundancy

Switch-A(config)# spanning-tree mode rapid-pvst


Switch-A(config)# spanning-tree vlan 1 root primary
Switch-A(config)# spanning-tree vlan 2 root secondary
Switch-B’s configuration would look like this:
Switch-B(config)# spanning-tree mode rapid-pvst
Switch-B(config)# spanning-tree vlan 2 root primary
Switch-B(config)# spanning-tree vlan 1 root secondary
IP Address and Default Gateway

Switch(config)# hostname Switch-A


Switch-A(config)# line console 0
Switch-A(config-line)# exec-timeout 5 0
Switch-A(config-line)# password consolepass123
Switch-A(config)# exit
Switch-A(config)# line vty 0 15
Switch-A(config-line)# password telnetpass123
Switch-A(config-line)# exec-timeout 5 0Switch-A(config-line)# login

Switch-A(config-line)# exit
Switch-A(config)# enable secret secretpass123
Switch-A(config)# service password-encryption
Switch-A(config)# banner motd $
This is a private system and only authorized individuals
are allowed!
All others will be prosecuted to the fullest extent of the law!
$
Switch-A(config)# interface vlan 1
Switch-A(config-vlan)# ip address 10.0.1.2 255.255.255.0
Switch-A(config-vlan)# exit
Switch-A(config)# ip default-gateway 10.0.1.1
Switch-A(config)# end
Switch-A# copy running-config startup-config

Router-on-a-Stick Example Configuration


Router(config)# interface fastethernet0/0
Router(config-if)# duplex full
Router(config-if)# no shutdown

Router(config-if)# exit
Router(config)# interface fastethernet0/0.1
Router(config-subif)# encapsulation dot1q 10
Router(config-subif)# ip address 172.16.1.1 255.255.255.0
Router(config-subif)# exit
Router(config)# interface fastethernet0/0.2
Router(config-subif)# encapsulation dot1q 20
Router(config-subif)# ip address 172.16.2.1 255.255.255.0
Router(config-subif)# exit

Commands used to set up a DHCP server

Router(config)# service dhcp


Router(config)# ip dhcp excluded-address 192.168.1.1 192.168.1.99
Router(config)# ip dhcp excluded-address 192.168.1.200 192.168.1.254
Router(config)# ip dhcp pool sdm-pool1
Router(dhcp-config)# import all
Router(dhcp-config)# network 192.168.1.0 255.255.255.0
Router(dhcp-config)# dns-server 65.32.1.65 4.2.2.2
Router(dhcp-config)# default-router 192.168.1.1

Default Route Configuration


Router(config)# ip route 0.0.0.0 0.0.0.0 IP_address_of_next_hop_neighbor [administrative_distance] [permanent]
or
Router(config)# ip route 0.0.0.0 0.0.0.0
interface_to_exit
[administrative_distance] [permanent]

Vous aimerez peut-être aussi