D-LINK網(wǎng)絡(luò)交換機的CLI的配置說明書
Show 命令可以查看交換機的各項的配置(交換機無法查看整體的當前和保存的配置信息)
Create 命令可以創(chuàng)建交換的信息
Config 命令可以對這些參數(shù)進行配置
Delete命令可以刪除所配制的參數(shù)
Reboot 命令對交換機進行重新啟動
Save 命令保存交換機的配置信息的修改
Reset 命令清空配置信息
reset system 不僅清空運行時配置 ,還將把曾經(jīng)保存過的配置全部清空,
reset config僅清空運行時配置.
Create account [admin|user]<username> 創(chuàng)建admin或user級別的用戶,回車輸入兩次密碼創(chuàng)建輸入為空密碼
Create account <username> 修改已創(chuàng)建的username用戶,回車輸入舊密碼,在輸入兩次新密碼
Show account 可以看到你所創(chuàng)建的用戶
Show switch 可以查看交換機的信息
Show iproute 查看路由表
Show vlan 查看VLAN條目
[enable|disable] telnet 23 此命令開啟|刪除telnet功能
enable mac_notification 默認是關(guān)閉MAC地址通告的
show ipif 查看交換機的配置接口信息
config ipif System ipaddress 10.1.1.1/8 修改System接口的IP地址 注意接口名System的大小寫
備份/恢復(fù)配置
download configuration 192.168.0.157 c:/xuekang/setting.txt 從192.168.0.157上下載配置文件
upload configuration 192.168.0.157 c:/xuekang/setting.txt 到192.168.0.157上上穿配置文件
端口鏡像的設(shè)定
config mirror port 1:5 [add|delete] sourece port 1:1-1:5 把1-5斷口加到5端口上做鏡像(默認關(guān)閉)
鏈路聚合配置
create link_aggregation group_id 1 創(chuàng)建一個聚合組1
config link_aggregation group_id 1 master_port 5 ports 5-7,9
創(chuàng)建MAC地址的綁定
create arpentry 192.168.0.157 00-56-b5-45-B5-4H 為主機綁定IP
delete arpentry 192.168.0.157 刪除IP的綁定
show arpentry 查看某些主機的綁定
CLI SWITCH LAYER3 VLAN 設(shè)定(以下Command 請注意大小寫)
config vlan default delete 1-24 ->將default Vlan 移除,否則Port 在不帶
tag 的狀況下,將無法繼續(xù)以下的Vlan 設(shè)定。
create vlan vlan1 tag 10 ->新增一個Vlan;Vlan Name 為Vlan1,Vlan Tag(等于VID) 為10。
create vlan vlan2 tag 20 ->新增一個Vlan;Vlan Name 為Vlan2,Vlan Tag(等于VID) 為為20。
create vlan vlan3 tag 30 ->新增一個Vlan;Vlan Name 為Vlan3,Vlan Tag(等與VID) 為30。
config vlan vlan1 add untagged 1-8 ->設(shè)定Vlan1 的Port 范圍為Port 1-8,且不帶Tag。
config vlan vlan2 add untagged 9-16 ->設(shè)定Vlan2 的Port 范圍為Port 9-16,且不帶Tag。
config vlan vlan3 add untagged 17-24 ->設(shè)定Vlan3 的Port 范圍為Port 17-24,且不帶Tag。注:untagged為tagged是為trunk口 trunk端口可立屬于多個VLAN中。
create ipif if_vlan1 192.168.0.253/24 vlan1 state enable
->針對Vlan1 指定一個IP Interface(if_vlan1),IP 位址為192.168.0.253。(這個虛口就是接外網(wǎng)的接口)
create ipif if_vlan2 192.168.10.254/24 vlan2 state enable ->針對Vlan2 指定一個IP Interface(if_vlan2),IP 位址為192.168.10.254。
create ipif if_vlan3 192.168.20.254/24 vlan3 state enable
->針對Vlan3 指定一個IP Interface(if_vlan3),IP 位址為192.168.20.254。
create iproute default 192.168.0.254 ->設(shè)定Default route 位置為最上端gateway 192.168.0.254.
save >儲存設(shè)定
QOS的配置
Config bandwidth_control 1-10 tx_rate 10 設(shè)定端口1-10流量為10
訪問控制列表(ACL)的配置
create access_profile[ethernet { vlan | source_mac <macmask> | destination_mac <macmask> |
802.1p | ethernet_type} | ip { vlan|source_ip_mask<netmask> | destination_ip_mask <netmask> | dscp | [ icmp { type | code} | igmp {type} | tcp { src_port_mask <hex 0x0-0xffff> | flag_mask [ all | { urg | ack | psh | rst |syn | fin } ] } | dst_port_mask <hex 0x0-0xffff>] | udp {src_port_mask <hex 0x0-0xfff> | dst_port_mask <hex 0x0-0xffff>} | protocol_id { user_mask <hex 0x0-0xffffffff> } } } ] { profile_id <value 1-255>}
以下為ACL配置事例:
要求:3326S交換機上所作的vlan 規(guī)劃:將提供QQ/FTP/WWW以及連接上網(wǎng)服務(wù)的路由器的端口劃分為Vlan10,并將其作為“公共端口”來使用(假設(shè)在3326S上使用1-5端口);將財務(wù)部、人事部以及其他未做特殊要求的部分設(shè)定為Vlan20/Vlan30和Vlan50,分別使用交換機的6-10,11-15,21-24端口,他們之間不能夠互相訪問,但都可以訪問服務(wù)器所在的Vlan10;最后,將客戶服務(wù)器劃分為Vlan40,使用交換機的16-20端口,該Vlan與其他各個Vlan之間均不能夠通訊(包括公共端口所在的Vlan10)。
具體配置:
VLAN和IP的創(chuàng)建在這里就不在具體述說了
ACL的設(shè)定為:
#Create access_profile ip source_ip_mask 255.255.255.0 destination_ip_mask 255.255.255.0 deny profile_id 100 在access_prolile id為100的限制規(guī)則前提下,進行各個Vlan之間訪問權(quán)限的設(shè)定
#config access_profile profile_id 100 add access_id 101 ip source_ip192.168.20.2 destination_ip 192.168.30.2
#config access_profile profile_id 100 add access_id 102 ip source_ip192.168.20.2 destination_ip 192.168.40.2
#config access_profile profile_id 100 add access_id 103 ip source_ip192.168.20.2 destination_ip 192.168.50.2
以上設(shè)定設(shè)定使Vlan20不能夠同Vlan30/40/50通訊,只能訪問Vlan10的服務(wù)器
#config access_profile profile_id 100 add access_id 104 ip source_ip 192.168.30.2 destination_ip 192.168.40.2
#config access_profile profile_id 100 add access_id 105 ip source_ip 192.168.30.2 destination_ip 192.168.50.2
以上設(shè)定使Vlan30不能夠同Vlan40/50通訊,只能訪問Vlan10的服務(wù)器( 由于ACL的限制是雙向的,故就不用再設(shè)定Vlan30不能和Vlan20通訊了,因為在(1)中的Vlan20已經(jīng)做了這個控制)
#config access_profile profile_id 100 add access_id 106 ip source_ip 192.168.40.2 destination_ip 192.168.50.2
#config access_profile profile_id 100 add access_id 107 ip source_ip 192.168.40.2 destination_ip 192.168.10.2
設(shè)定使Vlan40不能夠同Vlan10和Vlan50通訊