华为设备的单臂路由
如果您对路由器的设置和使用不太熟悉,本文华为设备的单臂路由将为您提供详细的路由器指南和使用技巧,让您的网络连接更加轻松。
本文内容目录一览:
怎样在路由器上做单臂路由
1、设备组网:2台电脑分别属于VLAN10和VLAN20,一台华为AR2220路由器和一台S5700交换机。
2、配置两台PC的IP地址。PC1为下图。
2、PC2为下图。
3、在交换机中进行如下配置:1).连接两台PC机的端口配置为access模式,且分别属于对应的VLAN;2).连接路由器的端口配置为trunk模式,且允许PC机的VLAN通过。
命令:
创建VLAN10和VLAN20:vlan batch 10 20
GE 0/0/2:
interface GigabitEthernet 0/0/2
port link-type access
port default vlan 10
quit
GE 0/0/3:
interface GigabitEthernet 0/0/3
port link-type access
port default vlan 20
quit
GE 0/0/1:
interface GigabitEthernet 0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
4、在路由器中将一个物理接口配置两个逻辑子接口,两个子接口都开启802.1q,且分别属于不同的VLAN。
命令:
子接口1:
interface GigabitEthernet 0/0/1.1
dot1q termination vid 10
ip address 10.0.10.1 255.255.255.0
arp broadcast enable
quit
子接口2:
interface GigabitEthernet 0/0/1.2
dot1q termination vid 20
ip address 10.0.20.1 255.255.255.0
arp broadcast enable
quit
5、当配置完成后,可以分别在PC1和PC2检查相互之间可以进行通信。
单臂路由大概什么意思?
单臂路由
目标:通过路由器进行多个VLAN互联
环境:1. 交换机为二层交换机,支持VLAN划分;2. 路由器只有1个Ethernet接口
实施:采用单臂路由,即在路由器上设置多个逻辑子接口,每个子接口对应于一个VLAN。由于物理路由接口只有一个,各子接口的数据在物理链路上传递要进行标记封装。Cisco设备支持ISL和802.1q协议。华为设备只支持802.1q。
单臂路由的配置实例
2600 IOS需求:IP Plus (c2600-ik8s-mz-122.15.T.bin)
Current configuration:
!
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname c2600
!
no logging console
enable password mysecret
!
!
!
!
!
ip subnet-zero
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.1
encapsulation isl 1
ip address 10.10.10.1 255.255.255.0
no ip redirects
!
!-- If 802.1Q is configured,
!-- you will instead see the following output
!-- under interface FastEthernet0/0.1:
!-- interface FastEthernet0/0.1
!-- encapsulation dot1Q 1 native
!-- ip address 10.10.10.1 255.255.255.0
!
!
interface FastEthernet0/0.2
encapsulation isl 2
ip address 10.10.11.1 255.255.255.0
no ip redirects
!
!-- If 802.1Q is configured,
!-- you will instead see the following output
!-- under interface FastEthernet0/0.2:
!-- interface FastEthernet0/0.2
!-- encapsulation dot1Q 2
!-- ip address 10.10.11.1 255.255.255.0
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
ip classless
no ip http server
!
!
!
line con 0
transport input none
line aux 0
line vty 0 4
password mysecret
login
!
no scheduler allocate
end
在华为路由器上使用单臂路由时会重新封装数据帧的
单臂路由,即在路由器上设置多个逻辑子接口,每个子接口对应一个vlan。在每个子接口的数据在物理链路上传递都要标记封装。Cisco设备支持ISL和802.1q(dot1Q)协议。华为只支持802.1q。
DOT1Q和ISL的区别:DOT1Q是各类产品的VLAN通用协议模式,Dot1q是一种普遍使用的标准,适用所有交换机与路由设备。支持超过1024vlan,而ISL最多支持1024个vlan。ISL是CISCO设备的专用协议,适用于Cisco设备。 ISL(Interior Switching Link)交换机间协议用于实现CISCO交换机间的VLAN中继。它是一个信息包标记协议,在支持ISL接口上发送的帧由一个标准以太网帧及相关的VLAN信息组成。
需求:在局域网中,通过交换机上配置vlan可以减少主机通信广播域的范围,当vlan之间有部分主机需要通信,单交换机不支持三层交换时,可以采用一台支持802.1Q的路由器实现vlan的互通,这需要在以太网口上建立子接口,分配IP地址作为该vlan的网关,同时启动802.1Q。
组网:路由器G0/0/0端口与交换机的上行trunk端口(E0/0/1)相连,交换机下行口划分2个vlan,带若干主机。
华为[ENSP]VLAN间路由的配置(单臂路由、多臂路由的配置)
实验二拓扑图如下:
一、配置PC1、PC2
二、配置LSW和R1
交换机配置
vlan batch 100 200
interface GigabitEthernet0/0/1
port link-type access
port default vlan 200
interface GigabitEthernet0/0/2
port link-type access
port default vlan 100
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 100 200
路由器配置
interface Ethernet0/0/0.100
dot1q termination vid 100
ip address 192.168.10.1 255.255.255.0
arp broadcast enable
interface Ethernet0/0/0.200
dot1q termination vid 200
ip address 192.168.20.1 255.255.255.0
现在,您已经了解了如何设置和使用路由器和无线网络,开始享受更好的网络连接吧!