熱備援路由協定HSRP
S1(config)#interface vlan 50
S1(config-if)#ip address 192.168.1.10 255.255.255.0
S1(config-if)#standby 1 priority 200
S1(config-if)#standby 1 ip 192.168.1.1
S1(config-if)#standby 1 authentication MyKey
S1(config-if)#standby 2 priority 100
S1(config-if)#standby 2 ip 192.168.1.2
S1(config-if)#standby 2 authentication MyKey
S2(config)#interface vlan 50
S2(config-if)#ip address 192.168.1.11 255.255.255.0
S2(config-if)#standby 1 priority 100
S2(config-if)#standby 1 ip 192.168.1.1
S2(config-if)#standby 1 authentication MyKey
S2(config-if)#standby 2 priority 200
S2(config-if)#standby 2 ip 192.168.1.2
S2(config-if)#standby 2 authentication MyKey
檢視HSRP
S1#show standby vlan 50 brief
--------------------------------------------------------
虛擬路由器備援VRRP
S1(config)#interface vlan 50
S1(config-if)#ip address 192.168.1.10 255.255.255.0
S1(config-if)#vrrp 1 priority 200
S1(config-if)#vrrp 1 ip 192.168.1.1
S1(config-if)#vrrp 2 priority 100
S1(config-if)#no vrrp 2 preempt
S1(config-if)#vrrp 2 ip 192.168.1.2
S2(config)#interface vlan 50
S2(config-if)#ip address 192.168.1.11 255.255.255.0
S2(config-if)#vrrp 1 priority 100
S2(config-if)#no vrrp 1 preempt
S2(config-if)#vrrp 1 ip 192.168.1.1
S2(config-if)#vrrp 2 priority 200
S2(config-if)#vrrp 2 ip 192.168.1.2
檢視VRRP
S1#show vrrp brief
---------------------------------------------------------
閘道負載平衡協定GLBP
S1(config)#interface vlan 50
S1(config-if)#ip address 192.168.1.10 255.255.255.0
S1(config-if)#glbp 1 priority 200
S1(config-if)#glbp 1 preempt
S1(config-if)#glbp 1 192.168.1.1
S2(config)#interface vlan 50
S2(config-if)#ip address 192.168.1.11 255.255.255.0
S2(config-if)#glbp 1 priority 150
S2(config-if)#glbp 1 preempt
S2(config-if)#glbp 1 192.168.1.1
S3(config)#interface vlan 50
S3(config-if)#ip address 192.168.1.12 255.255.255.0
S3(config-if)#glbp 1 priority 100
S3(config-if)#glbp 1 192.168.1.1
檢視GLBP
S1#show glbp brief
--------------------------------------------------------
設定備援模式
R1(config)#redundancy
R1(config-red)#mode rpr(rpr-plus | sso)
查看備援模式狀態
show redundancy states
2014年12月9日 星期二
2014年12月7日 星期日
VLAN
ISL(Inter-Switch Link)跨交換器鏈路-Cisco設備專用
VTP(VLAN Trunking Protocol)VLAN主幹通訊協定
新增VLAN
S1#config t
S1(config)#vlan 20
S1(config-vlan)#Engineering
指派交換埠給vlan
S1(config)#interface fa0/0
S1(config-if)#switchport
S1(config-if)#switchport mode access
S1(config-if)#switchport access vlan 20
VLAN Trunk設定
S1(config)#interface gi0/1
S1(config-if)#switchport trunk encapsulation dot1q
S1(config-if)#switchport trunk native vlan 20
S1(config-if)#switchport trunk allowed vlan all
S1(config-if)#switchport trunk mode dynamic desirable
檢視trunk狀態
S1#show interface fa0/1 trunk
S1#show interface status
S1#show vlan id 20
S1#show interface fa0/1 switchport
S1#show interface fa0/1 trunk
檢視vtp組態
S1#show vtp status
設定vtp管理領域
S1(config)#vtp domain Jason
設定vtp模式
S1(config)#vtp mode server
S1(config)#vtp password 12345
設定vtp版本
S1(config)#vtp vsesion 2
啟用vtp修剪
S1(config)#vtp pruning
VTP(VLAN Trunking Protocol)VLAN主幹通訊協定
新增VLAN
S1#config t
S1(config)#vlan 20
S1(config-vlan)#Engineering
指派交換埠給vlan
S1(config)#interface fa0/0
S1(config-if)#switchport
S1(config-if)#switchport mode access
S1(config-if)#switchport access vlan 20
VLAN Trunk設定
S1(config)#interface gi0/1
S1(config-if)#switchport trunk encapsulation dot1q
S1(config-if)#switchport trunk native vlan 20
S1(config-if)#switchport trunk allowed vlan all
S1(config-if)#switchport trunk mode dynamic desirable
檢視trunk狀態
S1#show interface fa0/1 trunk
S1#show interface status
S1#show vlan id 20
S1#show interface fa0/1 switchport
S1#show interface fa0/1 trunk
檢視vtp組態
S1#show vtp status
設定vtp管理領域
S1(config)#vtp domain Jason
設定vtp模式
S1(config)#vtp mode server
S1(config)#vtp password 12345
設定vtp版本
S1(config)#vtp vsesion 2
啟用vtp修剪
S1(config)#vtp pruning
2014年12月4日 星期四
EIGRP and OSPF
啟動EIGRP
R1#config t
R1(config)#router eigrp 20
R1(config-router)#network 172.16.0.0
R1(config-router)#network 10.0.0.0
讓某介面停用EIGRP
R1(config)#router eigrp 20
R1(config-router)#passive-interface serial 0/1
自動總結
自動總結
R1#config t
R1(config)#router eigrp 20
R1(config-router)#no auto-summary
修改頻寬與延遲
R1#config t
R1(config)#int s0/0/1
R1(config-if)#bandwith 256
R1(config-if)#delay 300000
確認EIGRP的指令
R1#show ip route
R1#show ip route eigrp
R1#show ip route eigrp neighbors
R1#show ip protocols
R1#debug eigrp packet
啟用OSPF 192.168.10.65/29 and 10.255.255.81/30
R1(config-router)#no auto-summary
修改頻寬與延遲
R1#config t
R1(config)#int s0/0/1
R1(config-if)#bandwith 256
R1(config-if)#delay 300000
確認EIGRP的指令
R1#show ip route
R1#show ip route eigrp
R1#show ip route eigrp neighbors
R1#show ip protocols
R1#debug eigrp packet
啟用OSPF 192.168.10.65/29 and 10.255.255.81/30
R1#config t
R1(config)#router ospf 1
R1(config-router)#network 192.168.10.64 0.0.0.7 area 0
R1(config-router)#network 10.255.255.80 0.0.0.3 area 0
確認OSPF的指令
R1#show ip route
R1#show ip int brief
R1#show ip ospf
R1#show ip ospf int f0/0
R1#show ip route ospf neighbor
R1#show ip protocols
R1#debug ospf packet
R1#debug ospf hello
R1#debug ospf adj
確認OSPF的指令
R1#show ip route
R1#show ip int brief
R1#show ip ospf
R1#show ip ospf int f0/0
R1#show ip route ospf neighbor
R1#show ip protocols
R1#debug ospf packet
R1#debug ospf hello
R1#debug ospf adj
2014年11月19日 星期三
RIP與RIPv2遶送
R1#show ip route
設定RIP遶送
R1#config
R1(config)#router rip
R1(config-router)#network 172.16.1.0
阻止RIP宣傳出去扔然可以接收RIP更新
R1#config
R1(config)#router rip
R1(config-router)#network 172.16.1.0
R1(config-router)#passive-interface serial 0/0
設定RIPv2遶送(使用多點傳播位址224.0.0.9)
R1#config
R1(config)#router rip
R1(config-router)#network 172.16.1.0
R1(config-router)#version 2
顯示路由器上的遶送協定
R1#sh ip protocols
顯示路由器上的資訊
R1#sh ip interface brief
將路由器所傳送與接收的路徑更新資訊(如果使用telnet須使用terminal monitor命令才能接收輸出)
R1#debug ip rip
設定RIP遶送
R1#config
R1(config)#router rip
R1(config-router)#network 172.16.1.0
阻止RIP宣傳出去扔然可以接收RIP更新
R1#config
R1(config)#router rip
R1(config-router)#network 172.16.1.0
R1(config-router)#passive-interface serial 0/0
設定RIPv2遶送(使用多點傳播位址224.0.0.9)
R1#config
R1(config)#router rip
R1(config-router)#network 172.16.1.0
R1(config-router)#version 2
顯示路由器上的遶送協定
R1#sh ip protocols
顯示路由器上的資訊
R1#sh ip interface brief
將路由器所傳送與接收的路徑更新資訊(如果使用telnet須使用terminal monitor命令才能接收輸出)
R1#debug ip rip
2014年11月18日 星期二
Cisco 忘記密碼 備份
復原密碼
1.開機按Ctrl+Break
2.出現ROOM監視模式
rommon 1>
3.
rommon 1>confreg 0x2142
rommon 1>reset
4.
>o輸入後會出現選單
>o/r 0x2142
輸入
>I或reset
Entert後可進入特權模式
copy start run
改變密碼
config t
enable secret test
後
config t
config-register 0x2102
確認flash ram
Router#sh flash (會秀所有檔案)
或
Router#sh ver(僅秀目前運行中之檔案)
備份IOS
Router#copy flash tftp
復原或升級IOS
Router#copy tftp flash
R1#show file info flash:filename.bin
R1#delete flash:filename.bin
備份復原組態
R1#copy run start
R1#copy start run
R1#copy run tftp
R1#erase start 刪除啟動組態檔
R1#reload重啟後會進入裝配模式
發現協定CDP
關閉CDP
R1#no cdp run
收集鄰居資訊
R1#sh cdp neighbors
R1#sh cdp neighbors detail
1.開機按Ctrl+Break
2.出現ROOM監視模式
rommon 1>
3.
rommon 1>confreg 0x2142
rommon 1>reset
4.
>o輸入後會出現選單
>o/r 0x2142
輸入
>I或reset
Entert後可進入特權模式
copy start run
改變密碼
config t
enable secret test
後
config t
config-register 0x2102
確認flash ram
Router#sh flash (會秀所有檔案)
或
Router#sh ver(僅秀目前運行中之檔案)
備份IOS
Router#copy flash tftp
復原或升級IOS
Router#copy tftp flash
R1#show file info flash:filename.bin
R1#delete flash:filename.bin
備份復原組態
R1#copy run start
R1#copy start run
R1#copy run tftp
R1#erase start 刪除啟動組態檔
R1#reload重啟後會進入裝配模式
發現協定CDP
關閉CDP
R1#no cdp run
收集鄰居資訊
R1#sh cdp neighbors
R1#sh cdp neighbors detail
2014年10月29日 星期三
Cisco設定路由器與交換器的管理性組態
主機名稱
Router(config)#hostname R1
標題訊息
R1(config)#banner motd #
If you are not authorized to be in Acme.com network, then you must disconnect immediately.
#
設定密碼
S1(config)#enable secret 1qaz@WSX(否則不會出現提示)
line進入設定使用者密碼模式後須輸入login
S1(config)#line aux 0
S1(config-line)#login
S1(config-line)#password 1qaz@WSX
S1(config-line)#login
S1(config)#line con 0
S1(config-line)#password 1qaz@WSX
S1(config-line)#login
S1(config)#line con 0
S1(config-line)#password 1qaz@WSX
S1(config-line)#login
S1(config-line)#exec-time 0 0 控制台不逾時跳出
S1(config-line)#logging synchronous 讓控制台不跳出干擾訊息
S1(config)#line vty 0 1
S1(config-line)#password 1qaz@WSX
S1(config-line)#login
建立SSH
1.設定主機名稱
Router(config)#hostname R1
2.設定網域名稱
R1(config)#ip domain-name test.com
3.設定使用者名稱讓SSH客戶端能夠存取
R1(config)#username admin password test
4.產生會談所需之金鑰
R1(config)#crypto key generate rsa general-keys modulus 1024
5.產生SSH Version 2版本
R1(config)#ssh version 2
6.連到vty線路
R1(config)#line vty 0 1180
7.設定與皆可使用
R1(config)#transport input ssh telnet
對密碼加密
R1(config)#service password-encryption
附加說明
R1(config)#int s0/0/0
R1(config-if)#description Wan to Intra
設定介面的ip位址
R1(config)#int f0/1
R1(config-if)#ip address 172.16.10.2 255.255.255.0
增加第二個子網路位址
R1(config-if)#ip address 172.16.20.2 255.255.255.0 secondary
設定DCE
R1(config)#int s0/0/0
R1(config-if)#clock rate 1000000
顯示DCE
R1#sh controllers s0/2/0
設定頻寬
R1(config)#int s0/0/0
R1(config-if)#bandwidth
---------------------------------
刪除組態
R1(config)#erase startup-config
顯示介面之精簡概要
R1(config)#show ip interface brief
顯示介面第一二層之狀態
R1(config)#show protocols
顯示DCE
R1#sh controllers s0/2/0
Router(config)#hostname R1
標題訊息
R1(config)#banner motd #
If you are not authorized to be in Acme.com network, then you must disconnect immediately.
#
設定密碼
S1(config)#enable secret 1qaz@WSX(否則不會出現提示)
line進入設定使用者密碼模式後須輸入login
S1(config)#line aux 0
S1(config-line)#login
S1(config-line)#password 1qaz@WSX
S1(config-line)#login
S1(config)#line con 0
S1(config-line)#password 1qaz@WSX
S1(config-line)#login
S1(config)#line con 0
S1(config-line)#password 1qaz@WSX
S1(config-line)#login
S1(config-line)#exec-time 0 0 控制台不逾時跳出
S1(config-line)#logging synchronous 讓控制台不跳出干擾訊息
S1(config)#line vty 0 1
S1(config-line)#password 1qaz@WSX
S1(config-line)#login
建立SSH
1.設定主機名稱
Router(config)#hostname R1
2.設定網域名稱
R1(config)#ip domain-name test.com
3.設定使用者名稱讓SSH客戶端能夠存取
R1(config)#username admin password test
4.產生會談所需之金鑰
R1(config)#crypto key generate rsa general-keys modulus 1024
5.產生SSH Version 2版本
R1(config)#ssh version 2
6.連到vty線路
R1(config)#line vty 0 1180
7.設定與皆可使用
R1(config)#transport input ssh telnet
對密碼加密
R1(config)#service password-encryption
附加說明
R1(config)#int s0/0/0
R1(config-if)#description Wan to Intra
設定介面的ip位址
R1(config)#int f0/1
R1(config-if)#ip address 172.16.10.2 255.255.255.0
增加第二個子網路位址
R1(config-if)#ip address 172.16.20.2 255.255.255.0 secondary
設定DCE
R1(config)#int s0/0/0
R1(config-if)#clock rate 1000000
顯示DCE
R1#sh controllers s0/2/0
設定頻寬
R1(config)#int s0/0/0
R1(config-if)#bandwidth
---------------------------------
刪除組態
R1(config)#erase startup-config
顯示介面之精簡概要
R1(config)#show ip interface brief
顯示介面第一二層之狀態
R1(config)#show protocols
顯示DCE
R1#sh controllers s0/2/0
各廠牌Switch config file backup
D-Link des-3052
#upload cfg_toTFTP x.x.x.x *.cfg(filename)
D-Link des-3550
#upload configuration x.x.x.x filename
D-Link des-3220
#upload cfg_toTFTP x.x.x.x dest_file filename
#upload cfg_toTFTP x.x.x.x *.cfg(filename)
D-Link des-3550
#upload configuration x.x.x.x filename
D-Link des-3220
#upload cfg_toTFTP x.x.x.x dest_file filename
2014年10月19日 星期日
子網路切割
#二的次方 記2(4)=16其他用部數去推算
2(1)=2
2(2)=4
2(3)=8
2(4)=16
2(5)=32
2(6)=64
2(7)=128
2(8)=256
2(9)=512
2(10)=1024
相繼都是前一個的兩倍
#
128(10000000)
192(11000000)(128+64)
224(11100000)(128+64+32)
240(11110000)(128+64+32+16)
248(11111000)(123+64+32+16+8)
252(11111100)(128+64+32+16+8+4)
128-192-224-240-248-252
#CIDR
255.0.0.0 /8
255.255.0.0 /16
255.255.255.0 /24
2(1)=2
2(2)=4
2(3)=8
2(4)=16
2(5)=32
2(6)=64
2(7)=128
2(8)=256
2(9)=512
2(10)=1024
相繼都是前一個的兩倍
#
128(10000000)
192(11000000)(128+64)
224(11100000)(128+64+32)
240(11110000)(128+64+32+16)
248(11111000)(123+64+32+16+8)
252(11111100)(128+64+32+16+8+4)
128-192-224-240-248-252
#CIDR
255.0.0.0 /8
255.255.0.0 /16
255.255.255.0 /24
#/後面的數字代表有幾個1例:
200.1.1.130/28
/28子網路遮罩為
11111111.11111111.11111111.11110000(28個1)
最右邊4個1分別為128+64+32+16=240
#切割C級子網路
1.多少子網路?(可以切幾個網段)
多少個1 EX:1100000000, 2(2)=4
2.子網路的有效主機 ?
多少個0-2 EX:11000000,2(6)=62
3.有效子網路?
256-子網路遮罩 EX:256-192=64 0,64,128,192
4.廣播位址?
次個子網路的前一 個號碼 EX:0,64,128,192為63,127,191,
5.子網路的有效主機?
扣掉全為0與1
#切割C級子網路
1.多少子網路?(可以切幾個網段)
多少個1 EX:1100000000, 2(2)=4
2.子網路的有效主機 ?
多少個0-2 EX:11000000,2(6)=62
3.有效子網路?
256-子網路遮罩 EX:256-192=64 0,64,128,192
4.廣播位址?
次個子網路的前一 個號碼 EX:0,64,128,192為63,127,191,
5.子網路的有效主機?
扣掉全為0與1
2014年9月15日 星期一
Cisco 設定
#STP
Switch# show spanning interface fastetherent 0/1
其中之Sts可以看出狀態
#Ether Channel設定
S(config)#lacp system-priority 100 設定權重預設(或沒設定為3,2768)
S(config)#interface range fa0/1-2
S(config)#channel-protocol lacp
S(config)#channel-group 1 mode active (最多6組)
S(config)#lacp port-priority 100 S 設定port權重預設(或沒設定為3,2768)
以下設定備援用無指定權重
S(config)#interface range fa0/3-4
S(config)#channel-protocol lacp
S(config)#channel-group 1 mode active
Switch# show spanning interface fastetherent 0/1
其中之Sts可以看出狀態
#Ether Channel設定
S(config)#lacp system-priority 100 設定權重預設(或沒設定為3,2768)
S(config)#interface range fa0/1-2
S(config)#channel-protocol lacp
S(config)#channel-group 1 mode active (最多6組)
S(config)#lacp port-priority 100 S 設定port權重預設(或沒設定為3,2768)
以下設定備援用無指定權重
S(config)#interface range fa0/3-4
S(config)#channel-protocol lacp
S(config)#channel-group 1 mode active
2014年9月14日 星期日
Juniper Switch進階設定
Juniper Switch進階設定
#設定 Link Aggfregation( port channel)
set interfaces ge-0/0/0 ether-options 802.3ad ae0set interfaces ge-0/0/1 ether-options 802.3ad ae0
2014年9月11日 星期四
Juniper Switch 基本設定
#消滅紅燈
1.未儲存此檔案面板 Alarms 燈號將會亮紅燈>request system configuration rescue save
#回到running config,也就是說還沒commit的設定全rollback 0#回到上一次commit設定rollback 1
2.管理埠號為未連接狀態則 Switch 前方面板會亮紅燈#set chassis alarm management-ethernet link-down ignore
#將設定檔以指令的方式顯示
#[edit]
show | display set
#[edit]show | display set
#關機
>request system halt
#重新啟動
>request system reboot
>request system halt#重新啟動
>request system reboot
#讓我們回到從前-恢復原廠預設值
1.非常徹底-回復出廠預設值 (包含 root 密碼為空白)
%rm -rf /config/juniper.conf.*.gz %rm -rf /config/db/config/juniper.conf.*.gz %reboot
2.留下一點殘存記憶吧-回復出廠預設值 (不包含 root 密碼並且先手動設定)
#load factory-default #set system root-authentication plain-text-password #commit
3.誰記得阿-重新設定管理密碼
Loader >boot –s //進入 Single User Mode For/bin/sh : recovery //鍵入 recovery Root > configure //鍵入 configure Root#set system root-authentication plain-text-password //重新設定管理密碼 Root#commit
4.reset config
1.#[edit] |
2 | load factory-default |
3 |
4 | #設定root密碼 |
5 | set system root-authentication plain-text-password |
6 | commit |
#設定帳號
帳號的類別分別有:super-user: 僅次於 root 的最高管理權限
read-only: 只能讀取設定內容不能修改
operator: 僅能清除 Counter 數值
unauthorized: 禁用該帳號
1 | #[edit] |
2 | #建立super-user帳號 admin |
3 | set system login user admin class super-user |
4 |
#設定帳號密碼 |
6 | set system login user admin authentication plain-text-password |
#指定 Default Gateway
setrouting-options static route 0.0.0.0/0 next-hop 192.168.1.254
#啟用一些服務-系統設定
#需要進入[edit system]模式
sethost-name switch
setservices telnet
setservicesssh
setservices web-management http
set time-zone Asia/Taipei
set ntp server 192.168.1.10
set name-server 192.168.1.10
#設定 root 管理帳號密碼 (設定之後才能存檔)
#設定 root 管理帳號密碼 (設定之後才能存檔)set root-authentication plain-text-password
##設定管理IP之一
#
(delete interfaces vlan unit 0 family inet dhcp 新機可能要下這一行才能設定)
set interfaces vlan unit 0 family inet address 192.168.224.222/24
#切vlan
#切vlan#[edit]
set vlans vlan224 vlan-id 224
#將interface定義到vlan裡
set interfaces ge-0/0/1 unit 0 family ethernet-switching vlan members vlan224
#設定管理IP之二
set interfaces vlan unit 224 family inet address 192.168.224.222/24
edit vlans vlan224
set l3-interface vlan.224
#大量assign vlan到interface
#大量assign vlan到interfaceset interfaces interface-range <interface-name> member-range ge-0/0/0 to ge-0/0/23
set interfaces interface-range <group-name> unit 0 family ethernet-switching vlan members <vlan-name>
訂閱:
意見 (Atom)