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

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的組態檔案。


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


2015年1月26日 星期一

Linux and Mac OS use serial port on virtualbox

由於使用多個系統加上又要用virtualbox來練習lab,因為virtualbox好像不會自己增加一個虛擬網卡,所以不像在windows系統可以互綁ip來透通,所以只好使用連接serial port的方式來連入。

Linux方式:
須先安裝screen

socat UNIX-CONNECT:/tmp/pipe_junos PTY,link=/tmp/pty & screen /tmp/pty

這樣就會有cosole畫面了


OSX的方式:
先安裝xcode
我使用iterm當terminal軟體
socat -d -d /tmp/pipe_Olive PTY
紅色部分為在virtualbox定義的名稱,這邊要打入你自己定義的才是。

lizhengyudeMBP:~ Chris$ socat -d -d /tmp/pipe_Olive PTY2015/01/27 10:33:26 socat[3332] N opening connection to LEN=17 AF=1 "/tmp/pipe_Olive"
2015/01/27 10:33:26 socat[3332] N successfully connected from local address LEN=16 AF=1 ""
2015/01/27 10:33:26 socat[3332] N successfully connected via
2015/01/27 10:33:26 socat[3332] N PTY is /dev/ttys001
2015/01/27 10:33:26 socat[3332] N starting data transfer loop with FDs [3,3] and [4,4]

然後再開另一個視窗,打入以下命令
screen /dev/ttys001
(黃底部分文字要一致)
就可以有console畫面了


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年8月6日 星期三

2014年7月19日 星期六

Olive pratice lab- BGP

  • Topology:
BGP_ospf_redistribute.jpeg
Looback:
R1:1.1.1.1
R2:2.2.2.2
R3:3.3.3.3
R4:4.4.4.4

Lab:
最終目的:每個Router都必須ping的到其他router的loopback
1. R2/R4建立OSPF,並可互ping彼此的loopback
2. R1/R2/R3彼此之間,利用界接interface建立ebgp,R2/R4用loopback建立ibgp
3.設定policy,R1/R2/R3放出loopback給彼此學習
4.設定policy,export ospf route 給ebgp
5.驗證每台router都可以互ping loopback IP

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較少。

2012年5月14日 星期一

JUNOS Route Policy

RIP、OSPF and BGP 的 default Route policy

Protocol
Import policy
Export policy
RIP
Accept all RIP route from explicitly configured neighbor and import into inet.0
Reject everything
OSPF
Accept all OSPF routes and import into inet.0
Reject everything (protocol flood by default)
BGP
Accept all BGP route and import inet.0 and inet6.0
Accept all active BGP routes

Route filter and prefix list
exact:完全精準
ex: 192.168.1.0/16 exact等於是192.168.1.0/16的route才採用。
longer:大於
ex: 192.168.1.0/16 longer等於是192.168.1.0/17~192.168.1.0/32之間的route才採用。
orlonger:大於等於
ex: 192.168.1.0/16 orlonger等於是192.168.1.0/16~192.168.1.0/32之間的route才採用。
upto:定一個範圍
ex: 192.168.1.0/16 upto /24等於說是192.168.1.0/16~192.168.1.0/24之間的route才採用。
prefix-length-range:訂定一個區間
ex: 192.168.1.0/16 prefix-length-range /20-/24等於說192.168.1.0/20~/24間的route才採用。
through:直接定義範圍。










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.