您的位置:首页 > 其它

单臂路由技术实现跨VLAN全网互通

2016-03-03 21:59 253 查看



1. 实验要求
PC1属于vlan10 ,PC2属于vlan20,PC3属于vlan30,PC4属于vlan10。使用dhcp自动获取IP地址。使用单臂路由技术实现全网互通。
2. 实验步骤

R1: R1#conf t
Enterconfiguration commands, one per line. End with CNTL/Z.
R1(config)#intfa0/0
R1(config-if)#noshutdown 将接口fa0/0开启
R1(config-if)#intfa0/0.10 进子接口
R1(config-subif)#encapsulationdot1Q 10 改变接口的封装类型,做vlan10的网关
R1(config-subif)#ipadd 192.168.10.1 255.255.255.0 配置IP地址
R1(config-subif)#noshut
R1(config-subif)#intfa0/0.20
R1(config-subif)#encapsulationdot1Q 20
R1(config-subif)#ipadd 192.168.20.1 255.255.255.0
R1(config-subif)#noshut
R1(config-subif)#intfa0/0.30
R1(config-subif)#encapsulationdot1Q 30
R1(config-subif)#ipadd 192.168.30.1 255.255.255.0
R1(config-subif)#noshut
R1(config-subif)#exit
R1(config)#ipdhcp pool v10 建立dhcp地址池
R1(dhcp-config)#network192.168.10.0 /24
R1(dhcp-config)#default-router192.168.10.1
R1(dhcp-config)#dns-server1.1.1.1
R1(dhcp-config)#exit
R1(config)#ipdhcp pool v20 建立dhcp地址池
R1(dhcp-config)#network192.168.20.0 /24
R1(dhcp-config)#default-router192.168.20.1
R1(dhcp-config)#dns-server2.2.2.2
R1(dhcp-config)#exit
R1(config)#ipdhcp pool v30 建立dhcp地址池
R1(dhcp-config)#network192.168.30.0 /24
R1(dhcp-config)#default-router192.168.30.1
R1(dhcp-config)#dns-server3.3.3.3
R1(dhcp-config)#exit
Sw1:
sw1#conft
sw1(config)#no ip routing 关闭路由功能sw1(config)#vlan 10,20,30 建立vlan10,20,30,sw1(config-vlan)#int fa1/0 sw1(config-if)#switchport access vlan 10 将接口加入VLAN中sw1(config-if)#int fa1/1sw1(config-if)#switchport access vlan 20sw1(config-if)#int fa1/15sw1(config-if)#switchport mode trunk 将接口变为中继口sw1(config-if)#int fa1/4sw1(config-if)#switchport mode trunk 将接口变为中继口
sw2: sw2#conft
sw2(config)#no ip routing 关闭路由功能sw2(config-vlan)#vlan 10,20,30 建立vlan10,20,30sw2(config-vlan)#int fa1/2sw2(config-if)#switchport access vlan 30 将接口加入VLAN中sw2(config-if)#int fa1/3sw2(config-if)#switchport access vlan 10sw2(config-if)#int fa1/15sw2(config-if)#switchport mode trunk 将接口变为中继口

3. 实验验证结果





内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  VLAN 路由技术 单臂