当前位置:网站首页>VLAN experiment
VLAN experiment
2022-07-02 12:36:00 【Confused classmate Z】

The experimental requirements :
1/pc1 and pc3 The interface is access; pvlan vlan2;
2/PC2/4/5/6 In the same network segment ; among PC2 You can visit PC4/5/6; but PC4 You can visit PC5, Cannot access PC6
2 pc5 Cannot access PC6
3、PC1/3 And PC2/4/5/6 be not in - - Net segment
4、 all PC adopt DHCP obtain ip Address , And PC1/3 Normal access

SW1 To configure
[sw1]vlan batch 2 to 5
[sw1]int g0/0/2
[sw1-GigabitEthernet0/0/2]port link-type access
[sw1-GigabitEthernet0/0/2]port default vlan 2
[sw1-GigabitEthernet0/0/2]int g0/0/3
[sw1-GigabitEthernet0/0/3]port hybrid pvid vlan 3
[sw1-GigabitEthernet0/0/3]port hybrid untagged vlan 3 to 5
[sw1-GigabitEthernet0/0/3]int g0/0/4
[sw1-GigabitEthernet0/0/4]port link-type trunk
[sw1-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 to 5
[sw1-GigabitEthernet0/0/4]int g0/0/1
[sw1-GigabitEthernet0/0/1]port hybrid tagged vlan 2
[sw1-GigabitEthernet0/0/1]port hybrid untagged vlan 3 to 5
SW2 To configure
[sw2]vlan batch 2 to 5
[sw2]int g0/0/1
[sw2-GigabitEthernet0/0/1]port link-type trunk
[sw2-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 to 5
[sw2-GigabitEthernet0/0/1]int g0/0/2
[sw2-GigabitEthernet0/0/2]port link-type access
[sw2-GigabitEthernet0/0/2]port default vlan 2
[sw2-GigabitEthernet0/0/2]int g0/0/3
[sw2-GigabitEthernet0/0/3]port hybrid pvid vlan 4
[sw2-GigabitEthernet0/0/3]port hybrid untagged vlan 3 to 4
[sw2-GigabitEthernet0/0/3]int g0/0/4
[sw2-GigabitEthernet0/0/4]port link-type trunk
[sw2-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 to 5
SW3 To configure
[sw3]vlan batch 2 to 5
[sw3]int g0/0/1
[sw3-GigabitEthernet0/0/1]port link-type trunk
[sw3-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 to 5
[sw3-GigabitEthernet0/0/1]int g0/0/2
[sw3-GigabitEthernet0/0/2]port hybrid pvid vlan 4
[sw3-GigabitEthernet0/0/2]port hybrid untagged vlan 3 to 4
[sw3-GigabitEthernet0/0/2]int g0/0/3
[sw3-GigabitEthernet0/0/3]port hybrid pvid vlan 5
[sw3-GigabitEthernet0/0/3]port hybrid untagged vlan 3 to 5
Router configuration
[r1]dhcp enable
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
[r1-GigabitEthernet0/0/0]dhcp select global
[r1-GigabitEthernet0/0/0]int g0/0/0.1
[r1-GigabitEthernet0/0/0.1]ip add 192.168.2.1 24
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 2
[r1-GigabitEthernet0/0/0.1]arp broadcast enable
[r1-GigabitEthernet0/0/0.1]dhcp select global
[r1]ip pool p1
[r1-ip-pool-p1]network 192.168.1.0 mask 24
[r1-ip-pool-p1]gateway-list 192.168.1.1
[r1-ip-pool-p1]q
[r1]ip pool p2
[r1-ip-pool-p2]network 192.168.2.0 mask 24
[r1-ip-pool-p2]gateway-list 192.168.2.1
pc1 To 6 Get the address
PC1:192.168.2.254
PC2: 192.168.1.254
PC3:192.168.2.253
PC4:192.168.1.253
PC5:192.168.1.252
PC6:192.168.1.251
PC2 Sure ping through PC4/5/6


PC4 Access to PC5 Cannot access PC6

The experiment is finished !
边栏推荐
猜你喜欢

(C language) input a line of characters and count the number of English letters, spaces, numbers and other characters.

async/await 异步函数

drools动态增加、修改、删除规则

Less than three months after the programmer was hired, the boss wanted to launch the app within one month. If he was dissatisfied, he was dismissed immediately

Record the range of data that MySQL update will lock

The differences and relationships among port, targetport, nodeport and containerport in kubenetes

Docker-compose配置Mysql,Redis,MongoDB

Programmers can't find jobs after the age of 35? After reading this article, you may be able to find the answer

Writing method of then part in drools

BOM DOM
随机推荐
[old horse of industrial control] detailed explanation of Siemens PLC TCP protocol
CDA数据分析——Excel数据处理的常见知识点归纳
Drools terminates the execution of other rules after executing one rule
kubeadm join时出现错误:[ERROR Port-10250]: Port 10250 is in use [ERROR FileAvailable--etc-kubernetes-pki
Take you ten days to easily finish the finale of go micro services (distributed transactions)
Lombok common annotations
防抖 节流
Shuttle encapsulated AppBar
The blink code based on Arduino and esp8266 runs successfully (including error analysis)
drools执行完某个规则后终止别的规则执行
arcgis js 4.x 地图中加入图片
PR 2021 quick start tutorial, learn about the and functions of the timeline panel
Test shift left and right
【工控老马】西门子PLC Siemens PLC TCP协议详解
kubenetes中port、targetPort、nodePort、containerPort的区别与联系
Input box assembly of the shutter package
[ybtoj advanced training guidance] cross the river [BFS]
Performance tuning project case
drools决策表的简单使用
寻找二叉树中任意两个数的公共祖先