(1)Access接口详解及配置
一般接终端、PC的端口配置为access接口
1不同交换机相同vlan间通信
sw1,sw2:
vlan 2
interface GigabitEthernet0/0/1
port link-type access
port default vlan 2
interface GigabitEthernet0/0/3
port link-type access
port default vlan 2
查看接口vlan属性
[sw1]display port vlan active GigabitEthernet0/0/3
T=TAG U=UNTAG
Port Link Type PVID VLAN List
GE0/0/3 access 2 U: 2
说明:
PVID:接口默认VLAN为2,Untagged帧添加VLAN 2后再转发
VLAN List:接口允许通过的VLAN与PVID相同
PC1可以ping通PC2
PC>ping 192.168.2.2
Ping 192.168.2.2: 32 data bytes, Press Ctrl_C to break
From 192.168.2.2: bytes=32 seq=1 ttl=128 time=94 ms
From 192.168.2.2: bytes=32 seq=2 ttl=128 time=109 ms
From 192.168.2.2: bytes=32 seq=3 ttl=128 time=94 ms
From 192.168.2.2: bytes=32 seq=4 ttl=128 time=62 ms
From 192.168.2.2: bytes=32 seq=5 ttl=128 time=62 ms
— 192.168.2.2 ping statistics —
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 62/84/109 ms
该例子在生产环境中基本很少用到
2不同交换机不同vlan间通信
sw1:
vlan 2
interface GigabitEthernet0/0/1
port link-type access
port default vlan 2
interface GigabitEthernet0/0/3
port link-type access
port default vlan 2
sw2:
vlan 3
interface GigabitEthernet0/0/1
port link-type access
port default vlan 3
interface GigabitEthernet0/0/3
port link-type access
port default vlan 3
PC1可以ping通PC2
PC>ping 192.168.2.2
Ping 192.168.2.2: 32 data bytes, Press Ctrl_C to break
From 192.168.2.2: bytes=32 seq=1 ttl=128 time=78 ms
From 192.168.2.2: bytes=32 seq=2 ttl=128 time=62 ms
— 192.168.2.2 ping statistics —
2 packet(s) transmitted
2 packet(s) received
0.00% packet loss
round-trip min/avg/max = 62/70/78 ms
该例子在生产环境中基本很少用到
3相同交换机不同vlan间通信
未划分vlan前,PC1能ping通PC2
PC>ping 192.168.1.3
Ping 192.168.1.3: 32 data bytes, Press Ctrl_C to break
From 192.168.1.3: bytes=32 seq=1 ttl=128 time=47 ms
From 192.168.1.3: bytes=32 seq=2 ttl=128 time=31 ms
From 192.168.1.3: bytes=32 seq=3 ttl=128 time=47 ms
From 192.168.1.3: bytes=32 seq=4 ttl=128 time=31 ms
From 192.168.1.3: bytes=32 seq=5 ttl=128 time=47 ms
— 192.168.1.3 ping statistics —
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 31/40/47 ms
SW1:
vlan batch 10 20
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 20
划分vlan后,PC1ping不通PC2
PC>ping 192.168.1.3
Ping 192.168.1.3: 32 data bytes, Press Ctrl_C to break
From 192.168.1.2: Destination host unreachable
From 192.168.1.2: Destination host unreachable
From 192.168.1.2: Destination host unreachable
From 192.168.1.2: Destination host unreachable
From 192.168.1.2: Destination host unreachable
— 192.168.1.3 ping statistics —
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
4端口组配置
[Huawei]port-group group-member gi0/0/3 to gi0/0/10
[Huawei-port-group]port link-type access
[Huawei]dis cu
……
interface GigabitEthernet0/0/3
port link-type access
#
interface GigabitEthernet0/0/4
port link-type access
#
interface GigabitEthernet0/0/5
port link-type access
#
interface GigabitEthernet0/0/6
port link-type access
#
interface GigabitEthernet0/0/7
port link-type access
#
interface GigabitEthernet0/0/8
port link-type access
#
interface GigabitEthernet0/0/9
port link-type access
#
interface GigabitEthernet0/0/10
port link-type access
5概念
Access 端口收报文: 如果收到对端设备发送的帧是untagged(不带VLAN标签),交换机将强制加上该端口的PVID。如果收到对端设备发送的帧是tagged(带VLAN标签),交换机会检查该标签内的VLAN ID。当VLAN ID与该端口的 PVID相同时,接收该报文。当VLAN ID与该端口的PVID不同时,丢弃。
Access 端口发报文:先将报文的VLAN 信息剥离,然后在发送出去。access端口放往对端的设备的以太网数据帧永远都是不带标签的帧。
(2)Trunk接口详解及配置
1不同交换机相同vlan间通信
sw1:
vlan batch 2 to 3
interface GigabitEthernet0/0/1
port link-type access
port default vlan 2
interface GigabitEthernet0/0/2
port link-type access
port default vlan 3
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 3
查看端口vlan情况
[sw1]display port vlan active
T=TAG U=UNTAG
———————————————————
Port Link Type PVID VLAN List
GE0/0/1 access 2 U: 2
GE0/0/2 access 3 U: 3
GE0/0/3 trunk 1 U: 1
T: 2 to 3
… …
PC1可以ping通PC3
PC>ping 192.168.2.2
Ping 192.168.2.2: 32 data bytes, Press Ctrl_C to break
From 192.168.2.2: bytes=32 seq=1 ttl=128 time=78 ms
From 192.168.2.2: bytes=32 seq=2 ttl=128 time=93 ms
From 192.168.2.2: bytes=32 seq=3 ttl=128 time=109 ms
From 192.168.2.2: bytes=32 seq=4 ttl=128 time=109 ms
— 192.168.2.2 ping statistics —
4 packet(s) transmitted
4 packet(s) received
0.00% packet loss
round-trip min/avg/max = 78/97/109 ms
sw2:
vlan batch 2 to 3
interface GigabitEthernet0/0/1
port link-type access
port default vlan 2
interface GigabitEthernet0/0/2
port link-type access
port default vlan 3
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 3
查看端口vlan情况
[sw2]display port vlan active
T=TAG U=UNTAG
———————————————————
Port Link Type PVID VLAN List
———————————————————
GE0/0/1 access 2 U: 2
GE0/0/2 access 3 U: 3
GE0/0/3 trunk 1 U: 1
T: 2 to 3
PC2可以ping通PC4
PC>ping 192.168.3.2
Ping 192.168.3.2: 32 data bytes, Press Ctrl_C to break
From 192.168.3.2: bytes=32 seq=1 ttl=128 time=93 ms
From 192.168.3.2: bytes=32 seq=2 ttl=128 time=78 ms
From 192.168.3.2: bytes=32 seq=3 ttl=128 time=78 ms
— 192.168.3.2 ping statistics —
3 packet(s) transmitted
3 packet(s) received
0.00% packet loss
round-trip min/avg/max = 78/83/93 ms
2配置Trunk-Link端口PVID
[SWA-Ethernet0/3]port trunk pvid vlan 3
默认trunk端口的pvid为1(vlan 1)
3概念
trunk 端口收报文:如果帧不包含VLAN信息,将添加上端口的PVID;如果该帧包含VLAN信息,则不改变。
trunk 端口发报文:该帧的VLAN ID在Trunk允许的发送列表中,比较将要发送报文的VLAN 信息和端口的PVID,如果不相等则直接发送。如果两者相等则剥离VLAN 信息,再发送。
(3)Hybrid接口详解
hybrid端口既可以当access端口使用又可以当trunk端口使用
1不同交换机相同vlan间通信
sw1,sw2:
undo info-center enable
vlan batch 2 to 3
interface GigabitEthernet0/0/1
port hybrid pvid vlan 2
port hybrid untagged vlan 2
interface GigabitEthernet0/0/2
port hybrid pvid vlan 3
port hybrid untagged vlan 3
interface GigabitEthernet0/0/3
port hybrid tagged vlan 2 to 3
PC1可以ping通PC3
PC>ping 192.168.2.2
Ping 192.168.2.2: 32 data bytes, Press Ctrl_C to break
From 192.168.2.2: bytes=32 seq=1 ttl=128 time=78 ms
From 192.168.2.2: bytes=32 seq=2 ttl=128 time=62 ms
— 192.168.2.2 ping statistics —
2 packet(s) transmitted
2 packet(s) received
0.00% packet loss
round-trip min/avg/max = 62/70/78 ms
PC2可以ping通PC4
PC>ping 192.168.3.2
Ping 192.168.3.2: 32 data bytes, Press Ctrl_C to break
From 192.168.3.2: bytes=32 seq=1 ttl=128 time=78 ms
From 192.168.3.2: bytes=32 seq=2 ttl=128 time=78 ms
From 192.168.3.2: bytes=32 seq=3 ttl=128 time=109 ms
From 192.168.3.2: bytes=32 seq=4 ttl=128 time=94 ms
— 192.168.3.2 ping statistics —
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 78/89/109 ms
2 Hybrid端口的特殊通信
要求主机A和主机B都访问服务器C,但是它们直接不能互相访问
interface GigabitEthernet0/0/1
port hybrid pvid vlan 2
port hybrid untagged vlan 2 4
interface GigabitEthernet0/0/2
port hybrid pvid vlan 3
port hybrid untagged vlan 3 4
interface GigabitEthernet0/0/3
port hybrid pvid vlan 4
port hybrid untagged vlan 2 3 4
生产环境中该需求一般通过三层来实现
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.fwqtg.net
apache2主要的优势就是对多处理器的支持更好,在编译时同过使用–with-mpm选项来决定apache2的工作模式。如果知道当前的apache2使用什么工作机制,可以通过httpd -l命令列出apache的所有模块,就可以知道其工作方式: prefor…