2011年11月23日 星期三

Bytes Bit 換算

1byte = 8 bit

ADSL 所說的 512K , 1M ,2M 指的是bit

所以 要除以 8

256K 就是 最大 32K Byte 下載
512K bit = 64K Byte
1M bit = 128K byte
2M bit = 256K byte

但是因為線路的關係,傳輸率大概是80%,所以看到的數值大概是
512K bit = 50K Byte
1M bit = 100K byte
2M bit = 200K byte

2011年10月31日 星期一

Extreme 指向 DHCP Server

XOS
configure bootprelay add 192.168.68.220 vr VR-Default
enable bootprelay vlan RTI-V10

Extremeware
enable bootprelay
configure bootprelay add 192.168.68.220

2011年10月30日 星期日

Extreme Troutbleshooting

Layer 2 problem
show ports configuration
show ports txerrors
show ports rxerrors
show ports collisions
show ports utilization
show edp ports all

Layer  2 problem
show fdb
clear fdb
show vlan <vlan name>
show edp ports all

Layer 3 problem
show vlan
show ipconfig
show iproute
show iparp
show ipstats
show ospf <interface>
show rip <interface>
ping
traceroute



2011年10月5日 星期三

netstat檢測網路連線用法

Netstat參數說明
-a : 顯示所有的連線
-b : 一併顯示建立連線的執行檔
-n : 使用數值方式顯示
-v : 顯示多一點的資訊
-o : 一併顯示建立連線的程序ID


例 : 記錄通訊行為方法
netstat -an 60 -p tcp > netlog.txt
每60秒紀錄一次連線狀態至netlog.txt檔案


TCPView也是一個好用的工具..

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

Extreme 基本命令 一

看看誰登錄Switch
show session
然後用clear session number

config account <username> 配置用戶帳號

config ports <portlist> auto off {speed [10 | 100 | 配置端口
1000]} duplex [half | full]

config time <date> <time> 配置時間和日期︰格式 mm dd yyyy hh mm ss 



config time 10 04 2011 13 42 22

config vlan <name> ipaddress <ip_address> 配置vlan的ip位址
{<mask>}

config vlan default ipaddress 192.168.1.1 255.255.255.0


create account [admin | user] <username> {<password>} 建立一個用戶帳號,admin或者是user 普通模式 
create account admin ryan XXXX

delete account <username> 刪除帳號

delete vlan <name> 刪除一個vlan 

disable clipaging 關閉螢幕輸出時候的暫停功能
enable 。。。。 開啟

disable ports [<portlist> | all] 關閉一個端口,或所有端口

disable telnet 關閉telnet 模式訪問交換機

disable web 關閉web模式訪問交換機



unconfig switch {all} 恢復出廠值,但不包括用戶改的時間和用戶帳號訊息

configure account 配置用戶密碼,不過首先你得先用create建立一個用戶帳號才能用這個改密碼 ExtremeWare支持2種級別的管理︰user和administrator

config dns-client add <ipaddress> 配置一個dns server

ping {udp} {continuous} {size <start_size> {- <end_size>}} [<ip_address> | <hostname>]
{from <src_address> | with record-route | from <src_ipaddress> with record-route}

udp 是指用udp包代替icmp包來ping
continuos 連續ping
size 製定icmp包大小,如果start和end都設置的話,那么每發一個包就增加一個位元組,如果製定開始100結尾200,那么第一次100,第二次101…… 如果沒指定end則按開始包大小發
from 發送源端口

traceroute [<ip_address> | <hostname>] {from <src_ipaddress>} {ttl <TTL>} {port
<port>} 
ttl 可指定ttl值
port 製定 udp端口號



show management 查看管理訊息,以及snmp訊息

config snmp add trapreceiver <ip address> {port <udp_port>} community <communitystring> {from <source ip address>} 配置snmp接收host和團契字元串

config snmp delete trapreceiver 這是刪掉trap

config snmp access-profile readonly [<access_profile> | none]配置snmp的只讀訪問列表,none是去除
config snmp access-profile readwrite [<access_profile> | none]
這是控制讀寫控制

config snmp (add 6.22版本)community [readonly | readwrite] <string>控制只讀和讀寫字元串 (在Extremeware Version 6.1.7 (Build 9)測試)


dhcp缺省在每個vlan的每個端口啟用,用以下命令修改
enable dhcp ports <portlist> vlan <name>
disable dhcp ports <portlist> vlan <name>


config cpu-dos-protect [alert-threshold <packets per second>] [notice-threshold
<packets per second>] [timeout <seconds>] [messages [on | off] [filter-precedence
<number>] 配置拒絕服務保護


enable cpu-dos-protect 是dos保護功能啟用
disable cpu-dos-protect

show cpu-dos-protect 顯示配置訊息 (以上為6。22版本)

config ip-mtu <size> vlan <vlan name> 配置mtuT的值可以設置為1500到9216