现在的位置: 首页 > 综合 > 正文

vitesse:74xx交换机VLAN配置及测试

2014年09月05日 ⁄ 综合 ⁄ 共 10357字 ⁄ 字号 评论关闭

0:整体的总结文档在:vitesse总结

1:系统及软件版本

System>Configuration
System Contact  : 
System Name     : 
System Location : 
MAC Address     : 00-01-c1-00-00-00
Chip ID         : VSC7460
System Time     : 1970-01-01T00:45:15+00:00
System Uptime   : 00:45:15
Software Version: CEServices (standalone) Version 3.20_BETA Build 731712
Software Date   : 2013-02-11T11:35:06+01:00
Previous Restart: Cold
System>Version
Version      : CEServices (standalone) Version 3.20_BETA Build 731712
Build Date   : 2013-02-11T11:35:06+01:00
Code Revision: 08450c3ef7de

2:系统默认vlan及ip配置

#############################################################################
Port  PVID  Frame Type  Ingress Filter  Tx Tag      Port Type      
----  ----  ----------  --------------  ----------  -------------  
1     1     All         Disabled        Untag PVID  Unaware        
2     1     All         Disabled        Untag PVID  Unaware        
3     1     All         Disabled        Untag PVID  Unaware        
4     1     All         Disabled        Untag PVID  Unaware        
5     1     All         Disabled        Untag PVID  Unaware        
6     1     All         Disabled        Untag PVID  Unaware     
VID   VLAN Name                         Ports
----  --------------------------------  -----
1     default                           1-29
IP>confi
Mode: router
vlan1: mtu=1500 IPv4=192.0.2.1/24

3:VLAN配置

##############################################################################
配置之后的VLAN
VLAN>confi
VLAN Configuration:
===================
Port  PVID  Frame Type  Ingress Filter  Tx Tag      Port Type      
----  ----  ----------  --------------  ----------  -------------  
1     1     All         Disabled        Untag PVID  Unaware        
2     2     All         Disabled        Untag PVID  Unaware        
3     2     All         Disabled        Untag PVID  Unaware        
4     3     All         Disabled        Untag All   Unaware        
5     3     Tagged      Disabled        Tag All     C-Port         
6     3     Tagged      Disabled        Tag All     C-Port         
7     1     All         Disabled        Untag PVID  Unaware        
8     1     All         Disabled        Untag PVID  Unaware        
9     1     All         Disabled        Untag PVID  Unaware        
10    1     All         Disabled        Untag PVID  Unaware        
11    1     All         Disabled        Untag PVID  Unaware        
12    1     All         Disabled        Untag PVID  Unaware        
13    1     All         Disabled        Untag PVID  Unaware        
14    1     All         Disabled        Untag PVID  Unaware        
15    1     All         Disabled        Untag PVID  Unaware        
16    1     All         Disabled        Untag PVID  Unaware        
17    1     All         Disabled        Untag PVID  Unaware        
18    1     All         Disabled        Untag PVID  Unaware        
19    1     All         Disabled        Untag PVID  Unaware        
20    1     All         Disabled        Untag PVID  Unaware        
21    1     All         Disabled        Untag PVID  Unaware        
22    1     All         Disabled        Untag PVID  Unaware        
23    1     All         Disabled        Untag PVID  Unaware        
24    1     All         Disabled        Untag PVID  Unaware        
25    1     All         Disabled        Untag PVID  Unaware        
26    1     All         Disabled        Untag PVID  Unaware        
27    1     All         Disabled        Untag PVID  Unaware        
28    1     All         Disabled        Untag PVID  Unaware        
29    1     All         Disabled        Untag PVID  Unaware        

VID   VLAN Name                         Ports
----  --------------------------------  -----
1     default                           1-29
2     testVlan2                         2,3
3     testVlan3                         4-6 //4,5,6是同一个VLAN

VID   VLAN Name                         Ports
----  --------------------------------  -----
VLAN forbidden table is empty
VLAN>PortType 2 c-port

4:ip地址配置

###################################################################################
Interface add 2 //首先添加interface,此处代表的是:VLANID。
address 2 192.168.10.2/24 //对此VLAN ID 设置ip地址。
IP>confi
Mode: router
vlan1: mtu=1500 IPv4=192.168.1.2/24
vlan2: mtu=1500 IPv4=192.168.10.2/24
vlan3: mtu=1500 IPv4=192.168.100.3/24
ping命令的使用格式如下:
IP ping 192.168.100.141 L 100 C 50 I 2
IP ping 192.168.10.102 L 100 C 50 I 2
IP ping 192.168.1.101 L 100 C 50 I 2

5:电网桥上面的配置及数据包

####################################################################################
ifconfig eth0 up
vconfig add eth0 2
vconfig add eth0 3
ifconfig eth0.2 hw ether 00:03:7F:FF:FF:F1 up
ifconfig eth0.3 hw ether 00:03:7F:FF:FF:F2 up
ifconfig eth0 10.10.97.235 
ifconfig eth0.2  192.168.10.102
ifconfig eth0.3 192.168.100.103
/ # ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:03:7F:FF:FF:FF  
          inet addr:10.10.97.235  Bcast:10.255.255.255  Mask:255.0.0.0
          inet6 addr: fe80::203:7fff:feff:ffff/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1164 errors:0 dropped:0 overruns:0 frame:0
          TX packets:275 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:137246 (134.0 KiB)  TX bytes:22332 (21.8 KiB)

eth0.2    Link encap:Ethernet  HWaddr 00:03:7F:FF:FF:F1  
          inet addr:192.168.10.102  Bcast:192.168.10.255  Mask:255.255.255.0
          inet6 addr: fe80::203:7fff:feff:fff1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:492 (492.0 B)

eth0.3    Link encap:Ethernet  HWaddr 00:03:7F:FF:FF:F2  
          inet addr:192.168.100.103  Bcast:192.168.100.255  Mask:255.255.255.0
          inet6 addr: fe80::203:7fff:feff:fff2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:575 errors:0 dropped:0 overruns:0 frame:0
          TX packets:269 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:47925 (46.8 KiB)  TX bytes:20590 (20.1 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
在电力网桥上面抓包如下:
/ # tcpdump -i eth0 -xxvv
/ # tcpdump -i eth0  -nnxx //下面为ICMP的带VLAN的数据包
tcpdump: WARNING: can't create rx ring on packet socket 3: 99-Protocol not available
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 68 bytes
00:34:42.875399 IP 192.168.100.73 > 192.168.100.103: ICMP echo request, id 256, seq 58903, length 40
        0x0000:  0003 7fff fff2 d4be d90a 270c 8100 0003
        0x0010:  0800 4500 003c bc19 0000 4001 74a6 c0a8
        0x0020:  6449 c0a8 6467 0800 6644 0100 e617 6162
        0x0030:  6364 6566 6768 696a 6b6c 6d6e 6f70 7172
        0x0040:  7374 7576
00:34:42.876219 IP 192.168.100.103 > 192.168.100.73: ICMP echo reply, id 256, seq 58903, length 40
        0x0000:  d4be d90a 270c 0003 7fff fff2 8100 0003
        0x0010:  0800 4500 003c ff95 0000 4001 312a c0a8
        0x0020:  6467 c0a8 6449 0000 6e44 0100 e617 6162
        0x0030:  6364 6566 6768 696a 6b6c 6d6e 6f70 7172
        0x0040:  7374 7576        
-----------------------------------带TAG的ARP数据包--------------------------------------
00:33:33.878399 ARP, Request who-has 192.168.100.103 tell 192.168.100.73, length 46
        0x0000:  ffff ffff ffff d4be d90a 270c 8100 0003
        0x0010:  0806 0001 0800 0604 0001 d4be d90a 270c
        0x0020:  c0a8 6449 0000 0000 0000 c0a8 6467 0000
        0x0030:  0000 0000 0000 0000 0000 0000 0000 0000
00:33:33.878485 ARP, Reply 192.168.100.103 is-at 00:03:7f:ff:ff:f2, length 28
        0x0000:  d4be d90a 270c 0003 7fff fff2 8100 0003
        0x0010:  0806 0001 0800 0604 0002 0003 7fff fff2
        0x0020:  c0a8 6467 d4be d90a 270c c0a8 6449
上面的测试中:
是在192.168.100.73主机上面ping网桥上面的IP:192.168.100.103,其所接的vitesse端口为:port4.
网桥所接vitesse端口为:port5或者port6。其他方式是不能pingt通的。
上面的数据包可知,当数据经过port5或者port6时,会对数据包进行打标签处理。

6:其他VLAN组分析

####################################################################################
此项中IP进行了调整。没有对VLAN2和VLAN1进行ip地址设置。
IP>conf
Mode: router
vlan1: mtu=1500
vlan2: mtu=1500
vlan3: mtu=1500 IPv4=192.168.100.3
同时IP地址的设置时可有可无的,但是当需要通过telnet来访问vitesse switch的时候需要设置Ip地址。
VLAN配置没有变化,从上面的的VLAN配置中可知,我们配置了3个VLAN:
VLAN1,VLAN2,VLAN3,其中端口分配如下:
----  --------------------------------  -----
1     default                           1-29
2     testVlan2                         2,3
3     testVlan3                         4-6 //4,5,6是同一个VLAN
其中port2和port3属于VLAN2,port4~port5属于VLAN3。
其中default,没有实际的意思。
只有属于同一个VLAN组的port时间才能通信。
下面的数据包是:当pC和网桥分别接到了端口port2和port3。或者接除了port2~port6之外的数据包也是可以的。
其中PC的ip地址为:192.168.10.73
/ # ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:03:7F:FF:FF:FF  
          inet addr:192.168.10.102  Bcast:192.168.10.255  Mask:255.255.255.0
          inet6 addr: fe80::203:7fff:feff:ffff/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5672 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2317 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:641808 (626.7 KiB)  TX bytes:188376 (183.9 KiB)

eth0.2    Link encap:Ethernet  HWaddr 00:03:7F:FF:FF:F1  
          inet6 addr: fe80::203:7fff:feff:fff1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:42 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:2148 (2.0 KiB)

eth0.3    Link encap:Ethernet  HWaddr 00:03:7F:FF:FF:F2  
          inet addr:192.168.100.103  Bcast:192.168.100.255  Mask:255.255.255.0
          inet6 addr: fe80::203:7fff:feff:fff2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1044 errors:0 dropped:0 overruns:0 frame:0
          TX packets:707 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:87325 (85.2 KiB)  TX bytes:58034 (56.6 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:131 errors:0 dropped:0 overruns:0 frame:0
          TX packets:131 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:14816 (14.4 KiB)  TX bytes:14816 (14.4 KiB)

/ # tcpdump -i eth0 -xxvv
tcpdump: WARNING: can't create rx ring on packet socket 3: 99-Protocol not available
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 68 bytes
01:30:50.025429 IP (tos 0x0, ttl 64, id 7102, offset 0, flags [none], proto ICMP (1), length 60)
    192.168.10.73 > 192.168.10.102: ICMP echo request, id 256, seq 28170, length 40
        0x0000:  0003 7fff ffff d4be d90a 270c 0800 4500
        0x0010:  003c 1bbe 0000 4001 c903 c0a8 0a49 c0a8
        0x0020:  0a66 0800 de51 0100 6e0a 6162 6364 6566
        0x0030:  6768 696a 6b6c 6d6e 6f70 7172 7374 7576
        0x0040:  7761 6263
01:30:50.053645 IP (tos 0x0, ttl 64, id 22176, offset 0, flags [none], proto ICMP (1), length 60)
    192.168.10.102 > 192.168.10.73: ICMP echo reply, id 256, seq 28170, length 40
        0x0000:  d4be d90a 270c 0003 7fff ffff 0800 4500
        0x0010:  003c 56a0 0000 4001 8e21 c0a8 0a66 c0a8
        0x0020:  0a49 0000 e651 0100 6e0a 6162 6364 6566
        0x0030:  6768 696a 6b6c 6d6e 6f70 7172 7374 7576
        0x0040:  7761 6263
02:11:09.345741 STP 802.1s, Rapid STP, CIST Flags [Proposal, Learn, Forward, Agreement], CIST bridge-id 6469.73:63:61:72:64:00.8005, length 102
        message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
        CIST root-id 8000.00:01:c1:00:00:00, ext-pathcost 0 int-pathcost 17, port-role Designated
        CIST regional-root-id 8000.00:01:c1:00:00:00
        MSTP Configuration Name 00-01-c1-00-, revision 16, digest 000000116469736361726400100bb2a0
        CIST remaining-hops 0
        0x0000:  0180 c200 0000 0001 c100 0005 0069 4242
        0x0010:  0300 0003 027e 8000 0001 c100 0000 0000
        0x0020:  0000 8000 0001 c100 0000 8005 0000 1400
        0x0030:  0200 0f00 0000 4000 3030 2d30 312d 6331
        0x0040:  2d30 302d

抱歉!评论已关闭.