交换技术综合网络拓扑部署

拓扑图:

 

实验说明:

综合目前所学搭建一个交换技术综合性的网络拓扑实验

 

实验环境: 

GNS3模拟器

SecureCRT终端管理

 

实验知识点:

vlan,eth-channel,trunk,vtp,stp,svi,vrrp,dhcp

二三层设备配置ip地址,编写静态路由(浮动路由),设置远程登录

实验步骤:

1.配置eth-channel 链路捆绑

可以将两设备间多条链路进行逻辑捆绑,以提高传输效率。只有高于10M的相同带宽的链路才能进行捆绑

设备:MU-SW1,MU-SW2,SW1,SW2

配置命令:

conf t     

int r f0/0 -1

no sh

channel-group 1 mode on

exit

int r f0/2  -3

no shutdown

channel-group 2 mode on

exit

int r f0/4 -5

no sh

channel-group 1 mode on

exit

2.配置trunk

trunk 中继干道,能承载所有的vlan流量,并对vlan的流量进行标记

设备:MU-SW1,MU-SW2,SW1,SW2

配置命令:

MU-SW1,MU-SW2,SW1,SW2:

conf t

int portchannel 1

switchport mode trunk

int portchannel 2

switchport mode trunk

int portchannel 3

switchport mode trunk

 

3.vtp配置以及添加vlan

vtp(vlan trunkl protocol) 

用于管理vlan,分三种模式:服务器模式,客户端模式,转发模式。其中只有服务器模式发送报文,其他模式只能转发。

设备:MU-SW1,MUSW2,SW1,SW2

配置命令

MU-SW1:

vlan database

vtp domain yy                        //域名

vtp password 123                  //密码

vtp server

 

MUSW2,SW1,SW2:

vlan database

vtp domain yy

vtp password 123              //域名和密码都相同才能添加进同一个vtp中

vtp client

 

MU-SW1:

vlan database

vlan 10

vlan 20

 

SW3:

vlan database

vlan 30

vlan 40

vlan 888

 

 

4.stp配置

spanning-tree protocol 生成树协议,用于堵塞某个端口,以防止二层环路

设备:MU-SW1,MU-SW2

配置命令:

MU-SW1:

conf t

spanning-tree vlan 10 root pri                 //MU-SW1作为vlan10主根

spanning-tree vlan 20 root se                 //MU-SW1作为vlan20备份根

MU-SW2:

conf t

spanning-tree vlan 20 root pri                //MU-SW2作为vlan20主根

spanning-tree vlan 10 root se                //MU-SW2作为vlan20主根

 

5.添加SVI,三层通信

switch virtual interface 三层交换机配置vlan后,可以给vlan一个ip地址,这个vlan接口就可以称为SVI,通过SVI,实现三层通信

设备:MU-SW1,MU-SW2

配置命令:

MU-SW1:

int vlan 10

ip add 192.168.1.252  255.255.255.0

int vlan 20 

ip add 192.168.2.252 255.255.255.0

MU-SW2:

int vlan 10

ip add 192.168.1.253 255.255.255.0

int vlan 20 

ip add 192.168.2.253 255.255.255.0

 

6.配置DHCP

DHCP 动态主机配置协议 ,动态地给主机分配IP地址和网关

设备:MU-SW1,MU-SW2

MU-SW1:

conf t

ip dhcp pool VLAN10   //添加dhcp池

netw 192.168.1.0 255.255.255.0

default-gateway 192.168.1.254

dns 114.114.114.114

ip dhcp pool VLAN20

netw 192.168.2.0 255.255.255.0

default-gateway 192.168.2.254

dns 114.114.114.114

exit

ip ex 192.168.1.128 192.168.1.254

ip ex 192.168.1.1 192.168.1.127

 

MU-SW2:

conf t

ip dhcp pool VLAN10   //添加dhcp池

netw 192.168.1.0 255.255.255.0

default-gateway 192.168.1.254

dns 114.114.114.114

ip dhcp pool VLAN20

netw 192.168.2.0 255.255.255.0

default-gateway 192.168.2.254

dns 114.114.114.114

exit

ip ex 192.168.1.128 192.168.1.254

ip ex 192.168.1.1 192.168.1.127

 

SW3:

ip dhcp pool VLAN30

netw 192.168.3.0 255.255.255.0

default-gateway 192.168.3.254

dns 114.114.114.114

ip dhcp pool VLAN40

netw 192.168.4.0 255.255.255.0

default-gateway 192.168.4.254

dns 114.114.114.114

 

7.配置vrrp

vrrp(虚拟路由冗余协议)将多台路由设备的网关合并成同一个虚拟网关

设备:MU-SW1,MU-SW2

MU-SW1:

conf t

track 1 interface FastEthernet0/6 line-protoco

exit

int vlan 10

vrrp 10 ip 192.168.1.254

vrrrp 10 priority 200

 vrrp 10 track 1 decrement 150

exit

int vlan 20 

vrrp 20 ip 192.168.2.254

 

MU-SW1:

conf t

track 2 interface FastEthernet0/6 line-protoco

exit

int vlan 10

vrrp 10 ip 192.168.1.254

exit

int vlan 20 

vrrp 20 ip 192.168.2.254

vrrrp 20 priority 200

 vrrp 20 track 2 decrement 150

 

8.子接口

单臂路由,需要多个接口,以进行vlan间通信

设备:R3

conf t

int f1/0

no sh

int f1/0.30

no sh

en do 30

ip add 192.168.3.254 255.255.255.0

int f1/0.40

no sh

en do 40

ip add 192.168.4.254 255.255.255.0

int f1/0.888

no sh

en do 888

ip add 8.8.8.254 255.255.255.0

 

8.主机DHCP和静态地址配置

模拟器DHCP协议主机的配置和静态分配地址

设备:PC1-7

PC1-6:

conf t

no ip routing

int f0/0

no sh

ip add dhcp

 

PC7:

conf t

int f0/0

no sh

ip add 8.8.8.8 255.255.255.0

exit

no ip routing 

ip default-gateway  8.8.8.254

 

SW1:

conf t

no ip routing

in vlan 10

ip add dhcp                  //开放ip地址,用以实现管理员PC的远程登录

 

SW2:

conf t

no ip routing

int vlan 20

8.静态路由

在路由器上手动添加路由信息,管理距离为1

设备:

MU-SW1,MU-SW2,R1,R2,R3

MU-SW1:

conf t

int f0/6

no sh

no sw

ip add 10.1.1.1 255.255.255.0

exit

ip route 0.0.0.0 0.0.0.0 10.1.1.2

 

MU-SW2:

conf t

int f0/6

no sh

no sw

ip add 10.1.2.1 255.255.255.0

exit

ip route 0.0.0.0 0.0.0.0 10.1.2.2

 

R1:

int f0/0

no sh

ip add 10.1.1.2 255.255.255.0

int f1/0

no sh

ip add 10.1.2.2 255.255.255.0

int f2/0

no sh

ip add 10.1.3.1 255.255.255.0

exit

ip route 192.168.1.0 255.255.255.0 10.1.1.1

ip route 192.168.1.0 255.255.255.0 10.1.1.2 100

ip route 192.168.2.0 255.255.255.0 10.1.2.1

ip route 192.168.2.0 255.255.255.0 10.1.1.1 100

ip route 10.1.4.0 255.255.255.0 10.1.3.2

ip route 10.1.4.0 255.255.255.0 10.1.3.2

ip route 192.168.3.0 255.255.255.0 10.1.3.2

ip route 192.168.4.0 255.255.255.0 10.1.3.2

 

R2:

conf t

int f0/0

no sh

ip add 10.1.3.2 255.255.255.0

int f1/0

no sh

ip add 10.1.4.1 255.255.255.0

exit

ip route 192.168.1.0 255.255.255.0 10.1.3.1

ip route 192.168.2.0 255.255.255.0 10.1.3.1

ip route 10.1.1.0 255.255.255.0 10.1.3.1

ip route 10.1.2.0 255.255.255.0 10.1.3.1

ip route 192.168.3.0 255.255.255.0 10.1.4.2

ip route 192.168.4.0 255.255.255.0 10.1.4.2

 

R3:

conf t

int f0/0

no sh

ip add 10.1.4.2 255.255.255.0

exit

ip route 0.0.0.0 0.0.0.0 10.1.4.0

 

9.添加远程登录接口

设备:除了管理员主机的其他设备

命令:

username cisco secret cisco
line vty 0 15
login local

 

实验排错:

1.先查找PC有没有IP地址(接口没有开启,没有配置ip地址)

命令:

特权模式下

show ip int br
2.看和pc相连的二层交换机接口的配置(有没有vlan,vlan划分的对不对,trunk是不是好的)

命令:

show ip int br

show int tr

show vlan-sw
  在GNS3里,二层交换机如果要实现远程登陆的话,需要关闭路由功能并配置网关地址

命令:

show ip route
3.三层交换机(有没有vlan,trunk状态对不对,链路捆绑,生成树,svi,vrrp,dhcp,必要时需要开启路由功能)

命令:

show vlan-sw

show int tr

show eth sum

show ip int br

show sp br

show vrrp br

show ip dhcp pool

show ip dhcp binding


4.路由器(接口ip地址和接口状态对不对,查看路由表)

命令:

show ip int br

show ip route

实验总结:

该实验分层进行:

首先完成交换机和主机的配置,有链路捆绑的优先完成。然后进行vlan的相关配置,如添加vtp,stp.dhcp.svi,vrrp等,然后完成作左边交换机的子接口,dhcp配置。完成静态路由表的添加,就可以实现所有节点的相互连通,最后在设备上添加远程登录的虚拟接口,配置账户密码,还有特权,全局模式的密码就可以实施远程登录操作设备。
 

 

 

  • 1
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值