三层交换机配置及实验

实验要求:全网互通(pc间互通)

1、二层交换机之间做lacp链路聚合
2、R1到R4有一条链路做浮动路由

在这里插入图片描述
(1)R1配置

interface GigabitEthernet0/0/0
 ip address 192.168.80.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 12.0.0.1 255.255.255.0 
#
interface GigabitEthernet2/0/0
 ip address 13.0.0.1 255.255.255.0 
#
interface NULL0
#
ip route-static 192.168.10.0 255.255.255.0 192.168.80.254
ip route-static 192.168.20.0 255.255.255.0 192.168.80.254
ip route-static 192.168.30.0 255.255.255.0 192.168.80.254
ip route-static 192.168.40.0 255.255.255.0 192.168.80.254
ip route-static 192.168.50.0 255.255.255.0 192.168.80.254
ip route-static 192.168.60.0 255.255.255.0 192.168.80.254
ip route-static 192.168.70.0 255.255.255.0 12.0.0.2
ip route-static 192.168.70.0 255.255.255.0 13.0.0.2 preference 70
#

(2)R2配置(配置路由时,vlan10到vlan60可以看成在一个网段中)

interface GigabitEthernet0/0/0
 ip address 12.0.0.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 24.0.0.1 255.255.255.0 
#
interface NULL0
#
ip route-static 192.168.0.0 255.255.0.0 12.0.0.1
ip route-static 192.168.70.0 255.255.255.0 24.0.0.2
#

(3)R3配置(配置路由时,vlan10到vlan60可以看成在一个网段中)

#
interface GigabitEthernet0/0/0
 ip address 13.0.0.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 34.0.0.1 255.255.255.0 
#
interface NULL0
#
ip route-static 192.168.0.0 255.255.0.0 13.0.0.1
ip route-static 192.168.70.0 255.255.255.0 34.0.0.2
#

(4)R4配置(路由器R4处于网络末梢,可配置默认路由,但是由于有两个直连路由器,配置浮动路由)

interface GigabitEthernet0/0/0
 ip address 24.0.0.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 34.0.0.2 255.255.255.0 
#
interface GigabitEthernet2/0/0
 ip address 192.168.70.254 255.255.255.0 
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 24.0.0.1
ip route-static 0.0.0.0 0.0.0.0 34.0.0.1 preference 70
#

(5)SW1配置(可以看成网络末梢,出网都会经过R1,配置一条默认路由)

interface Vlanif10
 ip address 192.168.10.254 255.255.255.0
#
interface Vlanif20
 ip address 192.168.20.254 255.255.255.0
#
interface Vlanif30
 ip address 192.168.30.254 255.255.255.0
#
interface Vlanif40
 ip address 192.168.40.254 255.255.255.0
#
interface Vlanif50
 ip address 192.168.50.254 255.255.255.0
#
interface Vlanif60
 ip address 192.168.60.254 255.255.255.0
#
interface Vlanif80
 ip address 192.168.80.254 255.255.255.0
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/4
 port link-type access
 port default vlan 80
 interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 192.168.80.1
#
#

(6)SW2配置

#
interface Eth-Trunk1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
 mode lacp-static
#
interface Ethernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 10
#
interface Ethernet0/0/3
 port link-type access
 port default vlan 20
#
interface Ethernet0/0/4
 eth-trunk 1
#
interface Ethernet0/0/5
 eth-trunk 1
#
interface Ethernet0/0/6
 eth-trunk 1
#

(7)SW3配置

#
interface Eth-Trunk1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
 mode lacp-static
#
interface Eth-Trunk2
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
 mode lacp-static
#
interface Ethernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 30
#
interface Ethernet0/0/3
 port link-type access
 port default vlan 40
#
interface Ethernet0/0/4
 eth-trunk 1
#
interface Ethernet0/0/5
 eth-trunk 1
#
interface Ethernet0/0/6
 eth-trunk 1
#
interface Ethernet0/0/7
 eth-trunk 2
#
interface Ethernet0/0/8
 eth-trunk 2
#
interface Ethernet0/0/9
 eth-trunk 2
#

(8)SW4配置

#
interface Vlanif1
#
interface MEth0/0/1
#
interface Eth-Trunk2
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
 mode lacp-static
#
interface Ethernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 50
#
interface Ethernet0/0/3
 port link-type access
 port default vlan 60
#
interface Ethernet0/0/4
 eth-trunk 2
#
interface Ethernet0/0/5
 eth-trunk 2
#
interface Ethernet0/0/6
 eth-trunk 2

(9)检验
①PC1 ping PC7
在这里插入图片描述
②PC2 ping PC7
在这里插入图片描述
③PC3 ping PC7
在这里插入图片描述

④PC4 ping PC7
在这里插入图片描述

⑤PC5 ping PC7
在这里插入图片描述

⑥PC6 ping PC7

在这里插入图片描述

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值