路由器交换机各种配置

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

交换机基本计算与配置

一、交换机基本配置与级连

1.设置主机名:switch》enable;conf terminal;hostname sw1

2.配置密码:sw1(config)#enable secret ciscoa;line vty 0 15;password ciscob;login local

3.接口基本配置;sw1(config)#interface f0/1;duplex {full |half |auto};speed { }

4.管理配置:sw1(config)#int vlan 1;ip address 192.168.0.11 25

5.255.255.128;

Ip default-gateway 192.168.0.1;no shutdown

5.保存配置:copy running-config startup-config

6.交换机连接

二、单臂路由

1.在s1上建立vlan:s1(config)#vlan2;name vlan2;exit;int f0/2;

Switchport mode access;switchport access vlan2

2.在s1上建立连接路由器R1的trunk:s1(config)#int f0/1;

Switchport mode trunk;switchport trunk encap dotlq;

3. 在s1上建立连接交换机s1的trunk子接口:R1(config)#int f0/0.1;

Encapture dotlq; ip address 192.168.2.1 255.255.255.0; int f0/0.2 ;encapture dotlq;

Ip address 192.168.3.1 255.255.255.0; int f0/0; no shutdown

4在pc1和pc2上配置ip和网关;前网关为192.168.2.1后为192.168.3.1

三、第三层交换配置

1.在s1上建立vlan(同上)

2. 在s1上建立连接SR1的trunk(同上2)

3配置三层交换机SR1(config)#vlan 2; name vlan2; exit; int f0/1;

Switchpot mode trunk; switchport trunk encap dotlq; int vlan 2;

Ip address 192.168.2.1 255.255.255.0; no shutdown; int vlan 3;

Ip address 192.168.3.1 255.255.255.0; no shutdown; exit; ip routing; exit; SR1)#wr

4.检查SR1上的ip路由表:SR1#show ip route ; c 192.168.2.0 is directly connected,vlan2

5. 在pc1和pc2上配置ip和网关;前网关为192.168.2.1后为192.168.3.1

路由基本应用与配置

一、配置路由器的网络接口

n的接口配置:R2#config t; interface fastethernet 0/0; ip address 218.27.100.1

255.255.255.128; no shutdown; 配置完成后按Ctrl+Z退出配置;R2#show ip interface f0/0 R2#wr

二、配置W AN链路与路由协议

1.HDLC协议配置;R2#config t; interface serial 0/0; encapsulation hdlc; bandwidth 2048

2.ppp配置:(同HDLC)encapsulation hdlc

3.路由协议配置:默认路由配置:R2(config-ip)# ip route 0.0.0.0 0.0.0.0 218.26.121.2 静态路由配置:R1()#ip route 218.27.100.0 255.255.255 218.26.121.2

激活IP路由:R2()#ip routing

OSPF路由应用与配置

一、OSPF网络的配置

1.IP地址的分配

2.RS1~RS5交换机配置OSPF:指定互连接口“interface gigabitethernet 接口号”;至该接口

为路由模式“no switch”;设置路由接口ip地址“ip 子网地址子网掩码”;配置路由接口ip地址:(RS1(config)#router ospf 100; router-id 192.168.10.0; network 192.168.10.0 255.255.255.0 area 0; auto-cost reference-bandwidth 1000)同理配置2~5.

3.网络调试,特权模式下“show ip ospf neighbor”

二、OSPF网络的默认路由

1.在RS1上配置访问外网的默认路由:RS1(config)# interface gigabitethernet 6/1; no switch; ip address 19

2.168.1.2 255.255.255.252; ip route 0.0.0.0 0.0.0.0 192.168.1.1 1; router ospf 100; Router-id 192.168.10.0; network 192.168.1.0 255.255.255.252 area 0; network 192.168.10.0 255.255.255.252 area 0; default-information originate always

2.在边界路由器R2设置指向内网的静态路由和指向外网的路由:R2(config)# interface gigabitethernet 0/0; ip address 192.168.1.2 255.255.255.252; ip route 192.168.0.0 255.255.0.0 192.168.1.2 1; interface gigabitethernet 0/1; ip address 218.26.121.2 255.255.255.252; ip route 0.0.0.0 0.0.0.0 218.26.121.1 1

园区网VRRP+MSTP的配置

1.路由农余与负载均衡设计

2.路由交换机配置VRRP组:1)主核心设备VRRP设置:RS1(config)# interface vlan 10; Ip address 176.16.10.2 255.255.255.0; standby 1 ip 176.16.10.1; standby 1 preempt; standby 1 priority 254; interface vlan 20; ip address 176.16.20.1; standby 1 preempt; ….,同理配置RS1上其他vlan的ip、网关和vrrp优先级,还有RS2山的。。2)备份核心设备vrrp配置:interface vlan 10; Ip address 176.16.10.3 255.255.255.0; standby 1 ip 176.16.10.1; standby 1 preempt; Ip address 176.16.20.2 255.255.255.0; standby 1 ip 176.16.20.1; standby 1 priority 254; 3)主核心设备设置奇数vlan路由优先级:interface vlan 20; ip ospf cost 20; 4)备份核心设备设置偶数vlan路由优先级:interface vlan 10; ip ospf cost 20; 5) 主核心设备设置mstp路由优先级: spanning-tree mst 1 priority 4096; spanning-tree mst 2 priority 5555; 6) 备份核心设备设置mstp 路由优先级:spanning-tree mst 1 priority 5555; spanning-tree mst 2 priority 4096;

3.汇聚与接入交换机配置mstp:S1(config)# spanning-tree; spanning-tree mode mstp; spanning-tree mst configuration; instance 1 vlan 20,40; revision 1; exit ; 依次对2~6进行mstp配

4.vrrp的故障诊断与排除

策略路由配置与应用(基于ip地址的策略路由)

1.配置路由R1:R1(config)# access-list 1 permit 176.16.1.11; access-list 2 permit 176.16.1.12; route-map RULE permit 10; R1(config-route-map)# match ip address 1; set ip net-hop 176.16.1

2.1; RULE permit 20; match ip address 2; set ip next-hop 176.16.21.1; R1(config)#interface fe0/0; ip address 176.16.1.1 255.255.255.0; ip policy route-map RULE1; #interface fs0/0; ip address 176.16.12.2 255.255.255.0; #interface s1/0; ip address 176.16.21.2 255.255.255.0; router ospf 100; network 176.16.1.0 255.255.255.0; network 176.16.12.0 255.255.255.0; network 176.16.21.0 255.255.255.0;

2.配置路由器R2和R3的OSPF:R2(config)#interface fs0/0;ip address 176.16.12.1 255.255.255.0;router ospf 100;network 176.16.12.0 255.255.255.0;interface fs0/0;ip address 176.16.21.1 255.255.255.0;router ospf 100;ip address 176.16.21.1 255.255.255.0

3策略路由测试:show ip policy可显示在那些接口上应用了那些策略

相关文档
最新文档