三层交换+单臂路由+ACL网络配置

一、拓扑与IP规划

设备 VLAN 网关 IP地址
PC1/PC3 2 192.168.2.254 192.168.2.1/2
PC2 3 192.168.3.254 192.168.3.1
PC4 4 192.168.4.254 192.168.4.1
PC5 5 192.168.5.254 192.168.5.1
PC6 6 192.168.6.254 192.168.6.1

二、交换机配置

LSW1

复制代码
system-view
vlan batch 2 3 4 5 6
interface GigabitEthernet 0/0/1
port link-type access
port default vlan 2
quit
interface GigabitEthernet 0/0/2
port link-type access
port default vlan 3
quit
interface GigabitEthernet 0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 6
quit
interface GigabitEthernet 0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 6
quit
save

LSW2

复制代码
system-view
vlan batch 2 3 4 5 6
interface GigabitEthernet 0/0/1
port link-type access
port default vlan 2
quit
interface GigabitEthernet 0/0/2
port link-type access
port default vlan 4
quit
interface GigabitEthernet 0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 6
quit
interface GigabitEthernet 0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 6
quit
save

LSW3

复制代码
system-view
vlan batch 2 3 4 5 6
interface GigabitEthernet 0/0/1
port link-type access
port default vlan 5
quit
interface GigabitEthernet 0/0/2
port link-type access
port default vlan 6
quit
interface GigabitEthernet 0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 6
quit
save

三、路由器配置

复制代码
system-view
dhcp enable
interface GigabitEthernet 0/0/0
ip address 192.168.3.254 255.255.255.0
dhcp select interface
quit
interface GigabitEthernet 0/0/0.2
dot1q termination vid 2
ip address 192.168.2.254 255.255.255.0
arp broadcast enable
dhcp select interface
quit
interface GigabitEthernet 0/0/0.4
dot1q termination vid 4
ip address 192.168.4.254 255.255.255.0
arp broadcast enable
dhcp select interface
quit
interface GigabitEthernet 0/0/0.5
dot1q termination vid 5
ip address 192.168.5.254 255.255.255.0
arp broadcast enable
dhcp select interface
quit
interface GigabitEthernet 0/0/0.6
dot1q termination vid 6
ip address 192.168.6.254 255.255.255.0
arp broadcast enable
dhcp select interface
quit

四、ACL配置

复制代码
acl number 3000
rule 5 permit ip source 192.168.2.0 0.0.0.255
rule 10 permit ip source 192.168.3.0 0.0.0.255
rule 20 permit ip source 192.168.4.0 0.0.0.255 destination 192.168.5.0 0.0.0.255
rule 30 deny ip source 192.168.4.0 0.0.0.255 destination 192.168.6.0 0.0.0.255
rule 40 deny ip source 192.168.5.0 0.0.0.255 destination 192.168.6.0 0.0.0.255
rule 100 permit ip
quit
interface GigabitEthernet 0/0/0
traffic-filter inbound acl 3000
quit
save

五、PC配置

  • PC1: 192.168.2.1/24, GW 192.168.2.254

  • PC2: 192.168.3.1/24, GW 192.168.3.254

  • PC3: 192.168.2.2/24, GW 192.168.2.254

  • PC4: 192.168.4.1/24, GW 192.168.4.254

  • PC5: 192.168.5.1/24, GW 192.168.5.254

  • PC6: 192.168.6.1/24, GW 192.168.6.254

六、验证测试

复制代码
# PC4测试PC5
ping 192.168.5.1  # 应该通
# PC4测试PC6
ping 192.168.6.1  # 应该不通
# PC5测试PC6
ping 192.168.6.1  # 应该不通

七、查看命令

复制代码
display vlan
display ip interface brief
display dhcp server ip-in-use
display acl 3000
相关推荐
亿电连接器替代品网20 小时前
Bulgin连接器在自动化与能源系统中的应用及国产替代策略
大数据·网络·人工智能·经验分享·物联网·硬件工程·材料工程
云边云科技_云网融合1 天前
AI 时代组网新范式:零信任软件定义组网,让连接更安全更灵活
网络·安全
简单点了1 天前
全栈编程基础知识7
运维·服务器·网络
实心儿儿1 天前
Linux —— 进程控制 - mini shell
linux·运维·服务器
房开民1 天前
modbus相关学习
网络·学习
oy_mail1 天前
QoS质量配置
开发语言·智能路由器·php
程序员黄老师1 天前
Windows文件移动到Linux上的坑
linux·运维·服务器
mounter6251 天前
【内核前沿】Linux IPC 迎来大变局?POSIX 消息队列增强、io_uring IPC 与 Bus1 十年回归
linux·运维·服务器·kernel·ipc·io_uring
2603_954708311 天前
如何确保微电网标准化架构设计流程的完整性?
网络·人工智能·物联网·架构·系统架构
网络小白不怕黑1 天前
2.1VMware部署Windows_server_2008_R2
运维·服务器