小型三层架构的搭建

该实验涉及创建VLAN、设置接口工作模式(trunk和access),将接口分配至VLAN,配置VLANIP地址,建立DHCP地址池,以及使用OSPF协议在三层交换机间共享路由。实验设备包括lsw1-lsw4,各交换机配置了不同VLAN及相应的IP地址,并通过trunk接口连接。DHCP配置用于自动分配下挂设备的IP地址,OSPF实现了路由信息的交换。
摘要由CSDN通过智能技术生成

实验要求及拓扑

一、思路

1.创建vlan及配置接口工作模式(trunk、access)

2.给接口划分到那个vlan或者放通那个vlan

3.给三层交换机的vlan配置IP地址(相当于给vlan所在物理接口配置IP地址)

4.配置地址池给底下电脑分配IP

5.使用ospf共享三层交换机所有路由

二、操作

1.创建vlan及配置接口工作模式(trunk、access)及给接口划分到那个vlan或者放通那个vlan

lsw1:

vlan batch 2 to 4

interface Ethernet0/0/1
 port link-type access
 port default vlan 4
interface Ethernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 2 to 3

lsw2:

vlan batch 2 to 4

interface Ethernet0/0/1
 port link-type access
 port default vlan 4
interface Ethernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 2 to 3

lsw3:

vlan batch 2 to 3

interface Ethernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 3
interface Ethernet0/0/2
 port link-type access
 port default vlan 2
interface Ethernet0/0/3
 port link-type access
 port default vlan 3

lsw4:

vlan batch 2 to 3

interface Ethernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 3
interface Ethernet0/0/2
 port link-type access
 port default vlan 2
interface Ethernet0/0/3
 port link-type access
 port default vlan 3

2.给三层交换机的vlan配置IP地址(相当于给vlan所在物理接口配置IP地址)

lsw1:

interface Vlanif2
 ip address 192.168.0.33 255.255.255.224
interface Vlanif3
 ip address 192.168.0.65 255.255.255.224

lsw2:

interface Vlanif2
 ip address 192.168.0.97 255.255.255.224
interface Vlanif3
 ip address 192.168.0.129 255.255.255.224

3.配置地址池给底下电脑分配IP

lsw1:

dhcp enable

ip pool vlan2
 gateway-list 192.168.0.33
 network 192.168.0.32 mask 255.255.255.224
ip pool vlan3
 gateway-list 192.168.0.65
 network 192.168.0.64 mask 255.255.255.224

interface Vlanif2
 dhcp select global
interface Vlanif3
 dhcp select global

lsw2:

dhcp enable

ip pool vlan2
 gateway-list 192.168.0.97
 network 192.168.0.96 mask 255.255.255.224
ip pool vlan3
 gateway-list 192.168.0.129
 network 192.168.0.128 mask 255.255.255.224

interface Vlanif2
 dhcp select global
interface Vlanif3
 dhcp select global

4.使用ospf共享三层交换机所有路由

lsw1:

ospf 1 router-id 1.1.1.1
 area 0.0.0.0
  network 0.0.0.0 255.255.255.255

lsw2:

ospf 1 router-id 2.2.2.2
 area 0.0.0.0
  network 0.0.0.0 255.255.255.255

三、验证

1.看路由表

2.电脑IP分配情况

3.ping

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值