交換機基本配置

拓撲

1.)配置主機名跟路由器地址     

Switch>EN

Switch#conf te

Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#hos

Switch(config)#hostname  S1

R1(config)#interface  f0/0

R1(config-if)#no shut

R1(config-if)#no shutdown 

R1(config-if)#ip address  172.16.0.1  255.255.255.0

R2(config)#interface  f0/0

R2(config-if)#no shu

R2(config-if)#ip address  172.16.0.2  255.255.255.0

(2) 配置基本安全措施

S1(config)#enable secret  cisco

S1(config)#service  password-encryption 

S1(config)#line vty 0 15

S1(config-line)#password  cisco

S1(config-line)#login 

S1(config)#line console 0

S1(config-line)#password  cisco

S1(config-line)#login

(3) 接口基本配置

 S1(config)#interface  f0/1 //進入端口

 S1(config-if)#duplex full  //配置全雙工

S1(config-if)#speed  100  //端口速率

S1(config-if)#mdix  auto //啓用介質檢測功能

S1(config-if)#description con to sw //在接口配置描述

S1(config-if)#

(4)配置管理地址

S1(config)#interface  vlan 1

S1(config-if)#ip address  172.168.0.100 255.255.255.0

S1(config-if)#no shut

S1(config)#ip default-gateway 172.16.0.254 

(5.)配置SSH

   S1(config)#ip domain-name ccnpcisco.com

//以上配置域名,生成祕鑰時需要

  S1(config)#crypto  key  generate  rsa  

The name for the keys will be: S1.ccnpcisco.com

Choose the size of the key modulus in the range of 360 to 2048 for your

  General Purpose Keys. Choosing a key modulus greater than 512 may take

  a few minutes.

How many bits in the modulus [512]: 

% Generating 512 bit RSA keys, keys will be non-exportable...[OK]

S1(config-line)#login  local 

//SSH需要用戶名密碼,以上配置密碼存放在本地,及交換機配置文件中

S1(config-line)#exit

S1(config)#username  test secret  cisco

//以上配置用戶名 密碼

S1(config)#

Telnet測試

R2#telnet 172.16.0.100

Trying 172.16.0.100 ...Open

User Access Verification

Username: cisco

Password: 

% Login invalid

Username: test

Password: 

S1>exit

[Connection to 172.16.0.100 closed by foreign host]

R2#

R2#

R2#ssh -l test 172.16.0.100  //ssh登陸測試

Open

Password: 

S1>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章