荣耀彩票代理

IT技术互动交流平台

CCNA网络工程师学习进程(6)vlan相关协议的配置与路由器简单配置介绍

作者:MenAngel  来源:IT165收集  发布日期:2016-12-16 20:35:46

    前面已经介绍了大部分与vlan技术相关的交换机的协议的配置,更深层次的还有STP协议和以太网端口聚合技术,接着还会简单介绍一下路由器的基本应用。

    (1)STP(Spanning-tree Protocol)

    问题引入:

  荣耀彩票代理  在由交换机构成的局域网络中通常设计有冗余链路和设备。这种设计的目的是防止一个点的失败导致整个网络功能的丢失。虽然冗余设计可能消除的单点失败问题,但也导致了回路的产生,它会带来如下问题:

1 广播风暴  
2 同一帧的多份拷贝
3 不稳定的MAC地址表

    1)STP的简单介绍:

    荣耀彩票代理生成树协议,又称扩展树协定,是一基于OSI网路模型的数据链路层(第二层)通讯协定,用作确保一个无回圈的区域网络环境。通过有选择性地阻塞网络冗余链路来达到消除网络二层环路的目的,同时具备链路的备份功能。

荣耀彩票代理    STPYONGYUJIEJUEJUYUWANGDEHUANLUWENTI,TATONGGUOZAIJIAOHUANJIZHIJIANSHIXINGRONGYULIANJIEDETONGSHI,BIMIANWANGLUOHUANLUDECHUXIAN,SHIXIANWANGLUODEGAOKEKAOXING。

    STP的配置命令:

  

    DANGJUYUWANGZHONGYOUDUOGEVLANBINGQIETrunkLIANLUFUZAIGUOZHONGSHI,KENENGXUYAOHUAFENDUOGETrunkDUANKOUSHIXINGFUZAIFENDAN(JUNHENG),ERSTPNENGGOUJIEJUEYOUCICHANSHENGDEHUANLUWENTI。DANGTONGYITAIJIAOHUANJIDELIANGGEKOUXINGCHENGHUANLUSHI,STPDUANKOUQUANZHIYONGLAIJUEDINGNAGEKOUSHIJIAOHUANZHUANGTAIDE,NAGEKOUSHIZUDUANZHUANGTAIDE。(STPDUANKOUQUANZHISHIXIANFUZAIJUNHENG)

    交换机的端口状态:

关闭(disable): 端口处于管理关闭状态
阻塞(blocking): 不能转发用户数据
监听(listening): 接口开始启动
学习(learning): 学习MAC地址, 构建MAC表进程项
转发(forwarding): 可以转发用户数据   

    ZAIPacketTracerMONIQIZHONG,JIAOHUANJIMORENQIYONGSHENGCHENGSHUXIEYI,CHENGSEDEDUANKOUBIAOMINGCHUZAIZUSAIZHUANGTAI。

  

    2)STA(Spanning Tree Algorithm)算法:

    IEEE802.1D标准定义了STP的生成树算法。该算法依赖于BID路径开销端口ID参数:

    SHENGCHENGSHUXIEYIDESUANFAGUOCHENG:

  生成树协议的算法过程可以归纳为三个步骤:选择根网桥、选择根端口、选择指定端口。  
(1)选择根网桥:在全网中选择一个根网桥
  比较网桥的BID值,值越小其优先级越高。ID值是由两部分组成的:交换机的优先级和MAC地址组成的,如果交换机的优先级相同则比较其MAC地址,地址值越小,其就被选举为根网桥;  
(2)选择根端口:在每个非根交换机上选择根端口
  首先,比较根路径成本,根路径成本取决于链路的带宽,带宽越大,路径成本越低,则选该端口为根端口。其次,如果根路径成本相同,则要比较所在对端交换机BID值,值越小,则其优先级越高。最后,比较端口的ID值,该值分为两部分:端口优先级和端口编号,
值小的被选为根端口;
(3)选择指定端口:在每条链路上选择一个指定端口,根网桥上所有端口都是指定端口  
  首先,比较根路径成本,其次,比较端口所在网桥的ID值,最后,比较端口的ID值。

    BPDU(Bridge Protocol Data Unit):

荣耀彩票代理    WANGQIAOXIEYISHUJUDANYUANSHIYIZHONGSHENGCHENGSHUXIEYIWENHOUSHUJUBAO,TAYIKEPEIZHIDEJIANGEFACHU,YONGLAIZAIWANGLUODEWANGQIAOJIANJINXINGXINXIJIAOHUAN。

  

    BID(Bridge ID):

荣耀彩票代理    BIDYOUYOUXIANJI,FASONGJIAOHUANJIDEMacDIZHIHEKUOZHANXITONGID(KEXUAN)ZUCHENG。LIANGTAIJIAOHUANJIDEYOUXIANJIKENENGXIANGTONG,DANMacDIZHIBUXIANGTONG,QUEBAOLEBIDDEWEIYIXING。ERKUOZHANXITONGIDDEMUDESHIWEILEJIEYUEMacDIZHI。

    不使用扩展系统ID时:(版本老,因此在dynamips中完成):

    BID=YOUXIANJI(16GEZIJIE)+MacDIZHI(48GEZIJIE)

    KAIQISW1,BINGPEIZHIJIAOHUANJI,BINGYONGshow spanning-tree brief MINGLINGCHAKANGEvlanXIAJIAOHUANJIDEBID:(ZAIZHENSHIJISHANGSHIYONGshow spanning-tree)

en
vlan database
vlan 10 name vlan10
exit
conf t
host SW1
int f1/1
switchport mode access
switchport access vlan 10
exit

荣耀彩票代理    vlan 10DEMacDIZHISHIvlan 1DEMacDIZHI+1。

    使用扩展系统ID:

荣耀彩票代理    BID=YOUXIANJI(4GEZIJIE)+KUOZHANXITONGID(12GEZIJIE,KEYIKANZUOvlan ID)+MacDIZHI(48GEZIJIE)。

  

荣耀彩票代理    ZAIZUOCEJIAOHUANJICHAKANBID:

  

   CONGRoot ID=vlan 1DEBIDKEYIKANCHUCIJIAOHUANJISHIvlan 1DEGENJIAOHUANJI,YUTUZHONGXIANSHIYIZHI。

荣耀彩票代理   ZAIJIAOHUANJISHANGCHUANGJIANvlan 10HEvlan 20,JIANGZUOCEJIAOHUANJISHEZHIWEIvlan 10DEGENJIAOHUANJI,YOUCEJIAOHUANJISHEZHIWEIvlan 20DEGENJIAOHUANJI:

   拓展知识荣耀彩票代理:在网络中如果我想要更改根交换机,可以用下述方法:

1.在没有扩展系统ID的情况下:
spanning-tree vlan 1 priority 0-65535
2.在有扩展系统ID的情况下:
spanning-tree vlan 1 priority 0-4096

荣耀彩票代理    SW1DEPEIZHIMINGLING:

en
conf t
host SW1
vlan 10
name vlan10
vlan 20
name vlan20
exit
int f0/3
switchport mode access
switchport access vlan 10
int range f0/1-2
switchport mode trunk
switchport trunk allowed vlan all
end
conf t
spanning-tree vlan 10 priority root
end

    SW2DEPEIZHIMINGLING:

en
conf t
host SW2
vlan 10
name vlan10
vlan 20
name vlan20
exit
int f0/3
switchport mode access
switchport access vlan 20
int range f0/1-2
switchport mode trunk
switchport trunk allowed vlan all
end
conf t
spanning-tree vlan 20 priority 4096
end

  

荣耀彩票代理    LIANGGEJIAOHUANJIDESTPXIEYIPEIZHIQINGKUANG:

  

    路径开销:

    DUANKOUHUAFEIMORENHEDUANKOUDEDAIKUANYOUGUAN,LUJINGHUAFEIDENGYUGENJIAOHUANJIDAOZUIZHONGJIAOHUANJIQIANJINFANGXIANGDEDUANKOUHUAFEIZONGHE。

    DUANKOUHUAFEIDECANKAOZHI:

 

荣耀彩票代理    ZAIXUANQUGENDUANKOUDEGUOCHENGZHONG,XIUGAIDUANKOUHUAFEI:

int f0/1
spanning-tree cost 1-65536

荣耀彩票代理    DANGSTAJUEDINGSHIYONGYITIAOLUJINGZHIHOU,STAPEIZHIJIAOHUANJIDEDUANKOUJIAOSE,DUANKOUDEJIAOSEMIAOSHULETAYUGENQIAODEGUANXIHESHIFOUYUNXUZHUANFALIULIANG:

1.RP根端口 :  非根交换机上离根交换机最近的端口(在该端口所在路径的花费最小),每个非根交换机有且仅有一个。
2.DP指派端口:  每个网段都有一个指派端口,该端口指该网段到跟交换机最近的交换机上的端口
3.非指派端口:  既不是根端口也不是指派端口
4.禁用端口:    被shutdown的端口

荣耀彩票代理    PID=DUANKOUYOUXIANJI+DUANKOUHAO:

荣耀彩票代理    XIUGAIDUANKOUYOUXIANJI:

int f0/1
spanning-tree port-priority 0-255

    XUANQUGENDUANKOU:

1.比较花费,花费小的将成为根派端口;
2.在花费相同的情况下比较发送者的BID;
3.在发送者BID相同的情况下比较发送者的PID;
4.在前面都相同的基础上比较接收者的PID;

    XUANQUZHIPAIDUANKOU:

1.比较花费,花费小的成为指派端口;
2.比较BID,BID小的成为指派端口;
3.交换机上PID小的成为指派端口;

荣耀彩票代理    3)PEIZHISHILI:

    1.3.1SHENGCHENGSHUDEXUANJU:

  

    SHENGCHENGSHUDEXUANJUGUOCHENG:

1.比较三台交换机BID:由于优先级相同,mac地址小的将成为根交换机;
2.对于SW2来说,由于路径花费相同,发送者的BID也相同,而下面链路的发送者的PID(f0/1端口)较小,因此下面的端口为根端口;
3.对于SW3来说,左侧端口的路径花费较小,因此左侧端口成为根端口;
4.对于网段三,由于路径花费相同,SW2的BID小,因此f0/3将成为根端口;

荣耀彩票代理    1.3.2STPXIEYISHIXIANvlanDEFUZAIJUNHENG,BAOKUOSTPDUANKOUQUANZHIHELUJINGQUANZHILIANGZHONGFANGSHI:

  

    ZAISW1HESW2SHANGJINXINGCHUSHIvlan PEIZHI:(SW1HESW2PEIZHIMINGLINGXIANGTONG)

en
conf t
host SW1
vlan 10
name vlan10
vlan 20
name vlan20
int f0/1
switchport mode access
switchport access vlan 10
int f0/2
switchport mode access
switchport access vlan 20
int range g0/1-2
switchport mode trunk
switchport trunk allowed vlan all
end

    STPDUANKOUQUANZHISHIXIANvlanDEFUZAIJUNHENG:

en
conf t
int g0/1
spanning-tree vlan 1,10 port-priority 16
int g0/2
spanning-tree vlan 20 port-priority 16
end

荣耀彩票代理    STPLUJINGQUANZHISHIXIANvlanDEFUZAIDEFUZAIJUNHENG:(PacketTracer BUZHICHI,XUYAOZAIdynamipsZHONGSHIXIAN)

en
conf t
int g0/1
spanning-tree vlan 1,10 cost 38
int g0/2
spanning-tree vlan 20 cost 38
end

    (2)交换机端口聚合:

荣耀彩票代理    DUANKOUJUHEYEJIAOZUOYITAITONGDAO(Ethernet Channel),ZHUYAOYONGYUJIAOHUANJIZHIJIANLIANJIE。JIAOHUANJINENGBAYIZUWULIDUANKOULIANHEQILAI,ZUOWEIYIGELUOJIDETONGDAO,YEJIUSHIchannel-group。

    DUANKOUHUIJUKEYIFENWEISHOUGONGHUIJU、JIYUIEEE 802.3adBIAOZHUNDELACP(Link Aggregation Control Protocol,LIANLUJUHEKONGZHIXIEYI)HESIKESIYOUDEPAgP(Port Aggregation Protocol,DUANKOUJUHEXIEYI)。

    配置实例:

    ZAITUZHONGJIAOHUANJISHANGPEIZHILIANGTIAOYITAIWANGXINDAO,MEILIANGGEDUANKOUZUCHENGYIZU,YOULIANGGEvlan 10,20BINGQIEBUTONGvlanYOUXIANTONGGUOBUTONGDEZU。

  

荣耀彩票代理    SW1HESW2DEPEIZHIMINGLING:

conf t
host SW1
vlan 10
exit
vlan 20
exit
interface f0/1
switchport mode access
switchport access vlan 10
interface f0/2
switchport mode access
switchport access vlan 20
exit
int range f0/21-24
switchport mode trunk
switchport trunk allowed vlan all
exit
interface port-channel 1
switchport mode trunk
switchport trunk allowed vlan all 
no shutdown
exit
interface range f0/21-22 
channel-group 1 mode on 
no shutdown
exit
interface port-channel 2
switchport mode trunk
switchport trunk allowed vlan all
no shutdown
exit
interface range f0/23-24
channel-group 2 mode on 
no shutdown
exit

    XIANZAIJIAOHUANJISHANGSHURUMINGLINGHOULIANJIELIANGTAIJIAOHUANJI:

  

    PEIZHISTPSHIXIANFUZAIJUNHENG:

  SW1HESW2DEPEIZHI:

en
conf t
interface port-channel 1
spanning-tree vlan 1,10 port-priority 16
exit
interface port-channel 2
spanning-tree vlan 20 port-priority 16
exit
end

  

    PEIZHIDEZUIZHONGXIAOGUO:

  

    在之前做过三层交换机以太网端口聚合相关配置,现在做两层交换机的配置发现还是有区别的:三层交换机在逻辑端口需要封装协议:switchport trunk encapsulation dot1q.

    (3)路由器的简单介绍及简单配置:

    LUYOUQISHIYINTEWANGDEZHUYAOJIEDIANSHEBEI,QIZHUYAOZUOYONGSHIJINXINGLUYOUJISUAN,JIANGBAOWENCONGYIGEWANGLUOZHUANFADAOLINGYIGEWANGLUO。DANGLUYOUBIAOZHONGYOUDUOGELUYOUXINXIYUMUBIAOWANGLUOPIPEISHI,ZEZUNXUNZIWANGYANMAZUIZHANGPIPEIYUANZE(JIXUANZEPIPEIDEZUIXIAOFANWEIZIWANG)JINXINGLUYOU。

荣耀彩票代理    LUYOUQICHANGCHANGYONGYUJIANGYONGHUDEJUYUWANGLIANRUGUANGYUWANG,YINCIHENDUOLUYOUQIJIYOUPUTONGDEYITAIWANGLUODUANKOU,YOUYOUCHUANXINGDUANKOU(YONGYULIANJIEGUANGYUWANGSHEBEI)。

    DUANKOUPEIZHIHELUYOUPEIZHISHILUYOUQIZUIZHUYAODEPEIZHINEIRONG。DUANKOUPEIZHIBAOKUOPUTONGYITAIWANGLUODUANKOUDEPEIZHIHECHUANXINGDUANKOUDEPEIZHI。

    路由配置包括静态路由配置、默认路由配置和动态路由配置

    1)以太网端口的配置:

    PEIZHIDUANKOUDEMINGLING:

  

    2)串行端口的配置:

    LUYOUQICHUANXINGDUANKOUCHANGYONGDEPEIZHIMINGLING:

  

荣耀彩票代理    DCEYUDTE:

荣耀彩票代理    TONGBUCHUANXINGDUANKOUDETONGBUSHIZHONGXINHAOSHIYOUDCE(SHUJUTONGXUNSHEBEI,RUmodem)TIGONGDE。MORENQINGKUANGXIA,LUYOUQICHUANXINGDUANKOUCHONGDANGDTE。RUGUOCHAKANDAOGAIDUANKOUSHIDTE(SHUJUZHONGDUANSHEBEI,RUJISUANJI)LEIXING,BUBIPEIZHITONGBUSHIZHONGCANSHU;RUGUOCHAKANDAODUANKOUSHIDCELEIXING,JIUBIXUYONGMINGLINGZHIDINGSHIZHONGPINLVLAIPEIZHICHENGDCEDUAN。ZAICHUANXINGDUANKOULIANJIEZHONG,ZUOWEIDCEDEYIDUANBIXUYAOWEILIANJIEDELINGYIDTETIGONGSHIZHONGXINHAO。

    HDLC:

    LUYOUQICHUCHANGSHI,MORENDECHUANKOUFENGZHUANGXIEYISHIHDLC(QUANCHENGHigh level Data Link Control,GAOJISHUJULIANLUKONGZHI)。HDLCSHIMIANXIANGBITEDESHUJULIANLUKONGZHIXIEYI,TABUYILAIYURENHEYIZHONGZIFUBIANMAJI;SHUJUBAOWENKETOUMINGCHUANSHU,YONGYUSHIXIANTOUMINGCHUANSHUDE“0BITECHARUFA”YIYUYINGJIANSHIXIAN;QUANSHUANGGONGTONGXIN,YOUJIAOGAODESHUJULIANLUCHUANSHUXIAOLV;SUOYOUZHENCAIYONGCRCJIANYAN,DUIXINXIZHENJINXINGSHUNXUBIANHAO,KEFANGZHILOUSHOUHUOZHONGFEN,CHUANSHUKEKAOXINGGAO;CHUANSHUKONGZHIGONGNENGYUCHULIGONGNENGFENLI,JUYOUJIAODALINGHUOXING。

    PEIZHISHILI:

  

    DCEDUANDEPEIZHI:

en
conf t
int s0/0/0
ip add 192.168.1.1 255.255.255.0
clock rate 9600
bandwidth 64
no shut

    DTEDUANDEPEIZHI:

en
conf t
int s0/0/0
ip add 192.168.1.2 255.255.255.0
bandwidth 64
no shut

  可能出现的错误:

  

  JIEJUEFANGFA:CHUXIANZHEIZHONGXIANXIANGSHIYOUYUZAIDTEDUANPEIZHILESHIZHONGPINLV,YONGDCEHUODTECHUANKOUXIANLIANJIELUYOUSHEBEISHIYIDINGYAOZHUYIFENQINGNAGESHIDCEDUAN,NAGESHIDTEDUAN。

实验文档下载: http://files.cnblogs.com/files/MenAngel/NetBlog6.zip

Tag标签:         
  • 专题推荐

About IT165 - 广告服务 - 隐私声明 - 版权申明 - 免责条款 - 网站地图 - 网友投稿 - 联系方式
本站内容来自于互联网,仅供用于网络技术学习,学习中请遵循相关法律法规