百度空间 | 百度首页 
 
查看文章
 
交换机和路由器基本配置(一)
2007年06月26日 星期二 上午 01:19

以太网交换机

v      交换机是用来连接局域网的主要设备

          交换机能够根据以太网帧中目标地址智能的转发数据,因此交换机工作在数据链路层

          交换机分割冲突域,实现全双工通信

交换机的配置模式

v      用户模式:Switch>

v      特权模式:Switch>enable

                 Switch#

v      全局配置模式:Switch#config terminal

                     Switch(config)#

v      接口配置模式:Switch(config)#interface fa0/1

                     Switch(config-if)#

v      Line模式:Switch(config)#line console 0

                 Switch(config-line)#

配置主机名

v      Switch>en

v      Switch#conf t

v      Switch(config)# hostname Benet-sw1

v      Benet-sw1(config)#

查看交换机的配置

v      Benet-sw1(config)# show running-config

version 12.1

no service pad

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname Benet-sw1

配置enable明文口令

v      Benet-sw1(config)#enable password cisco

v      Benet-sw1(config)#exit

v      Benet-sw1#show running-config

version 12.1

no service pad

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname Benet-sw1

!

enable password cisco

!

ip subnet-zero

!

检验enable口令的作用

v      Benet-sw1# exit

   Press RETURN to get started.

v      Benet-sw1>enable

   Password:cisco

v      Benet-sw1#

配置enable加密口令

v      Benet-sw1(config)# enable secret ciscolab

v      Benet-sw1#show running-config

version 12.1

no service pad

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname Benet-sw1

!

enable secret 5 $1$e1k3$tmDh/6EG9c5enGXDjjj7j/

enable password cisco

!

检验enable加密口令的作用

v      Benet-sw1# exit

   Press RETURN to get started.

v      Benet-sw1>enable

   Password:ciscolab

v      Benet-sw1#

配置Console口令

v      Benet-sw1(config)#line console 0

v      Benet-sw1(config-line)#password 123

v      Benet-sw1(config-line)#login

v      Benet-sw1#show run

interface Vlan1

no ip address

no ip route-cache

shutdown

!

ip http server

!

line con 0

password 123

login

登录口令的输入

Switch con0 is now available

Press RETURN to get started.

User Access Verification

Password:123

Switch>en

Password:ciscolab

Switch#

配置管理用IP地址与网关

v      Benet-sw1(config)# interface vlan 1

v      Benet-sw1(config-if)# ip address 192.168.1.1 255.255.255.0

v      Benet-sw1(config-if)# no shutdown

v      Benet-sw1# show running-config

!

interface FastEthernet0/24

no ip address

!

interface Vlan1

ip address 192.168.1.1 255.255.255.0

no ip route-cache

!

ip http server

Benet-sw1(config)#ip default-gateway 192.168.1.100

查看MAC地址表

v      Benet-sw1#show mac-address-table

          Mac Address Table

-------------------------------------------

Vlan    Mac Address       Type        Ports

----          -----------             --------        -----

All    000d.28be.b640    STATIC      CPU

All    0100.0ccc.cccc     STATIC      CPU

All    0100.0ccc.cccd     STATIC      CPU

All    0100.0cdd.dddd    STATIC      CPU

1    0013.8044.ff40    DYNAMIC    Fa0/2

   1    0013.8044.ff41    DYNAMIC    Fa0/8

Total Mac Addresses for this criterion: 6

使用CDP协议

v      Benet-sw1#show cdp ?

entry          Information for specific neighbor entry

  interface      CDP interface status and configuration

  neighbors     CDP neighbor entries

  traffic        CDP statistics

  |            Output modifiers

  <cr>

v      Benet-sw1#show cdp neighbor

Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge

                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone

Device ID        Local Intrfce     Holdtme    Capability   Platform   Port ID

R1            Fas 0/19         139         R          2621XM    Fas 0/0

v      Benet-sw1#show cdp neighbors  detail

-------------------------

Device ID: R1

Entry address(es):

  IP address: 192.168.1.1

Platform: cisco 2621XM,  Capabilities: Router

Interface: FastEthernet0/19,  Port ID (outgoing port): FastEthernet0/0

Holdtime : 143 sec

Version :

Cisco Internetwork Operating System Software

IOS (tm) C2600 Software (C2600-IS-M), Version 12.2(21), RELEASE SOFTWARE (fc3)

Copyright (c) 1986-2003 by cisco Systems, Inc.

Compiled Tue 02-Dec-03 16:06 by kellmill

advertisement version: 2

Duplex: full

保存交换机的配置

v      Benet-sw1# copy running-config startup-config

v      Benet-sw1# write

Building configuration...

[OK]

恢复设备出厂默认值

v      Benet-sw1# erase startup-config

Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]

[OK]

Erase of nvram: complete

v      Benet-sw1#reload

Proceed with reload? [confirm]

VLAN概述

v      什么是VLAN

§         Virtual LAN(虚拟局域网)是物理设备上连接的不受物理位置限制的用户的一个逻辑组。

v      为什么引入VLAN

§         交换机分割了冲突域,但是不能分割广播域

§         随着交换机端口数量的增多,网络中广播增多,降低了网络的效率

§         为了分割广播域,引入了VLAN

v      VLAN的作用

§         广播控制

§         安全性

§         带宽利用

§         延迟

v      VLAN的种类

§         基于端口划分的静态VLAN

§         基于MAC地址划分的动态VLAN

Cisco交换机上静态VLAN的配置

v      配置VLAN的步骤

§         创建VLAN

§         将端口加入到相应的VLAN

§         验证

v      创建VLAN有以下2种方法

§         在全局配置模式下创建VLAN

§         进入VLAN数据库中创建VLAN


类别:交换&路由 | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu