顯示具有 Network 標籤的文章。 顯示所有文章
顯示具有 Network 標籤的文章。 顯示所有文章

2016年5月16日 星期一

在Ubuntu建置UnetLab(Setup your UnetLab in Ubuntu)

在Ubuntu建置UnetLab(Setup your UnetLab in Ubuntu)


  • 事先準備

  1. 當然要有一台主機,記憶體越多越好,我則是把之前用ESXI的主機重新格式化(感覺浪費了,同樣價錢的話我可以買平價主機板跟更多的記憶體,哭)
  2. 熟讀http://www.unetlab.com/2015/08/installing-unetlab-on-a-physical-server/#comment-2232999898 這篇文章並step by step(包含了ubuntu14.04的版本,上網環境...等等)
  3. 再去下載自己要使用的檔案http://www.unetlab.com/documentation/supported-images/index.html 
      ubuntu就不多說了,根據網址內的教學一步一步做應該都可以安裝起來。


2015年8月18日 星期二

static route, aggregate route and generated route的分別

剛好對這幾個類型的route在routing table中有何分別,想要分清楚一下,從網路上找了一些資料來整理。

- A static route is the most obvious. You need to be able to reach a certain prefix and you specify the next-hop. This is useful when you are not running dynamic routing protocols and/or when you want to override what a dynamic protocol dictates (since the protocol-preference for a static-route is lower -preferred- than that of any dynamic RP).

Static route很簡單的就是指定一筆route往一個固定的next-hop,而後可加行為(discard or reject..等)

2015年3月22日 星期日

Build home lab with vmware exsi

有鑑於自己無任何設備可以練習juniper lab,先前分享的olive雖然可以練習大多的指令跟主題,但是關於Layer2 vpn或是multicast的部分就真的很難去用olive練習。同時自己的同事組了一個vmware練習security lab,也引起我的興趣,去找了一下國外大概有關於vmware esxi 組lab的文章。
有興趣的也可以去看一下以下文章。
http://www.junosworkbook.com/workbooks/jncia/deploying-firefly-perimeter-vsrx-on-vmware-esxi-5-x-server

簡單來說,網路設備商大多有釋出該廠商OS的ova版本,就是可安裝在vmware上並可正常像設備使用。 Juniper目前有firefly, cisco有CSR 1000v 當然還有其他的像是F5/Arista...等等。
 以Juniper來看firefly(vsrx)要練習應該都可以正常練習, 可查詢vsrx的release note就知道囉!

準備工作
1. VMware的相容性很麻煩,主機板上的網路卡一定要有支援,不然安裝完後卻沒有網路卡可以透過網路去連接,等於沒用。

從vmware的相容性網頁去找,大都是server才能夠安裝,嚇!!因為server想也知道不便宜。所以只能請google大神出馬,搜尋後,國外有些神人是自組一台server來練習,後來我就傾向往這部份去找囉。

後來我survey的零組件如下:
Motherborad:SUPERMICRO X10SLM+-F
CPU:Intel Xeon R. E3-1231 V3
HD:金士頓 V300 240G
Memory:金士頓 DDR3 1600 8GB ECC 伺服器 記憶體 8G KVR16E11/8
Power:海韻 G-450W/ 80+金牌.半模組化
Case:cooler master 352
通通大概32000上下。

2. 能夠有從外面連回家的方式(PPTP or L2TP等等)
自己要有一台AP可以用建立vpn,這樣就可以遠端連回家啦!無時無刻可測試lab。

3. 要去VMware申請一個帳號
這個看自己要不要去申請,因為去申請後會有個免費授權,但是用此授權去啟動,有些功能會無法使用,其最重要的serial port via network這個重要功能沒辦法正常使用。安裝exsi後會有個60天評估版本,可以搜尋youtube,會有如何reset這60天的步驟。所以目前我是用這個方式。

4. 其實硬碟的部分可有可不有,國外神人有些是用NAS來儲存vmware的組態檔案。


大概是這些,純紀錄分享一下。


2014年10月2日 星期四

Olive pratice lab-BGP multihop

bgp-multihop.jpeg 
 
基本設定
我習慣用group的方式建lab,之後要移除會比較快!
基本設定
set groups test-multihop logical-systems r1 interfaces em1 unit 12 vlan-id 12
set groups test-multihop logical-systems r1 interfaces em1 unit 12 family inet address 192.168.12.1/30
set groups test-multihop logical-systems r2 interfaces em2 unit 12 vlan-id 12
set groups test-multihop logical-systems r2 interfaces em2 unit 12 family inet address 192.168.12.2/30
set groups test-multihop logical-systems r2 interfaces em1 unit 23 vlan-id 23
set groups test-multihop logical-systems r2 interfaces em1 unit 23 family inet address 192.168.23.1/30
set groups test-multihop logical-systems r3 interfaces em2 unit 23 vlan-id 23
set groups test-multihop logical-systems r3 interfaces em2 unit 23 family inet address 192.168.23.2/30

確認用r2 ping r1 跟r2 ping r3,確認OK後於兩台r1/r3加入static route讓r1/r3能夠互ping
set groups test-multihop logical-systems r1 routing-options static route 192.168.23.0/24 next-hop 192.168.12.2
set groups test-multihop logical-systems r3 routing-options static route 192.168.12.0/24 next-hop 192.168.23.1
確認用r1 ping r3,確認OK後,加入bgp設定
1. as number
2. group name and type
3. bgp neighbor ip and local address ip
4. check bgp neighbor
set groups test-multihop logical-systems r1 protocols bgp group ebgp type external
set groups test-multihop logical-systems r1 protocols bgp group ebgp local-address 192.168.12.1
set groups test-multihop logical-systems r1 protocols bgp group ebgp peer-as 65001
set groups test-multihop logical-systems r1 protocols bgp group ebgp neighbor 192.168.23.2
set groups test-multihop logical-systems r1 routing-options autonomous-system 65000
set groups test-multihop logical-systems r3 protocols bgp group ebgp type external
set groups test-multihop logical-systems r3 protocols bgp group ebgp local-address 192.168.23.2
set groups test-multihop logical-systems r3 protocols bgp group ebgp peer-as 65000
set groups test-multihop logical-systems r3 protocols bgp group ebgp neighbor 192.168.12.1
set groups test-multihop logical-systems r3 routing-options autonomous-system 65001
此時show bgp summary會看到bgp neighbor狀態是idle
[edit groups test-multihop]
lab@RE0# run show bgp summary logical-system all   
logical-system: r2
BGP is not running
-----
logical-system: r3
Groups: 1 Peers: 1 Down peers: 1
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0                 0          0          0          0          0          0
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
192.168.12.1          65000          0          0       0       0          16 Idle
-----
logical-system: r1
Groups: 1 Peers: 1 Down peers: 1
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0                 0          0          0          0          0          0
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
192.168.23.2          65001          0          0       0       0          16 Idle
-----                                  

加入bgp multihop的設定
set groups test-multihop logical-systems r1 protocols bgp group ebgp multihop
set groups test-multihop logical-systems r3 protocols bgp group ebgp multihop
確認bgp neighbor狀態
lab@RE0# run show bgp summary logical-system all                    
logical-system: r2
BGP is not running
-----
logical-system: r3
Groups: 1 Peers: 1 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0                 0          0          0          0          0          0
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
192.168.12.1          65000         92         92       0       0       40:20 0/0/0/0              0/0/0/0
-----
logical-system: r1
Groups: 1 Peers: 1 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0                 0          0          0          0          0          0
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
192.168.23.2          65001         91         92       0       0       40:20 0/0/0/0              0/0/0/0
-----
                                  
logical-system: default
BGP is not running

結論是multihop通常是要增加TTL的數,因為ebgp的ttl是預設為1,所以如neighbor不是介面的IP的話,都必須要啟用multihop來增加彼此router的ttl數,來達到BGP TCP建立

ebgp要建立TCP的封包帶的ttl值為1,在enable multihop後,其值增加到64













2014年7月9日 星期三

2014年7月1日 星期二

Primary Vs Preferred

在Juniper 網路設備中,都會有在interface上設定IP位址後,可設定一個參數(primary or perferred)
根據官方的解釋:

Configuring the Primary Address for an Interface

The primary address on an interface is the address that is used by default as the local address for broadcast and multicast packets sourced locally and sent out the interface. For example, the local address in the packets sent by a ping interface so-0/0/0.0 255.255.255.255 command is the primary address on interface so-0/0/0.0. The primary address flag also can be useful for selecting the local address used for packets sent out unnumbered interfaces when multiple non-127 addresses are configured on the loopback interface, lo0. By default, the primary address on an interface is selected as the numerically lowest local address configured on the interface.

GNS3 with JUNOS Olive which install in Virtualbox

學習Juniper也一段時間了,Lab不在乎就是更簡單使用,目前Juniper不像Cisco有龐大的資源可以拿到,模擬器也一堆(GNS3&IOU..等)。
但是隨著Juniper越來越多人學習後,也一堆資源可以慢慢拿到,早期可以lab的方式大概就以下幾種。
  1. 實際的設備機器:


    這個方式花費之大,連目前已淘汰且最小的機種M7i(不加卡板)也都要五萬多台幣以上,且是二手品,如是新品的話,又要看保固之類的,不然買了就壞掉實在是得不償失,而且線材跟SPF之類的都要另外準備,這種比較適合團體一起弄lab,只是在台灣光找到小團體來兜lab就有點難了啊,又尤其是要準備J牌考試的!!!XD
  2. Olive:


    Olive就不多說了,網路搜尋一堆解釋,此資源在官方來看是不允許的,所以也自己去搜尋來使用,優點當然就是不用錢,缺點就是線路都是利用vlan來打通,所以要弄大型lab的話,會因為線路設定而顯得很複雜。
  3. GNS3 with Olive:


    熟悉Cisco的工程師,一定有用過GNS3,裡面就會有個選項-qemu,可把olive的檔案指定當成GNS3裏頭的一台Router。優點也是免錢囉,另外就是圖面式及可直接透過GNS3的功能去畫線,可省去一堆vlan打通的麻煩。缺點也是頗多,在GNS3開啟olive會耗費非常久的時間,端看你的主機強度啦,另外interface em2似乎是有bug,目前應該無解。
    [求助] GNS3模擬Junos基本連通性問題求助
  4. Olive in virtualbox in GNS3


    其中目前這個GNS3&virtualbox 所結合的方式是我覺得比較直覺化的一種。後續介紹安裝方式
    優點是不佔CPU loading,但吃記憶體,現在ram便宜到爆,應該可以多買幾支來撐著用,其圖像就如第三點那樣,缺點應該就是目前資源較少,因為要找到可在vituralbox開的olive較少。

2013年6月6日 星期四

[網站介紹]Hatch-可套用大量設定腳本的網站

   無聊再找一些資料,發現了這個網站Hatch ,hatch 有孵化的意思。
Hatch有大量的templates的檔案,大概瀏覽了一下,都是一些需要大量config的設定檔範本。

之前找了很多IPSEC的設定,在Hatch裏頭也有這個相關設定。真的還滿獨特的一個網站。
或許有網友也有這種大量設定的腳本可以分享在上頭,讓大家能夠有夠快的時間去設定囉。

2012年7月26日 星期四

一般主機增加route的方式

常用的指令
如果是用Win7,需要用最高管理者的身分去開dos畫面,這樣才有權限去修改route

route print  這個等同於cisco設備的show ip route,大概就是把route都列出來。
route add x.x.x.x mask x.x.x.x x.x.x.x 紅色的部份就是你要去的網段,藍色的部份就是你要丟的ip。等同於static route了!




2012年5月12日 星期六

JUNOS Software Routing Tables


列出JUNOS內有的Routing Tables:
inet.0
This table stores IPv4 unicast routes. Example is given at the beginning of this post. Here is an example that shows only static routes from table inet.0 (protocol static).
inet.1
Table inet.1 is used for IPv4 multicast routes. This table is also known as multicast forwarding cache and contains pair of (Source, Group).
inet.2
Table contains IPv4 unicast routes used by multicast for RPF (Reverse Path Forwarding) to prevent routing loops.
inet.3
Routing table inet.3 contains egress IP address of a MPLS label switched path (LSP).
inet.4
This routing table stores information learned using the Multicast Source Discovery Protocol (MSDP).
inet6.0
This table is used by IPv6 routes (see that change? It is inet6 now). After dot we have number 0, which means that it is used once again for unicast routes.
mpls.0
As name implies, routing table is used by MPLS. Better name is switching name.
bgp.l3vpn.0
This table is used, when having Layer 3 VPNs.
bgp.l2vpn.0
This table is used, when having Layer 2 VPNs.

2011年12月3日 星期六

Ping的時候出現U.U.U.U

在使用ping的指令時,通常不是出現!!!!!!!!就是………的符號,如果有出現.U.U.U.U的符號
代表確實有這筆route,但是沒有相對可以到達的終點。
通常會出現在static route上有指定一筆route(例如:192.168.1.0/24),所以192.168.1.0/24會丟到指令的另一端
結果另一端卻沒有192.168.1.0/24的des的話,就會出現.U.U.U的情況。

2011年10月31日 星期一

光纖線頭介紹區分

因目前工作常碰到,加上自己之前完全不熟悉這一塊的東西,剛好在查卡版之餘,順道記錄一下,好讓我記憶慢慢退化之時,可以有個回憶的記錄可看。(悲)
從硬體的部份開始說,光纖線材、接頭及模組。

光纖線分為兩種模式:

1.單模光纖(Single-mode fiber):
單模光纖只能允許一束光傳播,所以單模光纖沒有模分散(色散)特性,這樣代表傳輸的距離可以比較長,長距離通常都使用單模光纖。
單模通常都用黃色外皮。
2.多模光纖(Multi-mode fiber):
多模光纖允許多束光在光纖中同時傳播,從而形成模分散,也因此限制了頻寬與距離。多模通常都使用橙色外皮。
常用的線材規格
Name Medium Specified distance
1000BASE‑SX Multi-mode fiber 220 to 550 meters dependent on fiber diameter and bandwidth
1000BASE‑LX Single mode fiber(Multi-mode fiber) 5 km(550 meters)
1000BASE‑T Twisted-pair cabling (Cat‑5, Cat‑5e, Cat‑6, or Cat‑7) 100 meters
1000BASE‑TX Twisted-pair cabling (Cat‑6, Cat‑7) 100 meters

光纖接頭:

光纖接頭是光纖的末端裝置,用意是讓光纖的接續更快速方便,而不需要熔接。接頭的接續讓兩條不同的光纖的光可以通過。接頭有很多種,不同接頭的差別在接頭大小及接續方法的不同。
以目前來看,常用的有LC、SC、FC居多
LC (Lucent Connector / Local Connector) :很多人簡稱”小頭”
  File:LC-optical-fiber-connector-hdr-0a.jpg
SC(Subscriber Connector / Standard Connector) :看樣子就是很多人簡稱的”大頭”

File:SC-optical-fiber-connector-hdr-0a.jpg
FC(Ferrule Connector or Fiber Channel):常用在接ODF內。
File:FC-optical-fiber-connector-hdr-0a.jpg
光纖傳輸模組
是接在設備上的模組,也有人說是Transceiver,兩個都是一樣的,看人怎麼說。常看到的以目前來看有XFP、SFP、SFP+ 跟GBIC。
XFP-(10 Gigabit Small Form Factor Pluggable)是一種可熱插拔的,獨立於通信協議的光學收發器,通常工作波長是 850nm(Multi Mode Fiber), 1310nm 或1550nm(Single Mode Fiber),用於10G bps的SONET/SDH,光纖通道,gigabit Ethernet,10 gigabit Ethernet和其他應用中,也包括 DWDM 鏈路。通常是LC接頭。
File:Intel XFP.jpg
SFP-SFP收發器支持SONET、Gigabit Ethernet、光纖通道(Fiber Channel)以及一些其他通信標準。此標準擴展到了SFP+,能支持10.0 Gbit/s傳輸速率,包括8 gigabit光纖通道和10GbE。通常是LC接頭。另外就是SFP上的拉環,藍色就是Single mode的意思,橙色是multi mode,簡單的判別方式。
File:SFP-side.jpg
GBIC-Gigabit Interface Converter,是一種通常用在千兆以太網及光纖通道的信號轉換器。透過此轉換器的標準規範,千兆以太網路設備的埠可以直接對應各種實體傳輸介面,包括銅線(Copper)、多模光纖(Multi mode Fiber)與單模光纖(Single Mode Fiber)。通常是SC接頭,所以體積比較大。
File:GBIC.jpg

記錄這些,無非是光的東西實在是太多了,但是記住要跟人詢問光的設備時,一定要記住問以下三點:
1.光的線材:是SC還是LC?
2.模組:是用啥transceiver? SFP or XPE or GBIC?
3.Single mode or Multi mode?
通常搞清楚這三個應該就不會借錯設備或是接錯設備了啦!我覺得,但是要搞清楚全部設備還是去網路搜尋一下資料或比較完備。

Optical fiber connector

或是維基百科上找囉!

2011年9月6日 星期二

什麼是CSMA/CD

CSMA/CD (Carrier Sense Multiple Access with Collision Detection)
在Ethernet網路中,此CSMA/CD是用來防止區域內碰撞的一種機制, 而延伸到無線網路的話,就是利用CSMA/CA了。


CSMA/CD如何去防止碰撞?首先在區域內的網路中,如果有A、B和C三台電腦,當A需要傳送任何訊息的時候,會先發出一個通知給區域內的設備,也就是B和C,則這兩台就會等待A結束後在傳輸,以此類推。也就是要發出訊息的時候要排隊,其他人就要等到下一次才可以傳送了!