2010年7月23日

GNS3模擬Switch的方法

GNS3內建的Switch沒有Command Line 的功能

但可以使用Router搭配NM-16ESW模組來模擬Switch Vlan的功能
接著再設定Vlan即可
Router#vlan database
Router(vlan)#vlan 50
VLAN 50 added:
Name: VLAN0050
Router(vlan)#exit

Router#configure t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface vlan 50
Router(config-if)#ip address 192.168.0.100 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#^Z
Router#show interfaces vlan 50
Vlan50 is up, line protocol is down
Hardware is EtherSVI, address is cc00.0974.0000 (bia cc00.0974.0000)
Internet address is 192.168.0.100/24
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
ARP type: ARPA, ARP Timeout 04:00:00
Last input never, output never, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
2 packets output, 120 bytes, 0 underruns
0 output errors, 1 interface resets
0 output buffer failures, 0 output buffers swapped out


(繼續閱讀...)

2010年7月21日

各種廠牌Router與分享器的預設密碼

查詢各種廠牌Router與分享器的預設密碼的網站
http://www.routerpasswords.com

Router Make先選設備型號
Find Password查詢預設密碼


(繼續閱讀...)

2010年7月16日

EIGRP VS OSPF

EIGRP VS OSPF

EIGRP:
非開放式協定,由Cisco提出,只能用於Cisco的設備上
無級別遶送協定(與RIP V2和OSPF一樣)
支援VSLM、CIDR
會自動路徑總結,也可設定非連續網路
使用可靠的傳輸RTP(Reliable Transport Protocol)來通訊
透過擴散更新演算法(DUAL)來選擇最佳路徑

OSPF:
開放式協定,各家設備皆可支援
無級別遶送協定
支援VSLM、CIDR
不會自動總結路徑
路徑的散播是異動時使用多點廣播
中繼站數目無限制

EIGRP指令與說明部分:

EIGRP用頻寬(Bandwidth)、延遲(Delay)、負載(Load)、可靠性(比IGRP多了負載和可靠性),來決定最佳路徑的選擇,但預設上還是只有頻寬和延遲

Lab_A(config)#router eigrp 10
Lab_A(config-router)#maximum-path <1-6>
根據預設,EIGRP和IGRP最多提供四條不等成本的負載平衡,但用以上命令可以改變

Lab_A(config)#router eigrp 10
Lab_A(config)#metric maximum-hops <1-255>
預設上IGRP和EIGRP最大中繼站數目為100,但可用此命令調到最大255

Lab_A#conf t
Lab_A(config)#router eigrp 10
Lab_A(config-router)#network 172.16.0.0
Lab_A(config-router)#network 10.0.0.0
設定要跑EIGRP的網段

Lab_A(config)router eigrp 10
Lab_A(config-router)passive-interface serial 0/0
這個設定雖然跟RIP很像,但功能不一樣,RIP設定後不發出路徑更新,但可接收
但是EIGRP是不發出路徑更新,也不能接收,等於就是該介面關閉了EIGRP的意思

Lab_A#conf t
Lab_A(config)#router eigrp 10
Lab_A(config-router)#network 172.16.0.0
Lab_A(config-router)#network 10.0.0.0
Lab_A(config-router)#no auto-summary
no auto-summary為設定非連續網路的指令,為使EIGRP不會自動總結路徑的指令

確認EIGRP設定:
show ip route 顯示整個路徑表
show ip route eigrp 只顯示路徑表的EIGRP項目
show ip route neighbors 顯示EIGRP的鄰居
show ip eigrp topology 顯示EIGRP拓樸表的內容
show ip protocols 顯示目前路由協定的基本設定
debug eigrp packet 顯示緊鄰路由器之間相互收送的Hello封包
debug eigrp notification 顯示網路上發生的EIGRP異動與更新


OSPF指令與說明部分:

LSA(Link State Advertisement):OSPF的資料封包,用來更新拓樸資料庫,OSPF路由器只跟那些與它建立"緊鄰關係"的路由器交換LSA封包

DR(designated router):委任路由器,OSPF路由器連到相同的多方存取網路時就會選出一部DR,做為廣播網路,

Lab_A#conf t
Lab_A(config)#router ospf <1-65535>
Lab_A(config-router)#network 10.0.0.0 0.255.255.255 area <0-42億>
以上為啟動OSPF通訊的介面,OSPF為無級別協定,所以可給予遮罩,所以以上用法為通配遮罩(wildcard mask),而<1-65535>為OSPF的 Porcess ID,這個部分設定只在本機有效,所以比較無關緊要,而<0-42億>為OSPF區域,這比較重要,而通常OSPF區域一定要包含"0"

確認OSPF設定:
show ip route 檢視該router上所有路徑表
show ip ospf 顯示路由器上正常運行的一個或多個OSPF程序的相關資訊
show ip ospf database 顯示鏈路的數目、鄰居的路由器ID,拓樸資料庫
show ip ospf interface 顯示所有與界面相關的OSPF資訊,包含界面ip位址、指定的OSPF區域、程序ID、路由器ID、成本、DB/BDR等等
show ip ospf neighbor 顯示總結了有關鄰居的緊鄰狀態OSPF狀態,如有DR、BDR也會顯示出來
show ip protocols 無論執行OSPF、EIGRP、IGRP、RIP等…都可用此命令來顯示所有協定運作的概觀
debug ip ospf packet 顯示路由器上傳送與接收到的Hello封包
debug ip ospf helo 更完整的顯示路由器上傳送與接收到的Hello封包,有更詳細的輸出資料
debug ip ospf adj 在廣播和非廣播的多方存取網路中顯示DR和BDR選舉

設定OSPF回繞界面(lookback interface):確保路由器上的router ID能正常運作,否則預設上為最高IP位址為該路由器的RID

Lab_A#conf t
Lab_A(config)#int lookback 0
Lab_A(config-if)#ip address 172.16.10.1 255.255.255.255
Lab_A(config-if)#no shutdown
Lab_A(config-if)#end

設定EIGRP與OSPF的總結路徑:

EIGRP:
Lab_A#conf t
Lab_A(config)#router eigrp 10
Lab_A(config)#network 192.168.10.0
Lab_A(config)#network 10.0.0.0
Lab_A(config)#no auto-summary
Lab_A(config)#interface etherent 0
Lab_A(config-if)#ip summary-address eigrp 10 192.168.10.64 255.255.255.224

OSPF:
Lab_A#config t
Lab_A(config)#router ospf 1
Lab_A(config-rouer)#network 192.168.10.64 0.0.0.3 area 1
Lab_A(config-router)#network 192.168.10.68 0.0.0.3 area 1
Lab_A(config-router)#network 10.10.10.0 0.0.0.255 area 0
Lab_A(config-router)#area 1 range 192.168.10.64 255.255.255.224
(繼續閱讀...)

2010年7月12日

Cisco 設定default route


若要使用default route,則ip classless功能需先啟用
(一般IOS在12.4版以上,預設ip classless功能已是預先啟用打開了,不需再特別設定)
Gateway(config)#ip classless

在Cisco路由器中設定default route有三種方法:
Gateway(config)#ip route 0.0.0.0 0.0.0.0 217.124.6.1
Gateway(config)#ip route 0.0.0.0 0.0.0.0 serial 0/0
Gateway(config)#ip default-network 217.124.6.0


其中,離開介面的設定方法,可蓋過其它兩種設定方法
(因為他的AD值是0為優先權最高
default route建議只在stub network上設定
stub network(殘根型網路):是只有一條離開路徑的網路
(繼續閱讀...)

2010年7月6日

Linux設定GNS3和VirtualBox網卡相連

設定讓VirtualBox虛擬機器裡的網卡和GNS3中的Router相連

Step 1:
在VirtualBox中要先將網卡類型設定為「僅限主機介面卡」, 並將IP設定上去
如圖中設定為192.168.0.160

Step 2:
接著將Router的FE介面的IP設定上去
Interface IP-Address OK? Method Status Prot
FastEthernet2/0 192.168.0.100 YES manual up up

Step 3:
再點選GNS3中的PC網卡NIO設定,將網卡設為nio_linux_eth:vboxnet0

Step 4:
最後Router與虛擬機器對PING有通,即成功

甚至可以在虛擬機器中安裝Cisco SDM來管理Router

(繼續閱讀...)

2010年7月4日

Install Virtualbox on Ubuntu 9.04 64-bit

加入virtualbox套件資料庫
vi /etc/apt/sources.list
加入下面這一行後存檔
deb http://download.virtualbox.org/virtualbox/debian jaunty non-free
加入金鑰
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
更新apt資料庫來源
sudo apt-get update
安裝virtualbox
sudo apt-get install virtualbox-3.2
安裝dkms package
sudo apt-get install dkms
再重開電腦後,即可在系統工具中看到Oracle VM VirtualBox

(繼續閱讀...)

2010年7月3日

重設Cisco Router與Switch的密碼

適用於Cisco Router 1700/2600/3600 系列
1、重新打開Router的電源,並按Crtl+Break,進入ROM監視模式
2、更改組態暫存器
rommon 1 > confreg 0x2142
其中0x2142代表跳過啟動組態檔(startup-config)
一般正常的設定為0x2102
3、重新開機
rommon 2 > reset
4、進入自動裝配模式後,選no
Would you like to enter the initial configuration dialog?[yes/no] no
5、進入enable特權模式
Router > enable
Router#
6、切換到設定配置模式
Router# config t
7、修改密碼
Router(config)# enable secret XXX(密碼)
8、還原組態暫存器值
Router(config) # config-register 0x2102
9、離開配置模式
Router(config) # exit
10、儲存設定檔
Router # copy running-config startup-config
(將RAM中的設定,儲存到NVRAM中的啟動組態檔,這樣之後才能用新密碼登入)
11、重新啟動
Router # reload

Cisco Switch 2900系列
1、重新啟動Switch的電源,接著再長按mode button的鍵
2、switch : flash_init
3、在flash的目錄下顯示所有檔案
switch : dir flash :
4、更改config.text的名稱
switch : rename flash:config.text flash:config.pre
5、重新啟動
switch : boot
6、進入自動裝配模式後,選no
Continue with configuration dialog?[yes/no] no
7、進到enalbe特權模式
Switch > en
Switch #
8、再把config.old的檔名改回來
Switch # rename flash:config.pre flash:config.text
9、切到設定配置模式
Switch # config t
Switch(config) #
10、更改新密碼
Switch(config)# enable secret XXX(密碼)
11、回到特權模式
Switch(config)# end
12、儲存新的設定參數後,再重啟Switch即可
Switch # write memory(或是 copy running-config startup-config)
(繼續閱讀...)

Linux上使用VPCS搭配GNS3

VPCS:利用最少資源,虛擬一個有ping和tracert功能的虛擬PC
目前也有Linux版本的VPCS且也支援64bit版本
官方網站:http://wiki.freecode.com.cn/doku.php?id=wiki:vpcs

使用方式
Step 1:
先到官方網站去download程式
解壓後裡面會有vpcs、vpcs.exe、vpcs.osx、vpcs_64、startup.vpc(預先IP設定檔)
其中vpcs.exe、vpcs.osx是給windows和mac用的
vpcs、vpcs_64是linux的版本
先將vpcs_64改為可執行檔
happylucky@ubuntu:~/vpcs$ chmod +x vpcs_64

Step 2:
再來使用vi修改一下startup.vpc這個檔案
依照LAB的需求改為要使用的IP,如下
ex:將第九台電腦IP設定為192.168.13.10 GW:192.168.13.1 MASK:255.255.255.0
則之後執行VPCS,第九台電腦的IP就會為你設定的預設值
###########################################
# pc 9: static IP
9
ip 192.168.13.10 192.168.13.1 24
############################################


當然你也可以在執行程式後
happylucky@ubuntu:~/vpcs$ ./vpcs_64
再用vpcs指令修改也可以
VPCS 9>? (可查看vpcs指令用法)
修改IP
VPCS 9 >ip 192.168.13.10 192.168.13.1 24
PC9 : 192.168.13.10 255.255.255.0 gateway 192.168.13.1
查看各台VPCS電腦的設定:
VPCS 9 >show


Step 3:
執行GNS3 -> edit -> symbol manager
將VPCS物件加到元件中:
將左邊的Computer物件移到右邊的Customized nodes,重新命名後,並將類型改為Cloud

Step 4:
回到GNS3的拓撲圖畫面
將PC拉到拓撲圖中,再PC元件上點兩下
設定NIO UDP頁籤中的Local PORT、Remote host、Remote PORT
以VPC9為例,port的對應可參考,VPCS 9 >show (VPCS中Lport和Rport和GNS3中的設定是反向的)

GNS3中的設定如下
Local PORT:30008
Remote host:127.0.0.1
Remote PORT:20008

設定好後,再將VPCS和Router相連

Step 5:
設定Router
R0#configure t
Enter configuration commands, one per line. End with CNTL/Z.
R0(config)#interface fastEthernet 2/0
R0(config-if)#ip address 192.168.13.1 255.255.255.0
R0(config-if)#no shutdown
FastEthernet2/0, changed state to up
R0(config-if)#^Z

設定VPC9
VPCS 9 >ip 192.168.13.10 192.168.13.1 24
PC9 : 192.168.13.10 255.255.255.0 gateway 192.168.13.1


最後,Router和VPC9兩個對PING,有通即成功連結

(繼續閱讀...)

在ubuntu中使用terminal tab 管理分頁

在GNS3中,一顆Router就是一個terminal視窗
為了方便管理,建議將terminal集合成tab分頁來管理

在windows中很多人使用SecureCRT 這個軟體
在ubuntu中,可以使用內建的gnome-terminal分頁功能來集合terminal視窗

使用上有點小技巧如下
先在GNS3中叫出所有的Router的terminal視窗


再點選檔案-->開啟分頁



將你要的視窗使用拖曳的方式拉到同一個集合視窗中
再關掉不要的視窗即可


(繼續閱讀...)

Copyright © 2009 New Life in Taipei All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive.