数通基本实验

单臂路由实验
  • 实验拓扑:
  • 实验配置(核心):
dockerfile 复制代码
// 路由器使用子接口
enable
configure terminal
! 物理接口关闭IP,开启no shutdown
interface Ethernet0/0
 no ip address
 no shutdown
exit

! 子接口E0/0.10 对应VLAN10,802.1Q封装
interface Ethernet0/0.10
 encapsulation dot1Q 10
 ip address 192.168.10.1 255.255.255.0
exit

! 子接口E0/0.11 对应VLAN11
interface Ethernet0/0.11
 encapsulation dot1Q 11
 ip address 192.168.11.1 255.255.255.0
exit

! 路由器管理网段(VLAN8 native)
interface Ethernet0/0
 ip address 192.168.8.129 255.255.255.128
exit
  • 注意事项:本征vlan的配置sw tr native vl 8
DHCP中继
  • 实验拓扑:
  • 实验配置:
dockerfile 复制代码
// 三层交换机做中继
! 管理Vlan8 中继(交换机管理地址自动获取可选)
interface Vlan8
 ip address 192.168.8.129 255.255.255.128
 ip helper-address 192.168.12.100
 no shutdown
exit

! Vlan10 用户网段,配置中继
interface Vlan10
 ip address 192.168.10.1 255.255.255.0
 ip helper-address 192.168.12.100
 no shutdown
exit

! Vlan11 用户网段,配置中继
interface Vlan11
 ip address 192.168.11.1 255.255.255.0
 ip helper-address 192.168.12.100
 no shutdown
exit

! Vlan12 服务器网段,无需中继(服务器同网段)
interface Vlan12
 ip address 192.168.12.1 255.255.255.0
 no shutdown
exit


// 服务器:
service dhcp
ip dhcp pool VLAN10
 network 192.168.10.0 255.255.255.0
 default-router 192.168.10.1
 dns-server 223.5.5.5
exit
ip dhcp excluded-address 192.168.10.1 192.168.10.9

ip dhcp pool VLAN11
 network 192.168.11.0 255.255.255.0
 default-router 192.168.11.1
 dns-server 223.5.5.5
exit
ip dhcp excluded-address 192.168.11.1 192.168.11.9 // 排除1-9分发地址
  • 注意事项:dhcp中继用于大规模需要用到dhcp的场景
VRRP实验
  • 实验拓扑:
  • 实验配置:
dockerfile 复制代码
enable
configure terminal
! 开启单臂物理口
interface Ethernet0/0
 no ip address
 no shutdown
exit
! ========== VLAN8 原生VLAN,VRRP组8,主网关 ==========
interface Ethernet0/0
 ip address 192.168.8.130 255.255.255.128
 vrrp 8 ip 192.168.8.129    ! 虚拟网关VIP
 vrrp 8 priority 120        ! 优先级120 > RT6的100,为主
 vrrp 8 preempt             ! 故障恢复后自动抢回主角色
exit
! ========== VLAN10 子接口,VRRP组10,主网关 ==========
interface Ethernet0/0.10
 encapsulation dot1Q 10
 ip address 192.168.10.2 255.255.255.0
 vrrp 10 ip 192.168.10.1
 vrrp 10 priority 120
 vrrp 10 preempt
exit
! ========== VLAN11 子接口,VRRP组11,备份网关 ==========
interface Ethernet0/0.11
 encapsulation dot1Q 11
 ip address 192.168.11.2 255.255.255.0
 vrrp 11 ip 192.168.11.1
 ! 默认优先级100,低于RT6的120,作为备份
 vrrp 11 preempt
exit
write memory
  • 注意事项:在vrrp没有配置好之前pc是ping不通的因为没有能用的网关。
VRRP+MSTP组网实验
  • 实验拓扑:在上一个实验的基础上加一个交换机互联。
  • 实验配置:
dockerfile 复制代码
enable
configure terminal
! 切换生成树模式为MST
spanning-tree mode mst
spanning-tree mst configuration

! 和SW3完全相同的区域参数(关键!不一致会分割区域)
 name MST-AREA
 revision 1
 instance 1 vlan 10
 instance 2 vlan 11
exit

! SW4作为实例2主根,实例1备份根,实现负载分担
spanning-tree mst 2 root primary
spanning-tree mst 1 root secondary

! 全局优化
spanning-tree portfast default
spanning-tree portfast bpduguard default

! Trunk端口关闭PortFast
interface range Fa0/1,Fa0/3
 spanning-tree portfast disable
 spanning-tree guard root
exit
write
  • 注意事项:
OSPF单区域实验
  • 实验拓扑:
  • 实验配置:
dockerfile 复制代码
enable
conf t
! 对接L3SW3
interface GigabitEthernet0/0
 no switchport
 ip address 192.168.1.2 255.255.255.252
 no shutdown
exit
! 对接L3SW5
interface GigabitEthernet0/1
 no switchport
 ip address 192.168.1.5 255.255.255.252
 no shutdown
exit
! OSPF
router ospf 1
 router-id 4.0.0.0
 network 192.168.1.0 0.0.0.3 area 0
 network 192.168.1.4 0.0.0.3 area 0
 ! 所有互联口都需要建立邻居,不配置passive
exit
  • 注意事项:ip地址可以标注在图上,不然宣告网段的时候比较麻烦
OSPF多区域实验
  • 实验拓扑:
  • 实验配置(核心):
dockerfile 复制代码
enable
conf t
! Area1 下联L3SW2
interface GigabitEthernet0/0
 no switchport
 ip address 10.1.1.5 255.255.255.252
 no shutdown
exit
! Area1 上联Router7
interface GigabitEthernet0/2
 no switchport
 ip address 10.1.1.9 255.255.255.252
 no shutdown
exit
! Area0 上联Router5(骨干)
interface GigabitEthernet0/1
 no switchport
 ip address 10.2.1.1 255.255.255.252
 no shutdown
exit
! OSPF ABR配置
router ospf 1
 router-id 3.3.3.3
 ! Area1网段
 network 10.1.1.4 0.0.0.3 area 1
 network 10.1.1.8 0.0.0.3 area 1
 ! Area0骨干网段
 network 10.2.1.0 0.0.0.3 area 0
exit
write //其余类似
  • 总结一下,在实验中遇到最多的问题是关于物理机网卡的问题,有时候涉及到ip是手动分配还是自动分配,也要对应调整网卡的ip地址,还有有时候wifi和自己网线网卡同时连接的时候,物理机会选择已经连接到互联网的网络连接,这个时候大概率不会用到我们实验的网络,于是就需要禁用wifi网卡或者关闭wifi。
相关推荐
古法老登瞎折腾8 小时前
大数据智能运维实战(十一):运维 MCP 的工程化——权限、限流、审计与错误处理
java·大数据·运维·spring ai·mcp
hhhjhl8 小时前
Protobuf.js 跨端三方库仓颉适配全流程
javascript·网络·udp
琥珀.8 小时前
mysql中json数组转列表查询
linux·运维·服务器
dawnsky.liu9 小时前
在 RHEL 中使用 goose 实现远程主机管理
linux·运维·ai
ITxiaobing20239 小时前
中国公司海外广告投放的 IP 地址库选型:从“查归属”到“验真实”的工程视角
网络·网络协议·tcp/ip
KKKlucifer10 小时前
运营商非结构化文档安全管控体系建设实践
大数据·网络·安全
Linux运维技术栈11 小时前
CVE-2026-91403 高危漏洞修复:Rocky Linux 9 多版本 JDK 环境清理实操
java·linux·运维
云边云科技_云网融合11 小时前
连锁门店组网怎么做?SD-WAN 多分支组网的架构选型、部署与成本结构
服务器·数据库·php
云上先途111 小时前
企业 AI 服务部署周期多久,会不会影响原有业务运转?
大数据·运维·人工智能
网络小江12 小时前
组网第35课:静态路由——下一跳、出接口、默认路由、浮动静态与黑洞路由
服务器·网络·默认路由·黑洞路由·浮动静态路由