首先連接交換機的CONSOLE口,,使用超級終端進入交換機操作的指令界面:
配置VLAN1地址: <HG-S5500> sys System View: return to User View with Ctrl+Z. [HG-S5500] interface Vlan-interface 1 [HG-S5500-Vlan-interface1] ip address 192.168.254.1 24
開啟web和telnet服務(wù): [HG-S5500] ip http enable [HG-S5500] telnet server enable
建立管理用戶: [HG-S5500] local-user admin
設(shè)置密碼: [HG-S5500-luser-admin] password cipher admin110
為該用戶開啟web服務(wù): [HG-S5500-luser-admin] service-type web
為該用戶開啟telnet服務(wù): [HG-S5500-luser-admin] service-type telnet
將該用戶設(shè)置為管理員級別: [HG-S5500-luser-admin] authorization-attribute level 3
telnet訪問(vty)配置: [HG-S5500] user-interface vty 0 4
配置本地或遠端用戶名口令認證方式 [HG-S5500-ui-vty0-4] authentication-mode scheme
配置靜態(tài)路由連接外網(wǎng): [HG-S5500] ip route-static 0.0.0.0 0.0.0.0 192.168.254.2 (注:靜態(tài)路由地址為外網(wǎng)進來的接口地址)
建立網(wǎng)段訪問策略,,以vlan31為例,首先建立vlan31: [HG-S5500]vlan 31
配置vlan31的ip地址: [HG-S5500] interface Vlan-interface 31 [HG-S5500-Vlan-interface31] ip address 192.168.31.1 24
編寫31網(wǎng)段的訪問規(guī)則如能訪問34,、35網(wǎng)段,,不能訪問其他網(wǎng)段: 給其能訪問的規(guī)則名為 acl number 3100: [HG-S5500] acl number 3100 [HG-S5500-acl-adv-3100] rule permit ip source 192.168.31.1 0.0.0.255 destination 192.168.34.0 0.0.0.255 [HG-S5500-acl-adv-3100] rule permit ip source 192.168.31.1 0.0.0.255 destination 192.168.35.0 0.0.0.255
限制其訪問其他網(wǎng)段名為 acl number 3600: [HG-S5500] acl number 3600 [HG-S5500-acl-adv-3600] rule permit ip source 192.168.31.1 0.0.0.255 destination 192.168.0.0 0.0.255.255
首先注意一點交換機S5500不支持packet_filter,因此只能通過Qos實現(xiàn)vlan策略,,以上訴vlan31為例接著定義類h3100: [HG-S5500] traffic classifier h3100 [HG-S5500-classifier-h3100] if-match acl 3100
定義類h3600: [HG-S5500] traffic classifier h3600 [HG-S5500-classifier-h3600] if-match acl 3600
創(chuàng)建流hb3100為允許訪問,,hb3600為不允許訪問: [HG-S5500] traffic behavior hb3100 [HG-S5500-behavior-hb3100] filter permit [HG-S5500] traffic behavior hb3600 [HG-S5500-behavior-hb3600] filter deny
創(chuàng)建Qos policy: [HG-S5500] qos policy hvlan31
綁定: [HG-S5500-qospolicy-hvlan31] classifier h3100 behavior hb3100 [HG-S5500-qospolicy-hvlan31] classifier h3600 behavior hb3600
綁定Qos策略: [HG-S5500] qos vlan-policy hvlan31 vlan 31 inbound
初始化操作: <HG-S5500> reset saved-configuration
選擇確認初始化Y: <HG-S5500> Y
重啟即可生效: <HG-S5500> reboot
保存配置: [HG-S5500] save The current configuration will be written to the device. Are you sure? [Y/N]: y Please input the file name(*.cfg)[flash:/20130115.cfg] (To leave the existing filename unchanged, press the enter key): 20140408.cfg 備注:編寫其他vlan策略,請仿照紅字處vlan31開始根據(jù)步驟編寫即可,。 |
|