2011年10月4日 星期二

Extreme 基本命令 二

負載均衡︰
和cisco的FEC差不多,也是允許使用多個端口綁定在一起來增加帶寬
有三種算法︰
1. 基于端口。(默認)就是說可以用指定物理端口來轉發流量進行負載均衡就是說把某幾個端口的流量均衡一下
2. 基于位址,包括 ip位址,ipx位址等(推薦)用位址來進行負載均衡mac ip tcp udp都可以
config sharing address-based <l2 | l2_l3 | l2_l3_l4>
l2 表示用mac位址
l3表示用ip
l4表示tcp和udp端口號
show sharing address-based

3. 循環

配置負載均衡︰
首先得建立一個負載均衡端口組,組中第一個端口配置為master邏輯端口,它代表這個組。在summit交換機上建立負載均衡可以︰
1. 一個組中最多包含8個端口
2. 端口不用連續
定義一個負載均衡組,先分發一個組號,邏輯端口號,並使能這個組(不知道怎么說這句話)
enable sharing <port> grouping <portlist> {port-based | address-based | round-robin}
disable sharing <port>

負載均衡的例子︰
enable sharing 9 grouping 9-12 #定義一個負載均衡組9,包括9-12端口
如果這些端口屬于某個vlan,那么將會從vlan中刪除

校驗︰show ports configuration

端口鏡像︰
什麼是鏡像就不用說了吧,cisco也有^_^
1. 物理端口,把這個端口的數據都複製到鏡像端口中去
2. Vlan,把vlan的所有數據都複製到鏡像口
3. 虛端口,vlan中指定端口複製到鏡像口
一旦最為鏡像口就不能上網了
例子︰

enable mirroring to port 3 #選擇3作為鏡像口
config mirroring add port 1 #把端口1的流量發送到3
config mirroring add port 1 vlan default #把1和vlan default的流量都發送到3

交換機的vlan default包含所有的端口,就是說說有的端口都屬于default(初始狀態),並且所有口都是untagged,內部vlanid為1

config vlan <old_name> name <new_name> vlan改名

show vlan {<name> | detail} 查看vlan訊息
show vlan stats vlan <name> ... <name> 查vlan狀態
show protocol {<protocol>} 查看協議

局域mac的vlan例子︰
enable mac-vlan mac-group any ports 10-15
enable mac-vlan mac-group 10 ports 16-17
enable mac-vlan mac-group 200 ports 18-20
config mac-vlan add mac-address 00:00:00:00:00:01 mac-group 10 engineering
config mac-vlan add mac-address 00:00:00:00:00:02 mac-group any marketing
config mac-vlan add mac-address 00:00:00:00:00:03 mac-group 200 sales

FDB轉發數據庫︰
create fdbentry [<mac_address> | any-mac] vlan <name> dynamic
[qosprofile <qosprofile> {ingress-qosprofile <iqosprofile>} |
ingress-qosprofile <qosprofile> {qosprofile <qosprofile>}]
關聯一個qos和fdb動態表項

create fdbentry <mac_address> vlan <name> ports [<portlist | all]
{qosprofile <qosprofile>} {ingress-qosprofile <iqosprofile>}
和fdb永久表項關聯qos

create fdbentry 00:E0:2B:12:34:56 vlan marketing port 3:4
增加一個fdb表項

基于MAC的安全配置︰
基于mac的安全允許你控制fdb的學習和傳播

config ports [<portlist> vlan <name> | all] limit-learning <number>限制端口的mac條目範圍是 0 to 500,000
config ports [<portlist> vlan <name> | all] unlimited-learning清除

show vlan <name> security 顯示安全配置
show ports <portlist> info detail 顯示port安全配置
config ports [<portlist> vlan <name> | all] lock-learning 鎖住現有的mac,不再學習新的表項
config ports [<portlist> vlan <name> | all] unlock-learning 解鎖

show fdb {<mac_address> | vlan <name> | ports <portlist> | permanent}顯示fdb表項

QoS配置︰
基于策略的qos允許你對于一些重要的應用程式提供保護帶寬,比如,voip要有特殊的帶寬控制。用qos可以保留足夠的帶寬來給特殊的應用。

如何配置︰
配置qos你要用qos profiles定義交換機如何來區分不同種類的流量

1. 配置qos profile
2. 創建traffic grouping,
如應用到一個 vlan config vlan <name> qosprofile <qosprofile>

3. 監控

Qos profile
一個qosprofile用特殊的流量屬性定義了一類服務,比如帶寬,參數包括︰
Minimum bandwidth 保留全部帶寬的最小百分比使用物理端口的硬體隊列,缺省是0%
Maximum bandwidth 最大使用帶寬
Priority 
Buffer

show qosprofile <qosprofile>
show ports <portlist> info {detail}
or
show vlan 檢查qos 配置


Access-Lists
要構建一個表,倪要先指定一個規則,一個缺省規則包含目標和源ip的反碼,沒有第4層訊息。

例子︰
• Deny UDP port 32 and TCP port 23 traffic to the 10.2.XX network.
• All other TCP port 23 traffic destined for other 10.X.X.X networks is permitted using QoS profile
Qp4.
• All remaining traffic to 10.2.0.0 uses QoS profile Qp3.
With no default rule specified, all remaining traffic is allowed using the default QoS profile.
create access-list deny102_32 udp dest 10.2.0.0/16 ip-port 32 source any ip-port any
deny ports any(我理解是交換機的所有端口) precedence 10
create access-list deny102_23 tcp dest 10.2.0.0/16 ip-port 23 source any ip-port any
deny ports any precedence 20
create access-list allow10_23 tcp dest 10.0.0.0/8 ip-port 23 source any ip-port any
permit qosprofile qp4 ports any precedence 30
create access-list allow102 ip dest 10.2.0.0/16 source 0.0.0.0/0 permit qosprofile qp3
ports any precedence 40

show access-list {<name> | port <portlist>}
show access-list-monitor

過濾ICMP包︰
echo的icmp code是8
echo reply的code是0
create access-list denyping icmp destination any source any type 8 code 0 deny ports
any

配置NAT
1. Enable nat #啟用nat
2. 建立nat規則(動態和靜態)
Static NAT Rule Example
config nat add out_vlan_1 map source 192.168.1.12/32 to 216.52.8.32/32
Dynamic NAT Rule Example
config nat add out_vlan_1 map source 192.168.1.0/24 to 216.52.8.1 - 216.52.8.31
Portmap NAT Rule Example
config nat add out_vlan_2 map source 192.168.2.0/25 to 216.52.8.32 /28 both portmap
Portmap Min-Max Example
config nat add out_vlan_2 map source 192.168.2.128/25 to 216.52.8.64/28 tcp portmap
1024 - 8192

3. show nat rules {vlan <outside_vlan>}
show nat stats
檢查
disable nat 關閉nat

一般配置︰

1.先建立一個vlan

create vlan test

2.然後在配置vlan的界面位址

configure vlan test ipaddress
config vlan test ipaddress 123.45.67.8 / 24
configure test tag 900 為test 打標籤為900


3. 配置缺省通訊閘

config iproute add default <gateway>

4.Save 存儲配置文件
5.configure test add ports 45 tagged 增加45進test vlan
6.configure ports 45 auto on 配置45端口
7.enable ports 45 使能45端口
8.Enable ipforwarding on the <vlan name> 使vlan能夠轉發ip
9.conf vlan xxx proto ip #重要,不然不能添加端口untaggedsu

沒有留言: