2012年12月27日 星期四

OSPF LSA Type and Special Area

LSA Type 1 (Router LSA): Area內每個Router用來宣告自己的LSA,無法跨Area

LSA Type 2 (Network LSA): Area內每個Router用來宣告自己network的LSA,無法跨Area

LSA Type 3 (Summary Network LSA): ABR用來宣告不同Area所擁有的network的LSA,這個
                LSA通常是跨Area

LSA Type 4 (Summary ASBR LSA): 鄰近ASBR的router用來宣告ASBR位置的LSA

LSA Type 5 (External LSA): 用來傳遞從ASBR學到的network的LSA

LSA Type 7 (NSSA LSA): NSSA中表示從ASBR中學到的network的LSA


stub area會過濾Type 4 和Type 5,繼續過濾Type 3的area叫做totally stub area。
totally stub area如果允許ASBR(這個ASBR應該改稱NSSA ASBR)學到的路由進來,這個area叫做Not-So-Stub Area(NSSA),而這個LSA定義為Type 7 LSA,Type 7 LSA再由ABR(嚴格的說,應該稱NSSA ABR)轉換成Type 5 LSA傳到其他Area。





回到上述的totally stub area,看來這個area內的router都不收其他area來了路由,那這些router的流量怎麼出去?唯一的方式就是靠ABR注入一筆default router。

2012年12月26日 星期三

OSPF vs RIPv2 Redistribution心得


我們的目的是希望所有Router都收到除了其他Router Fa interface上的Routing,但Router0和Router1所有的網段是在同一個major net(172.16.0.0/16),所以每個Router收到的routing必須是
subnet過後的。


Router0:

configuration:


interface FastEthernet0/0
 ip address 172.16.1.254 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 172.16.2.254 255.255.255.0
 duplex auto
 speed auto
!
interface Serial0/1/0
 ip address 10.1.1.1 255.255.255.252
 clock rate 19200
!
interface Serial0/1/1
 no ip address
 clock rate 2000000
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
router rip
 version 2
 network 10.0.0.0
 network 172.16.0.0
 no auto-summary
!
ip classless


RIP需要設定v2,否則其他Router收到的會是summary過後的routing(Classful only)

=======================================================================

Router1:

configuration:


interface FastEthernet0/0
 ip address 192.168.1.254 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.2.254 255.255.255.0
 duplex auto
 speed auto
!
interface Ethernet0/0/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/1/0
 ip address 10.1.1.2 255.255.255.252
!
interface Serial0/1/1
 ip address 10.2.2.1 255.255.255.252
!
interface Vlan1
 no ip address
 shutdown
!
router ospf 1
 log-adjacency-changes
 redistribute rip subnets
 network 10.2.2.0 0.0.0.3 area 0
 network 192.168.2.0 0.0.0.255 area 0
!
router rip
 version 2
 redistribute ospf 1 metric 2
 network 10.0.0.0
 network 192.168.1.0
 no auto-summary
!
ip classless
!

1.Router0無法收到Router2的subnet routing,必須在RIP的redistribution設定中設定metric值,
   這個值範圍可為0~16,但必須設定1~15(我設定2),否則無法學習完整的路由(設定15,無 
   法學到192.168.2.0/24)。

2.RIPv2需要設定no auto-summary,否則Router0收到的不是172.16.3.0/24、172.16.4.0/24,而
  是summary過後的172.16.0.0/16。

  no auto-summary指的是設定的那一台Router送出去的的是沒有summary過後的Routing。

  所以如果Router1不下這個指令,  Router0收到的不是172.16.3.0/24、172.16.4.0/24,而
  是summary過後的172.16.0.0/16。

  同樣的,如果Router0不下這個指令,  Router1收到的不是172.16.1.0/24、172.16.2.0/24,而
  是summary過後的172.16.0.0/16。

3.RIPv2 redistribute到OSPF需要設定subnet,否則Router2收到的不是172.16.1.0/24、 
   172.16.2.0/24,而  是summary過後的172.16.0.0/16。

=======================================================================
Router2:

configuration:


interface FastEthernet0/0
 ip address 172.16.3.254 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 172.16.4.254 255.255.255.0
 duplex auto
 speed auto
!
interface Serial0/1/0
 no ip address
 clock rate 2000000
!
interface Serial0/1/1
 ip address 10.2.2.2 255.255.255.252
 clock rate 19200
!
interface Vlan1
 no ip address
 shutdown
!
router ospf 1
 log-adjacency-changes
 network 10.2.2.0 0.0.0.3 area 0
 network 172.16.3.0 0.0.0.255 area 0
 network 172.16.4.0 0.0.0.255 area 0
!
ip classless

=======================================================================


Router0:

show ip route :



     10.0.0.0/30 is subnetted, 2 subnets
C       10.1.1.0 is directly connected, Serial0/1/0
R       10.2.2.0 [120/1] via 10.1.1.2, 00:00:06, Serial0/1/0
     172.16.0.0/24 is subnetted, 4 subnets
C       172.16.1.0 is directly connected, FastEthernet0/0
C       172.16.2.0 is directly connected, FastEthernet0/1
R       172.16.3.0 [120/2] via 10.1.1.2, 00:00:06, Serial0/1/0
R       172.16.4.0 [120/2] via 10.1.1.2, 00:00:06, Serial0/1/0
R    192.168.1.0/24 [120/1] via 10.1.1.2, 00:00:06, Serial0/1/0
R    192.168.2.0/24 [120/2] via 10.1.1.2, 00:00:06, Serial0/1/0




=======================================================================

Router1:

show ip route :

Router#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/30 is subnetted, 2 subnets
C       10.1.1.0 is directly connected, Serial0/1/0
C       10.2.2.0 is directly connected, Serial0/1/1
     172.16.0.0/24 is subnetted, 4 subnets
R       172.16.1.0 [120/1] via 10.1.1.1, 00:00:13, Serial0/1/0
R       172.16.2.0 [120/1] via 10.1.1.1, 00:00:13, Serial0/1/0
O       172.16.3.0 [110/65] via 10.2.2.2, 00:16:44, Serial0/1/1
O       172.16.4.0 [110/65] via 10.2.2.2, 00:16:44, Serial0/1/1
C    192.168.1.0/24 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/1

=======================================================================

Router2:

show ip route :


Router#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/30 is subnetted, 2 subnets
O E2    10.1.1.0 [110/20] via 10.2.2.1, 00:22:10, Serial0/1/1
C       10.2.2.0 is directly connected, Serial0/1/1
     172.16.0.0/24 is subnetted, 4 subnets
O E2    172.16.1.0 [110/20] via 10.2.2.1, 00:22:10, Serial0/1/1
O E2    172.16.2.0 [110/20] via 10.2.2.1, 00:22:10, Serial0/1/1
C       172.16.3.0 is directly connected, FastEthernet0/0
C       172.16.4.0 is directly connected, FastEthernet0/1
O E2 192.168.1.0/24 [110/20] via 10.2.2.1, 00:22:10, Serial0/1/1
O    192.168.2.0/24 [110/65] via 10.2.2.1, 00:22:10, Serial0/1/1

從任何其他Routing protocol redistribute到OSPF的default metric為20
而各Routing protocol的redistribution default metric如下:
SourceInto
RIPEIGRPOSPFISISBGP (MED)
Connected1Int metric20 (E2)00
Static1Int metric20 (E2)00
RIPInfinite20 (E2)0IGP metric
EIGRPInfinite20 (E2)0IGP metric
OSPFInfiniteInfinite0IGP metric
ISISInfiniteInfinite20 (E2)IGP metric
BGPInfiniteInfinite1 (E2)0




2012年12月23日 星期日

Spanning Tree的過程!



Spanning Tree的過程包含以下重要步驟:

1.選擇Root Bridge:
   Root Bridge的選擇是以各Bridge(Switch)的ID大小來做選擇,ID值越小,優先權越高。
   這個ID值包含Priority + VLAN ID,Priority預設值為32768,要調整這個值需要以4096為單
   位做增減。
 一般來說這一個ID值都會是一樣的,所以一開始,每一台Switch會以各自的
   System MAC address來做比較,這一個MAC address也可以從show version中的Base ethernet  MAC Address的知,MAC address的大小最好以二進位來做比較,值越小優先權越高。
 如上圖,由於每一台的ID值都是32768+1=32769 (1為VLAN ID),所以比較每一台Switch
   System MAC address結果:00E0>0030>000D>0004,優先權0004>000D>0030>00E0,
 也就是Switch1>Switch0>Switch2>Switch4,所以Switch1為Root Bridge。
 
 總的來說,這一個比較值的組合為4個bit的單位值(A)+12個bit的4096(B)+MAC address(C)
    ,預設值A=8,B永遠都是4096,C則因機器而異。



2.選擇Root Port(簡稱RP):
 Root Port為每一個Switch通往Root Bridge的最短路徑的那一個Port,每一個Switch必須選  
   出唯一一個Root Port,最端路徑的計算方式為每一個通往Root Bridge的Cost加總,每一種
 網路介面的速度有其預設上被定義好的cost,10G cost=1,1G cost=10,100M cost=19, 
 10M cost=100。在抉擇的過程中會遇到以下情況:
 a.同一個Switch通往Root Bridge的cost相同,這時候以相鄰的Bridge中ID值最小的為優先,
  如上圖,Switch4有四個Port(Fa0/5、Fa0/6、Fa0/7、Fa0/8)通往Root Bridge Switch1的cost
  都相同,因Fa0/7、Fa0/8通往Root Bridge的路徑中相鄰的Switch1其Bridge ID比Fa0/5、
       Fa0/6通往Root Bridge路徑中相鄰的Switch2其Bridge ID較低,所以會從Fa0/7、Fa0/8兩者
  選擇其中一個Port當作Root Port。

 b.同一台Switch通往Root Bridge的Root Port有兩個以上可以選擇,則選擇Port ID較低的
      當作Root Port,如a.的結果,因為Fa0/7的Port ID較Fa0/7的Port ID低,所以選擇Fa0/7
      作Root Port。依此類推,整體架構中的Root Port還有Switch0的Fa0/1、Switch2的Fa0/3
  而與其做比較的Port就是non-Designated Port,也就是blocked Port。所以Switch3的
      Fa0/8、Switch0的Fa0/2、Switch2的Fa0/4都是blocked port。

3.選擇Designated Port(簡稱DP):
    Designated Port是除了Root Port以外通往Root Bridge的最短路徑的Port,其選擇方式與
 Root Port相同,Root Bridge本身所有的Port都是Designated Port,而與Root Port相鄰的Port
    也一定是Designated Port。
  如果同一個Segment中無法依照上述原則決定DP時,則以Bridge ID較小的Switch上的Port
 為DP,而相對應的就是non-DP。如本架構,Switch2的F0/5、Fa0/6與Switch3的Fa0/5、
 Fa0/6做比較,因Switch2的Bridge ID較小,所以選擇Switch2的Fa0/5、Fa0/6當作DP(同一台
 Switch可以有好幾個DP,所以不需要做Port ID比較)。所以Switch3的Fa0/5、Fa0/6會是
    non-DP


其他:
如上圖,如果要更改Switch0的blocked port為Fa0/1,則需要更改對口的Port Priority,即
Switch1的Fa0/1的Port Priority大於預設值128。


  綜合來說,STP的運算過程需要依賴所有參與的交換器所提供的資訊來做運算的依據,
  這些資訊包含Bridge ID、通往Root Bridge的cost、Port Priority等。如果所有參與的交換器
  所提供的資訊不足以作判斷時,就自己做判斷,比如說以Port ID來做判斷。

 

2012年10月30日 星期二

RedHat 6.3上的yum

這幾天幫客戶裝了RedHat 6.3 Enterprise版本,安裝完成後客戶又要求安裝其他套件,
下載了rpm檔之後,安裝上出了問題,於是下載source檔(.tar.gz),又是因為相依性的問題無法安裝,於是只好改用yum,但問題來了,yum需要向原廠註冊一個帳號才能用,還好客戶是買正式版,也已經註冊了,所以採取以下幾個步驟做註冊:

rm -rf /etc/sysconfig/rhn_systemid
rm -rf /var/cache/yum/*
yum clean all
subscription-manager register     ==>這個步驟會要求輸入註冊的帳號與密碼
subscription-manager subscribe --auto   ==>這個步驟之後會再做一次確認的動作

最後就是做yum update和yum install xxx


大功告成~~~

2012年8月31日 星期五

Cisco Nexus 7000 support I/O modules (so far on Aug 2012)




 截至2012/8/31為止,Cisco Nexus 7000支援以下I/o module"
F1-Series 32-port 1- and 10-Gigabit Ethernet I/O modules (N7K-F132XP-15)

F2-Series 48-port 1-/10-Gigabit Ethernet I/O modules with XL (N7K-F248XP-25)


M1-Series 48-port 10/100/1000 I/O modules (N7K-M148GT-11)

M1-Series 48-port 10/100/1000 I/O modules with XL option (N7K-M148GT-11L)

M1-Series 48-port 1-Gigabit Ethernet I/O modules (N7K-M148GS-11)

M1-Series 48-port 1-Gigabit Ethernet I/O modules with XL option (N7K-M148GS-11L)

M1-Series 32-port 10-Gigabit Ethernet I/O modules (N7K-M132XP-12)

M1-Series 32-port 10-Gigabit Ethernet I/O modules with XL option (N7K-M132XP-12L)

M1-Series 8-port 10-Gigabit Ethernet I/O modules with XL option(N7K-M108X2-12L)


M2-Series 24-port 10-Gigabit Ethernet I/O modules with XL option (N7K-M224XP-23L)

M2-Series 6-port 40-Gigabit Ethernet I/O modules with XL option (N7K-M206XP-23L)

M2-Series 2-port 100-Gigabit Ethernet I/O modules with XL option (N7K-M202XP-23L)


而針對這些module,在設定VDC時需要注意port group,有些模組同一個port group必需配置到同一個VDC中。Port group的分配狀況如下:
•       N7K-M202CF-22L (1 interface x 2 port groups = 2 interfaces 100G modules)—There are no restrictions on the interface allocation between VDCs. 


N7K-M206FQ-23L (1 interface x 6 port groups = 6 interfaces 40G modules)—There are no restrictions on the interface allocation between VDCs. 


N7K-M224XP-23L (1 interface x 24 port groups = 24 interfaces 10G modules)—There are no restrictions on the interface allocation between VDCs. 


N7K-M108X2-12L (1 interface x 8 port groups = 8 interfaces)—There are no restrictions on the interface allocation between VDCs. 


N7K-M148GS-11L, N7K-M148GT-11, and N7K-M148GS-11 (12 interfaces x 4 port groups = 48 interfaces)—There are no restrictions on the interface allocation between VDCs, but we recommend that interfaces that belong to the same port group be in a single VDC. 


N7K-M132XP-12 (4 interfaces x 8 port groups = 32 interfaces)—Interfaces belonging to the same port group must belong to the same VDC.


N7K-M148GT-11L (same as non-L M148) (1 interface x 48 port groups = 48 interfaces)—There are no restrictions on the interface allocation between VDCs. 


N7K-M132XP-12L (same as non-L M132) (1 interface x 8 port groups = 8 interfaces)—All M132 cards require allocation in groups of 4 ports and you can configure 8 port groups.











M系列和F系列的module都可以安裝XL

And the Fabric supporting matrix is as follows:
Cisco Nexus 7009 chassis uses the Fabric 2 (N7K-C7009-FAB-2) modules.


Cisco Nexus 7010 chassis uses the Fabric 1 (N7K-C7010-FAB-1) or Fabric 2 (N7K-C7010-FAB-2) modules.


Cisco Nexus 7018 chassis uses the Fabric 1 (N7K-C7018-FAB-1) or Fabric 2 (N7K-C7018-FAB-2) modules.
      You can replace a Fabric 1 module with a Fabric 2 module in the Cisco Nexus 7010 and 7018 switches during operations, but while there is a mix of fabric module types, all of the fabric modules perform as Fabric 1 modules.
      Nexus7010及7018可以開機狀況下將FAB2換成FAB1,但必須是全換,如果是混插的狀況下,只有FAB1會發揮作用

       If you power up a switch with two types of fabric modules installed, only the Fabric 1 modules will power up. To utilize the Fabric 2 module capabilities, all of the installed fabric modules must be Fabric 2 modules.
      在FAB1及FAB2混插的情況下,只有FAB1會啟動,只有在全部都是FAB2時,FAB2才會全部啟動






2012年8月28日 星期二

Switch上的基本防護功能-Port Security

Cisco Switch上的Port Security功能不是甚麼稀奇的功能,但很少人知道他的用法與細項設定,在此就來談談他的運用。
首先來談談他的運用,包含:

1.防止非單位的終端設備在未授權的情況下任意接入單位網路中。

2.防止單位授權的終端設備但卻接入非該終端設備被授權可以接入的區域(交換器)中

3.非授權的電腦任意建立Virtual Machine (一台VM就會有一組mac address)

一般在設定port security的方式會有以下幾種方式:

方式一:
(config)#interface gigabitethernet 9/10
(config-if)#switchport port-security
(config-if)#switchport port-security maximum 1
(config-if)#switchport port-security 0bdc.1f69.f598
(config-if)#switchport violation shutdown

方式二:

(config)#interface gigabitethernet 9/10
(config-if)#switchport port-security
(config-if)#switchport port-security maximum 1
(config-if)#switchport port-security sticky
(config-if)#switchport violation shutdown

其中,
   >  switchport port-security這個指令就是啟用介面上的port security功能

   >  switchport port-security maximum 1這個指令在指定這一個interface上最多可以有幾個
       mac-address上來,如果大於這一個值就是violation了。

   >  而接下來就是定義mac-address,有以下幾種:

 
         >> Static :  顧名思義就是直接手動設定特定的mac-address,但是設定完之後不會出現
                          在running-config中。如果要讓static mac-address出現在running-config中,需
                          要使用switchport port-security mac-address sticky xxxx.xxxx.xxxx

         >> Dynamic : 這是系統預設使用的方式。只要設備還沒有達到maximum上限
                              而且網路介面尚未學習到該mac-address,該mac-address就會被學習進
                              來,但學習到的mac-address是會被age掉的。

         >> Sticky :  使用這種方式的行為跟dynamic一樣,但不同的是,這種方式會將學習到的
                           mac-address寫入NVRAM中,這樣一來,就算設備重開機,mac-address還
                           是一樣存在,不須重新學習。
                           而sticky學習到的mac-address是不會被age掉。

                           Sticky跟dynamic這兩種功能是互不相容的,如果啟用sticky,dynamic就會
                           被自動關閉,sticky關掉後,dynamic還是會繼續運作。

                           而透過switchport port-security mac-address sticky指令可以將dynamic learning
                            mac-address轉成sticky learning mac-address存到running-config中

                           sticky mac-address雖然可以存在NVRAM中,但是可以手動清除:
                           #clear port-security sticky [interface fax/y]

   > Aging time : Aging time的參數包含:

                        Static: 對於static mac-address啟用aging time
 
                        Time: 設定aging timeout時間

                        Type: 設定aging time類型,有absolute及inactive兩種。absolute是絕對時間,
                                  只要mac-address經過這一段時間就會從mac-address table中消失掉;
                                  inactive是相對時間,只要該mac-address經過這一段時間沒有任何
                                  traffic,就會從mac-address table中清除掉。

   > Violation : 有幾種處理方式==>

                      Protect: 會將secured mac-address以外的mac-address丟棄掉,除此之外幾乎不做
                                   任何動作

                      Restrict: 除了不把interface shutdown之外,會發出snmp trap、violation counting
                                   其他做的事情跟Protect一樣。

                      Shutdown: interface會呈現err-disabled狀態。可以使用以下方式在經過某一段時
                                       間後恢復==>

                                        Cat4507 (config)#errdisable recovery cause psecure-violation
                                        Cat4507 (config)#errdisable recovery interval 30








2012年8月23日 星期四

How to automatically backup Cisco IOS devices configuration file to a TFTP Server...

We can easily backup our Cisco IOS devices configuration files to a TFTP server whenever we issue the "write memory" command. Now how the make it? Follow the steps below:

#
#config term
(config)#archive
(config-archive)#path tftp://172.16.7.100/switch1-
(config-archive)#write-memory
(config)#exit
#write memory

then you will see the configuration file with file name such as "switch1-Aug-23-15-23-17-0",that is
the prefix you defined previously plus the date and time.

Of course, you can also check the startup-config and find that the configuration is also written into the NVRAM.

2012年8月19日 星期日

PaloAlto SSL VPN設定方式


啟用 SSL VPN client
Device > SSL VPN Client > Activate

建立憑證
Device > Certificates > Generate

選擇 SSL VPN 的 user 來源
Device > Authentication (Local DB, RADIUS, LDAP, Kerberos)

SSL VPN  網路環境設定
Network > Interface
Network > Zones
SSL VPN 連線是必須由 untrust(來源) 到 trust(目地),所以需設定兩個 ethernet,以及切兩個 zone。

設定路由
Network > Virtual Routers
勾選為 SSL VPN 設定的 ethernet,以及一個 tunnel。
設定一條路由往 untrust Destination (e.g: IP 0.0.0.0),Interface 選擇 untrust 的 ethernet,以及設定該 ethernet 的 Router server IP
另一條設定往 SSL VPN 要前往的網段,Interface 選擇 trust 的 ethernet。

最後設定 SSL VPN
Network > SSL VPN > Add
其中 Server Certificate 選擇我們之前建立的憑證, Authentication Profile 選擇我們之前所建立的 Authentication。
Tunnel Interface 選擇 tunnel,MAX User 也要設定,依該 server model 可選擇最高的 User 數。
Gateway Address 請選擇 untrust 來源的 Interface,以及該 ethernet 的 IP。
Client Configuration 請設定當 SSL VPN 連線成功後,該 SSL VPN client 解析 DNS 的 Primary DNS Server IP, IP pool 則是 SSL VPN client 取得 IP 的網段,
Access Router 則是設定 SSL VPN user 可出去的網段 router server IP。

驗證 SSL VPN
https://IP (untrust ethernet IP)

以上文章參考至網路上不明來源之文章




Palo Alto – SSL VPN Configuration

Published on March 18, 2011 by Owen in Palo Alto Networks
A brief guide on creating a SSL portal and obtaining/deploying the SSL VPN client.
Download and Enable the SSL Client
Users will need to have the SSL VPN client installed before they’ll be able to access the SSL portal. This client is downloaded on 1st logon, but for it to be available to the user you’ll need to download the installer to the Palo Alto device. This can be accomplished by following the steps below:
1. Navigate to Device > SSL-VPN Client > Refresh – for this step to successfully complete the FW will require Internet access.
2. Choose the appropriate version of the client and select download.
3. Once downloaded the client will need to be activated. Select ‘activate’ to do this.
4. The SSL client installer is ready for deployment from the device.
Create a SSL-VPN Profile
This profile will be assigned to clients included in the specified authentication group(s). Different SSL portals can be created for different user/group(s) if required.
1. Navigate to Network > SSL-VPN > New.
2. Portal name: Enter a portal name.
3. Virtual system: If left blank this will be automatically populated on saving.
4. Tunnel interface: Select or create a tunnel interface that will be used with this profile.
5. Authentication: Select or create an authentication profile.
  • Device > Authentication Profile > New.
  • Name: Enter a meaningful name for the profile.
  • Lockout – failed attempts: If 0 is used the account will never become locked out.
  • Lockout – lockout time: If 0 is used the account lockout time never takes effect.
  • Allow list > Edit allow list: Enter/select the groups/users that should be granted access to the SSL portal.
  • Authentication: Select from the drop-down list the type of authentication that should be used. Methods include Local DB (a user/group will need to be created on the Palo Alto FW), RADIUS or LDAP.
6. Server certificate: A self-signed certificate can be generated, but if this is to be used on the public domain it may be best to purchase a public cert.
7. Enable IPsec encapsulation of client traffic: Check this box.
8. Redirect HTTP traffic to HTTPS login page: Optional.
9. Interface: Select the interface that will be used for incoming VPN connections.
10. IP address: Select the appropriate IP address from the list (as more than one may be bound to the interface).
11. Login lifetime: Enter a max session lifetime.
12. Inactivity logout: Enter an inactivity timeout value .
13. Client Configuration.
  • Primary/Secondary DNS: Primary/Secondary DNS server addresses.
  • Primary/Secondary WINS: Primary/Secondary WINS server addresses.
  • IP Pool – Subnet/Range: Enter an IP address range that can be assigned to remote clients.
  • DNS Suffix: Enter the DNS suffix.
  • Split tunnelling route: If you’re allowing clients use multiple subnets, enter the routes here.
There you have it, your SSL VPN is created.

2012年8月7日 星期二

關於Broadcast Address.....

熟悉Cisco設備的人都知道有個ip helper-address的指令可以幫助我們將DHCP request封包以unicast的方式丟給我們指定的DHCP server,但可能不知道,除了DHCP的封包之外,打開ip helper-address後也順便將以下的protocol以directed broadcast的方式轉發出去:

  • TFTP (port 69)
  • DNS (port 53)
  • Time (port 37)
  • TACACS (port 49)
  • BOOTP client (port 68)
  • BOOTP server (port 67)
  • NetBIOS name service (port 137)
  • NetBIOS datagram service (port 138)

如果我們想要將以上幾種之外的UDP封包以directed broadcast的方式轉發出去,可以使用ip forward-protocol的指令。

而提到directed broadcast可能會想到有個interface上的設定:no ip directed-broadcast,這個設定可以幫助我們避免類似smurf的DoS攻擊,而甚麼是directed broadcast呢?

說到directed broadcast我們先談談broadcast的種類:

1.subnet broadcast: 例如: 130.182.1.255

2.all-subnets-directed broadcast:例如:130.182.255.255

3.limited broadcast:例如:255.255.255.255,而BOOTP與DHCP都是使用這種broadcast。

而ip directed-broadcast在Cisco router上的作用可以下面的例子看出差別:






如上圖架構,我們建立一個ACL 101,內容是允許icmp封包通過,套用在R2的e0/0 interface上,同時開啟debug來觀察,並由R1執行ping 10.1.1.255,在R2 e0/0開啟ip directed-broadcast時可以觀察到以下資訊:
*Jul 25 20:57:03.879: IP: s=12.1.1.1 (Serial2/0), d=10.1.1.255 (Ethernet0/0), g=255.255.255.255, len 100, forward directed broadcast
*Jul 25 20:57:03.879: IP: s=12.1.1.1 (Serial2/0), d=10.1.1.255 (Ethernet0/0), len 100, rcvd 5
*Jul 25 20:57:03.879: IP: s=12.1.1.2 (local), d=12.1.1.1 (Serial2/0), len 100, sending
*Jul 25 20:57:03.899: IP: s=12.1.1.1 (Serial2/0), d=10.1.1.255 (Ethernet0/0), g=255.255.255.255, len 100, forward directed broadcast
(以下重复,输出省略)
雖然R1 ping的是subnet broadcast 10.1.1.255,但實際上封包到R2時會被轉成limited broadcast 255.255.255.255!



在R3上開debug看到的資訊如下:
*Jul 25 20:59:06.079: IP: s=12.1.1.1 (Ethernet0/0), d=255.255.255.255, len 100, rcvd 2
*Jul 25 20:59:06.079: IP: s=10.1.1.3 (local), d=12.1.1.1 (Ethernet0/0), len 100, sending
*Jul 25 20:59:06.099: IP: s=12.1.1.1 (Ethernet0/0), d=255.255.255.255, len 100, rcvd 2
*Jul 25 20:59:06.099: IP: s=10.1.1.3 (local), d=12.1.1.1 (Ethernet0/0), len 100, sending
*Jul 25 20:59:06.119: IP: s=12.1.1.1 (Ethernet0/0), d=255.255.255.255, len 100, rcvd 2
*Jul 25 20:59:06.119: IP: s=10.1.1.3 (local), d=12.1.1.1 (Ethernet0/0), len 100, sending
*Jul 25 20:59:06.139: IP: s=12.1.1.1 (Ethernet0/0), d=255.255.255.255, len 100, rcvd 2
*Jul 25 20:59:06.139: IP: s=10.1.1.3 (local), d=12.1.1.1 (Ethernet0/0), len 100, sending
*Jul 25 20:59:06.167: IP: s=12.1.1.1 (Ethernet0/0), d=255.255.255.255, len 100, rcvd 2
*Jul 25 20:59:06.167: IP: s=10.1.1.3 (local), d=12.1.1.1 (Ethernet0/0), len 100, sending
可以看出R3是用unicast的方式回應




但如果把ip directed-broadcast拿掉,同樣用R1去ping 10.1.1.255,則R2上看到的結果如下:
*Jul 25 21:05:22.071: IP: s=12.1.1.1 (Serial2/0), d=10.1.1.255 (Ethernet0/0), len 100, rcvd 5
*Jul 25 21:05:22.071: IP: s=12.1.1.2 (local), d=12.1.1.1 (Serial2/0), len 100, sending
*Jul 25 21:05:22.099: IP: s=12.1.1.1 (Serial2/0), d=10.1.1.255 (Ethernet0/0), len 100, rcvd 5
*Jul 25 21:05:22.099: IP: s=12.1.1.2 (local), d=12.1.1.1 (Serial2/0), len 100, sending
*Jul 25 21:05:22.131: IP: s=12.1.1.1 (Serial2/0), d=10.1.1.255 (Ethernet0/0), len 100, rcvd 5
*Jul 25 21:05:22.131: IP: s=12.1.1.2 (local), d=12.1.1.1 (Serial2/0), len 100, sending
*Jul 25 21:05:22.159: IP: s=12.1.1.1 (Serial2/0), d=10.1.1.255 (Ethernet0/0), len 100, rcvd 5
*Jul 25 21:05:22.159: IP: s=12.1.1.2 (local), d=12.1.1.1 (Serial2/0), len 100, sending
*Jul 25 21:05:22.191: IP: s=12.1.1.1 (Serial2/0), d=10.1.1.255 (Ethernet0/0), len 100, rcvd 5
*Jul 25 21:05:22.191: IP: s=12.1.1.2 (local), d=12.1.1.1 (Serial2/0), len 100, sending
可以看出,R2沒有像之前一樣將unicast轉成broadcast再轉發出去給R3了






2012年8月6日 星期一

Cisco Layer3 Switch上的IPv6設定方式

Step 1: globally enable IPv6

           (config)#ipv6 unicast-routing


Step 2: Enable IPv6 on L3 interfaces and setup ipv6 addresses

          (config)#interface vlan 254
          (config-if)#ipv6 enable
          (config-if)#ipv6 address 2001:288:123F:254::1/64


Step 3: Setup IPv6 default/static routing

         (config)#ipv6 route ::/0 2001:288:123F:254::FFFF
         (config)#ipv6 route 2001:288:123F:253::/64 2001:288:123F::1:1F

2012年7月27日 星期五

淺談Cisco OTV

       OTV(Overlay Transport Virtualization)這一項技術是Cisco為Data Center Solution所提出來的解決方法,目前並非標準,他所提出的是利用"MAC in IP"的概念將原本一個Data Center中虛擬機器做Vmotion時需要在同一個Layer 2的網路(DataNet)才能完成的限制消除掉,而讓不同Data Center之間的VM彼此也可以做Vmotion,這樣做的好處是可以分散一個Data Center的workload,讓其他Data Center可以彼此分擔workload,如果以更廣的角度來看,OTV讓很多Data Center可以看成同一個Data Center。

        雖然OTV是利用Layer2的技術,但是他會過濾掉原有在Layer2的一些frame,包含Spanning-Tree、Broadcast Storm、Unicast flooding等。

       使用OTV並不需要更動現有的網路架構(所以稱為"Overlay",覆蓋在既有的網路架構上),因此當有一個新的Data Center加入時並不需要更動到其他Data Center的網路架構,依照官方的說法最多只需四行指令就可以搞定了。

       目前Cisco只有Nexus 7000系列才有支援OTV,而目前有支援的module有M series,而F1系列的module則不支援。

       Cisco、VMWare、NetApp近期也提出一個叫做IVA(Imagine Virtually Anything)的概念,其中用到的也是OTV這個技術(其他就是VMWare的Vmotion及NetApp的FlexCache技術)。
IVA相關文章可參考:
http://www.imaginevirtuallyanything.com/us/solutions-and-technology.html#long

2012年7月25日 星期三

EtherChannel

      要將兩台Switch之間的連線使用多條線路形成一個trunk通常需要兩台互聯的interface要設定成固定的trunk port (channel-group x mode on, x=ID),如果所處的兩台switch環境是在異地,如果沒有事先設定好,或是兩台switch已經安裝好但需更改架構,除非兩頭都有網管人員同時設定,如果只有一個網管人員時必須爭取時間,先設定完一頭,再趕忙跑到另一頭,以縮短斷線時間。

      但如果使用動態的EtherChannel就可以解決這個問題。目前Cisco Switch上的支援兩種動態的EtherChannel協定,包含Cisco自己的PAgP及標準的802.3ad LACP,如果使用PAgP的話有支援幾種模式,每個模式之間可以形成trunk的搭配方式如下:






如果使用Static Trunking的方式,PAgP與LACP的設定方式如下:

This example shows how to configure an EtherChannel. It assigns two ports as static-access ports in VLAN 10 to channel 5 with the PAgP mode desirable:
Switch# configure terminal Switch(config)# interface range gigabitethernet0/1 -2 Switch(config-if-range)# switchport mode accessSwitch(config-if-range)# switchport access vlan 10
Switch(config-if-range)# channel-group 5 mode desirable
Switch(config-if-range)# end 

This example shows how to configure an EtherChannel. It assigns two ports as static-access ports in VLAN 10 to channel 5 with the LACP mode active
Switch# configure terminal 
Switch(config)# interface range gigabitethernet0/1 -2 
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 10
Switch(config-if-range)# channel-group 5 mode active
Switch(config-if-range)# end 

Summary:

EtherChannel Modes 

Mode Description

on

Mode that forces the LAN port to channel unconditionally. In the on mode, a usable EtherChannel exists only when a LAN port group in the on mode is connected to another LAN port group in the on mode. Because ports configured in the on mode do not negotiate, there is no negotiation traffic between the ports.


auto

PAgP mode that places a LAN port into a passive negotiating state in which the port responds to PAgP packets it receives but does not initiate PAgP negotiation.


desirable

PAgP mode that places a LAN port into an active negotiating state in which the port initiates negotiations with other LAN ports by sending PAgP packets.


passive

LACP mode that places a port into a passive negotiating state in which the port responds to LACP packets it receives but does not initiate LACP negotiation.


active

LACP mode that places a port into an active negotiating state in which the port initiates negotiations with other ports by sending LACP packets.

LAN ports can form an EtherChannel when they are in different PAgP modes if the modes are compatible. For example:

YA LAN port in desirable mode can form an EtherChannel successfully with another LAN port that is in desirable mode.

YA LAN port in desirable mode can form an EtherChannel with another LAN port in auto mode.

NA LAN port in auto mode cannot form an EtherChannel with another LAN port that is also in auto mode because neither port initiates negotiation.





LAN ports can form an EtherChannel when they are in different LACP modes as long as the modes are compatible. For example:

YA LAN port in active mode can form an EtherChannel successfully with another LAN port that is in active mode.
YA LAN port in active mode can form an EtherChannel with another LAN port in passive mode.
NA LAN port in passive mode cannot form an EtherChannel with another LAN port that is also in passive mode, because neither port initiates negotiation.