基于端口VLAN(共四个步骤,按下面步骤执行即可)步骤一:创建VLAN,例如创建VLAN101--VLAN104system-view系统视图vlan101vlan102vlan103vlan104^^^^^^建立vlan组或vlan101to104quit退出步骤二:给各个VLAN组配置IP地址interfacevl01interfacevlan-interface101进入VLAN配置interfacevl04interfacevlan-interface104进入vlan104[H3C-Vlan-interface104]ipaddress192.168.69.1255.255.255.0设置IP步骤三:将所要配置端口加入到VLAN组[H3C]interfaceGigabitEthernet1/0/1设置第一个端口[H3C-GigabitEthernet1/0/1]portaccessvlan101设置端口一为VLAN101组[H3C-GigabitEthernet1/0/2]portaccessvlan102设置端口二为VLAN102组[H3C-GigabitEthernet1/0/2]quit[H3C]save步骤四:启用组播路由H3Csystem-view[H3C]multicastrouting-enable//打开组播路由[H3C]interfaceVlan-interface101[H3C-Vlan-interface101]pimsm//打开组播所用到的协议[H3C-Vlan-interface101]igmpenable[H3C-Vlan-interface101]quit[H3C]interfaceVlan-interface102[H3C-Vlan-interface102]pimsm[H3C-Vlan-interface102]igmpenable[H3C-Vlan-interface2]quit步骤五:启用pim静态路由H3Csystem-view[H3C]pimstatic-rp192.168.100.1undo删除[H3C]undovlan103删除vlan103[H3C]interfaceGigabitEthernet1/0/3进入端口3[H3C-GigabitEthernet1/0/3]undoportlink-type删除portlink-type[H3C-GigabitEthernet1/0/3]undoporttrunk删除porttrunkdisdisplaycurrent-configuration显示当前配置基于多个VLAN在一个端口[H3C]interfaceGigabitEthernet1/0/2进入第二个端口设置[H3C-GigabitEthernet1/0/2]portlink-typetrunk端口的链路类型的树干[H3C-GigabitEthernet1/0/2]porttrunkpermitvlanall如果使用单独的就不用增加这项Pleasewait...........................................Done.[H3C-GigabitEthernet1/0/2]quit设置好了第二个端口的VLAN可以通过所有[H3C-GigabitEthernet1/0/2]porttrunkpermitvlan122在此端口上增加VLAN组displaystartup查看配置表resetsaved-configuration檫除旧的配置文件8。tftp192.168.11.55put123456.cfg导出配制文件123456.cfg到192.168.11.55tftp192.168.11.55get123456.cfg导入192.168.11.55配制文件123456.cfg