H3C的VLAN间路由视频学习
一.配置vlan、
1.配置H3C1的vlan,及vlan查看命令!!
[H3C1]display vlan
[H3C1]display vlan all
[H3C1]display port trunk
[H3C1]display interface e0/4/3
2.配置H3C2的vlan
3,解决默认只允许vlan1通过trunk链路
[H3C1-Ethernet0/4/3]port trunk permit vlan all
vlan间路由
1.三层交换trunk和hybrid
2.单臂路由
一.配置vlan、trunk
1.配置H3C1
[H3C1]int vlan 1 //为vlan1配置ip地址
[H3C1-Vlan-interface1]ip add 1.1.1.1 255.255.255.0
[H3C1-Vlan-interface1]un shut
[H3C1]vlan 2 //创建vlan2
[H3C1-vlan2]q
[H3C1]int vlan 2 //为vlan2配置ip地址
[H3C1-Vlan-interface2]ip add 2.2.2.2 255.255.255.0
[H3C1-Vlan-interface2]un shut
[H3C1-Vlan-interface2]q
[H3C1]int e0/4/3 //开启trunk链路
[H3C1-Ethernet0/4/3]port link-type trunk
交换机的配置:
[SW1]vlan 10
[SW1-vlan10]vlan 20 创建vlan 10和vlan 20
[SW1-GigabitEthernet1/0/2]port link-type access
[SW1-GigabitEthernet1/0/2]port access vlan 10 端口配置到vlan 10
[SW1]int gi 1/0/3
SW1-GigabitEthernet1/0/3]port link-type access
[SW1-GigabitEthernet1/0/3]port access vlan 20 端口配置到vlan 20
接入路由的端口配置:trunk
[SW1]int gi 1/0/1
[SW1-GigabitEthernet1/0/1]port link-type trunk
[SW1-GigabitEthernet1/0/1]port trunk permit vlan 10 20 端口模式为trunk,配置到vlan 10和vlan 20
路由器的配置:
与交换机相接的端口需要配置子端口
[R1]int gi 0/0
R1-GigabitEthernet0/0]undo shutdown 确认端口开启
[R1]int gi 0/0.10 进入子端口
[R1-GigabitEthernet0/0.10]ip add 192.168.10.1 24 配置端口ip
[R1-GigabitEthernet0/0.10]vlan-type dot1q vid 10 配置该子端口为vlan 10服务
R1-GigabitEthernet0/0.10]dis this
nterface GigabitEthernet0/0.10
p address 192.168.10.1 255.255.255.0
lan-type dot1q vid 10
[R1]int gi 0/0.20
[R1-GigabitEthernet0/0.20]ip add 192.168.20.1 24
[R1-GigabitEthernet0/0.20]vlan-type dot1q vid 20
[R1-GigabitEthernet0/0.20]dis this
interface GigabitEthernet0/0.20
ip address 192.168.20.1 255.255.255.0
vlan-type dot1q vid 20
#
以上
配置完以后pc1和pc2可以跨vlan通信
pc1配置
ip 192.168.10.2/24
路由 ip routing-table 0.0.0.0 0 192.168.10.1
pc2配置
ip 192.168.20.2/24
路由 ip routing-table 0.0.0.0 0 192.168.20.1
实际上三层交换机有路由功能:可以在交换机上直接配置
int vlan 10 创建虚拟接口并未接口配置ip
ip add 192.168.10.1 24
int vlan 20
ip add 192.168.20.1 24
学习去除电脑弹窗广告