我尝试在我的其中一台 HP 交换机 (J9279A/J9280A) 上为实验室环境设置单独的 VLAN。
网络架构:
WAN
|
GW
|
port1
|
SW_2---Trk1---SW_1---Trk2---SW_3
子网:
- 192.168.100.0/24 - vlan 1 - 管理网络、交换机、路由器等。
- 192.168.10.0/24 - vlan 2 - 用户设备
- 192.168.50.0/24 - vlan 3 - iscsi 设备
- 10.100.0.0/16 - vlan 100 - 实验室子网(目前不起作用)
SW_1配置:
vlan 1
name "Management"
forbid 2
untagged 1,Trk1-Trk2
ip address 192.168.100.240 255.255.255.0
no untagged 2-20
jumbo
ip proxy-arp
exit
vlan 2
name "users"
forbid 4,6,8,10,12,19-20
untagged 2-3,5,7,9,11,13-18
ip address 192.168.10.240 255.255.255.0
tagged 1,Trk1-Trk2
jumbo
exit
vlan 3
name "iscsi"
forbid 2-3,5,7,9,11,13-18
untagged 4,6,8,10,12,19-20
tagged 1,Trk1-Trk2
jumbo
exit
vlan 100
name "10.100"
forbid 2-20
tagged Trk1-Trk2
exit
SW_2 配置:
vlan 1
name "Management"
forbid 1-22
untagged Trk1
ip address 192.168.100.241 255.255.255.0
no untagged 1-22
jumbo
exit
vlan 2
name "users"
forbid 7-16
untagged 1-6,17-22
tagged Trk1
jumbo
exit
vlan 3
name "iscsi"
forbid 1-6,8-22
untagged 7
tagged Trk1
jumbo
exit
vlan 100
name "10.100"
untagged 8-16
exit
SW_3配置:
vlan 1
name "Management"
forbid 1-46
untagged Trk1
ip address 192.168.100.242 255.255.255.0
no untagged 1-46
jumbo
ip proxy-arp
exit
vlan 2
name "users"
untagged 1-35,45-46
no ip address
tagged Trk1
jumbo
exit
vlan 3
name "iscsi"
forbid 1-6,8-46
tagged Trk1
jumbo
exit
vlan 100
name "10.100"
forbid 4-35,37-46
untagged 36
tagged Trk1
exit
设备(IBM X3550 M2)连接到 SW_2 的端口 11-12。接口配置:
auto eth2
iface eth2 inet static
address 10.100.0.11
netmask 255.255.0.0
auto eth3
iface eth3 inet static
address 10.100.0.12
netmask 255.255.0.0
我的理解是,在当前配置中,此设备应位于其自己的独立网络中,任何其他 VLAN 都无法访问。我做了一些测试,令我惊讶的是,我能够连接到这台机器。
我运行了 wireshark 来查看发生了什么,并且广播 ping(ping -b 10.100.255.255)也被我的电脑接收到,该电脑连接到 SW_3 中的端口 1(在 VLAN 2 中未标记)。
我的电脑上的接口配置:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:d9:83:4f brd ff:ff:ff:ff:ff:ff
inet 192.168.10.16/24 brd 192.168.10.255 scope global eth0
valid_lft forever preferred_lft forever
inet 10.100.0.2/32 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fed9:834f/64 scope link
valid_lft forever preferred_lft forever
谁能向我解释发生了什么,以及如何正确设置?