Posts mit dem Label pix werden angezeigt. Alle Posts anzeigen
Posts mit dem Label pix werden angezeigt. Alle Posts anzeigen

Freitag, 23. Oktober 2009

DE - "ASDM" Befehlseinschränkung

Ich hab eine ganze Weile nichts mehr gepostet und komme auch im Moment nicht wirklich dazu, daher mach ich mich mal ans übersetzen von älteren Artikeln, Es ist ja nicht so das wir hier nicht eigentlich Deutsch und Englisch anbieten wollten.

Die Anfrage um die es geht kam damals via Twitter und es war einfach grundlegend nur die Frage, Kann man Nutzern im ASDM rechte beschneiden, so das sie nur Teile der Konfiguration sehen können.. Kurz um: “Ja es geht”

Anbei hab ich eine Quick und Dirty Konfiguration zusammengeschustert die zeigt wie es geht. Ich hab das ganze auf realer Hardware getestet (ASA 5505 8.0.3 ASDM 6.2.1) mit echten VPN settings. Wie gesagt es geht und die Nutzer können nur die Settings im ASDM betrachten und nicht ändern.


PIX Version 8.0(3)
!
hostname PIX
domain-name playingwithnetworks.com
enable password 123 encrypted
!
interface Ethernet0
shutdown
no nameif
no security-level
no ip address
!
interface Ethernet1
nameif inside
security-level 100
ip address 192.168.188.2 255.255.255.0
!
!
!
dns server-group DefaultDNS
domain-name playingwithnetworks.com
pager lines 24
logging enable
logging buffered debugging
logging asdm errors
mtu inside 1500
icmp unreachable rate-limit 1 burst-size 1
asdm image flash:/asdm-621.bin
!
!
!

dynamic-access-policy-record DfltAccessPolicy

aaa authentication http console LOCAL
aaa authorization command LOCAL
! THIS IS IMPORTANT IF YOU MISS THIS COMMANDS THE THING WILL NOT WORK

http server enable
http 192.168.188.0 255.255.255.0 inside
!
!
!
username VPNSUPPORT password 123 encrypted priv 2
!
!
privilege show level 2 mode exec command running-config
privilege show level 2 mode exec command version
privilege show level 2 mode exec command interface
privilege show level 2 mode exec command logging
privilege show level 2 mode exec command aaa
privilege show level 2 mode exec command crypto
privilege show level 2 mode exec command vpn-sessiondb
privilege show level 2 mode exec command vpnclient
privilege show level 2 mode exec command vpn
privilege show level 2 mode exec command blocks
privilege show level 2 mode exec command webvpn
privilege show level 2 mode exec command compression
!
prompt hostname context


In der vorangegangene Konfiguration wird dem User VPNSUPPORT das Recht eingeräumt, VPN Informationen abzurufen, ohne sie ändern zu können.
Um andere Bereich freizugeben oder zu Sperren kann man einen Trick anwenden.


debug http enabled at level 250


Dann clickt man mit einem User auf die Bereiche die man sehen will und im Debug sieht man die URL die aufgerufen wird. Anhand dieser Information kann die CFG oben angepasst werden.


HTTP: processing GET URL '/admin/exec/show+ipv6+neighbor'


Im Beispiel kann Ipv6 für Level 2 User freigegeben werden.

HTH
Cheers NWG

Montag, 22. Juni 2009

EN - "ASDM" command restrictions

This one I just received via Twitter (Well i grabbed it from my search stream)
Can you restrict ASDM so that users can only view parts of the configuration.

Well "Yes you can"
I´ve created a quick and dirty configuration that should reflect this settings.
Update tested on real hardware with real VPN connections (ASA 5505 8.0.3 ASDM 6.2.1) Works quite well, users can´t reset or disconnect only view. Some commands added to view all VPN settings on ASDM.


PIX Version 8.0(3)
!
hostname PIX
domain-name playingwithnetworks.com
enable password 123 encrypted
!
interface Ethernet0
shutdown
no nameif
no security-level
no ip address
!
interface Ethernet1
nameif inside
security-level 100
ip address 192.168.188.2 255.255.255.0
!
!
!
dns server-group DefaultDNS
domain-name playingwithnetworks.com
pager lines 24
logging enable
logging buffered debugging
logging asdm errors
mtu inside 1500
icmp unreachable rate-limit 1 burst-size 1
asdm image flash:/asdm-621.bin
!
!
!

dynamic-access-policy-record DfltAccessPolicy

aaa authentication http console LOCAL
aaa authorization command LOCAL
! THIS IS IMPORTANT IF YOU MISS THIS COMMANDS THE THING WILL NOT WORK

http server enable
http 192.168.188.0 255.255.255.0 inside
!
!
!
username VPNSUPPORT password 123 encrypted priv 2
!
!
privilege show level 2 mode exec command running-config
privilege show level 2 mode exec command version
privilege show level 2 mode exec command interface
privilege show level 2 mode exec command logging
privilege show level 2 mode exec command aaa
privilege show level 2 mode exec command crypto
privilege show level 2 mode exec command vpn-sessiondb
privilege show level 2 mode exec command vpnclient
privilege show level 2 mode exec command vpn
privilege show level 2 mode exec command blocks
privilege show level 2 mode exec command webvpn
privilege show level 2 mode exec command compression
!
prompt hostname context


So this should be enough to show your user VPNSUPPORT information about the status of your VPN connection. If you need further information you could use the following trick: switch on debug:


debug http enabled at level 250


and then click with you low priv user to the location of the ASDM you need. You will get the output of what URL was requested and from this you can see what commands you need to enable
for example if you click on monitor interfaces you will get along with others the debug output:


HTTP: processing GET URL '/admin/exec/show+ipv6+neighbor'


With this information you can now enable show ip6 for level 2 if you need.

Hope that helps
NWG

Dienstag, 21. April 2009

DE – "Wiederherstellen" des Pre Shared Keys auf der ASA

Es soll ja vorkommen das man nach zu viel Arbeit noch etwas an der Konfig ändern will und dann einem Flüchtigkeitsfehler unterlaufen. Besonders gern passiert so was bei Copy+Paste Aktionen. Vor einiger ist es mir auch schon passiert, bei der Erstellung einer Tunnelgruppe bei der ich alle Parameter aus einer alten Tunnelgruppe kopierte habe ich den Pre Shared Key der alten Gruppe aus versehen überschrieben. Wie kann man diesen Key wieder herstellen, ein show run
zeigt nur ein * als pre shared key.
Aber so lässt sich der Key auch anzeigen:

copy startup flash:/startup_bck.cfg
more flash:/startup_bck.cfg

Nun einfach nur noch runter scrollen bis zu den Tunnel Gruppen und dann den Key wieder an die richtige Stelle kopieren.
Das ganze Funktioniert natürlich nur solange kein copy run start oder wr mem ausgeführt wurde.

Immer daran denken die Datei nach Verwendung wieder von Flash zu löschen

Cheers
NWG

EN - How to "recover" ASA Pre Shared Key

If you´ve ever done a configuration to late at night and did some copy+paste you might had the same problem I´ve had some days ago.
I was creating a new VPN tunnel and generally was copy and pasting the settings from an old tunnel. Accidentally I kicked out the pre shared key from the original tunnel (learned lesson: always check twice what you paste).
So how to fix this problem. This is not that simple since a show run will just give you a * as pre shared key.
Anyway do the following:


copy startup flash:/startup_bck.cfg
more flash:/startup_bck.cfg


scroll down to your tunnel groups and you will get the plain password. If you copy and past this password into your running tunnel group configuration your tunnel should be working in no time.
It is only possible to do this if you did not issue a copy run start or wr mem.

Remember to delete that file if you don´t need it anymore.

Cheers
NWG

Mittwoch, 15. April 2009

DE - VPN on a stick mit Cisco PIX und ASA

Vor einer Weile hat Zif ja die "Router on a stick" Konfiguration gepostet. Ich will die Gelegenheit nutzen, um etwas wesentlich Interessanteres darzustellen, die "VPN on a Stick" Konfiguration auf der Cisco ASA bzw. PIX.

Was bedeutet VPN on a Stick genau, nun es handelt sich dabei um die Konfiguration des VPN so das der VPN Nutzer sich durch das VPN Gateway auf das Internet zugreifen kann. Besonders ist daran, das der VPN Nutzer die Appliance nicht wirklich verlässt sonder direkt über das eingehende Interface wieder hinaus geht. In anderen fällen wird das ganze auch Hairpinning genannt.

Konfiguration.
Zuerst muss das erledigt werden was auf jeder ASA/PIX notwendig ist, also so etwas wie Interface Konfiguration usw.
Grundlegend ist das überall gleich aber unterscheidet sich doch zwischen ASA, PIX und ASA 5505, die Unterschiede werde ich hier posten, aber für genauere Unterschiede werft doch einen Blick auf CISCO.com.

ASA 5510 oder höher

interface ethernet 0/0
description ### Outside Interface ###
nameif outside
ip address 10.255.255.2 255.255.255.0
interface ethernet 0/1
description ### Inside Interface ###
nameif inside
ip address 192.168.0.1 255.255.255.0


ASA 5505

interface vlan 10
description ### Outside Interface ###
nameif outside
ip address 10.255.255.2 255.255.255.0
interface vlan 20
description ### Inside Interface ###
nameif inside
ip address 192.168.0.1 255.255.255.0


PIX

interface ethernet 0
description ### Outside Interface ###
nameif outside
ip address 10.255.255.2 255.255.255.0
no shutdown
interface ethernet 1
description ### Inside Interface ###
nameif inside
ip address 192.168.0.1 255.255.255.0
no shutdown

global (outside) 1 interface
nat (inside) 1 192.168.0.0 255.255.255.0
route outside 0.0.0.0 0.0.0.0 10.255.255.254
! 10.255.255.254 ist der nächste Hop, der Router des Providers

crypto ipsec transform-set ESP-AES256-MD5 esp-aes-256 esp-md5-hmac

crypto dynamic-map DynOutsideMap 100 set transform-set ESP-AES256-MD5
! Konfiguration für den dynamischen VPN Client
!
crypto map OutsideMap 65535 ipsec-isakmp dynamic DynOutsideMap
crypto map OutsideMap interface outside
! Konfiguration der Crypto Map die auf dem Outside Interface gebunden wird

crypto isakmp enable outside
crypto isakmp policy 100
authentication pre-share
encryption aes-256
hash sha
group 2
lifetime 86400


Das ist die Grundlage die fast überall benötigt wird. Als nächstes müssen die spezifischen VPN Parameter konfiguriert werden.


ip local pool POOL_VPN_Client 192.168.1.1-192.168.1.254 mask 255.255.255.0

group-policy GPOL_VPN_Client internal
group-policy GPOL_VPN_Client attributes
split-tunnel-policy tunnelall

tunnel-group GRP_VPN_Client type remote-access
tunnel-group GRP_VPN_Client general-attributes
default-group-policy GPOL_VPN_Client
address-pool POOL_VPN_Client
tunnel-group GRP_VPN_Client ipsec-attributes
pre-shared-key DoNotUseMe


So weit so gut, der Client sollte nun in der Lage sein eine Verbindung zur ASA oder PIX aufzubauen (noch keine wirkliche VPN Verbindung). Es bedarf natürlich noch einen User für die Verbindung. AAA wäre eine Lösung, aber für dieses Beispiel bleiben wir bei der LOCAL Lösung.

username VPNUser password none priv 1

Jetzt etwas interessantes, NAT.
Wir vermuten einfach mal das auf der ASA/ PIX NAT gemacht wird (wird es ja meistens), so muss nun eine NAT Ausnahme konfiguriert werden, damit der VPN Client die internen Hosts erreichen kann.



Object-group network OBJ_VPN_Client
network 192.168.1.0 255.255.255.0
Object-group network OBJ_LAN
network 192.168.0.0 255.255.255.0

access-list NO_nat_inside remark ### NAT exceptions ###
access-list NO_nat_inside permit ip object-group OBJ_LAN object-group OBJ_VPN_Client


So nun sind wir fast durch, noch das NAT Statement hinzufügen.


nat (outside) 1 192.168.1.0 255.255.255.0
! NAT auf dem Outside interface damit der VPN Nutzer eine öffentliche IP
! erhält
nat (inside) 0 access-list NO_nat_inside


Jetzt noch die Standard Regel "Kein Traffic zwischen Interfaces mit dem gleichen Sicherheitslevel" aufheben.

same-security-traffic permit intra-interface


Das war es also!

Ich hoffe es hat gefallen und danke für die Aufmerksamkeit :D

Vollständige PIX Konfiguration

Dienstag, 14. April 2009

EN - VPN on a stick with Cisco PIX and ASA

Well since Zif was doing the "Router on a stick" configuration, I'd like to share with you the much cooler "VPN on a Stick" configuration on the ASA/ PIX.

What does VPN on a stick mean. Well it means that if you connect to a VPN gateway your traffic will run across this gateway and will be forwarded into the Internet (if you try to connect to the Internet). Why is it named "on a stick" this is because you enter the VPN gateway (ASA/Pix) on the
outside interface an you leave it the same way without accessing the private LAN Sometimes it called hair pinning (if you enter an other VPN connection)

So what do we need? First of all an ASA/ PIX and second a VPN Client.

Configuration.
First we´ll have to do some fluff stuff like creating interfaces etc. This is depending on your hardware slightly different. I´ll post the differences here but for later configs please have a look at CISCO.com

ASA 5510 or higher

interface ethernet 0/0
description ### Outside Interface ###
nameif outside
ip address 10.255.255.2 255.255.255.0
interface ethernet 0/1
description ### Inside Interface ###
nameif inside
ip address 192.168.0.1 255.255.255.0


ASA 5505

interface vlan 10
description ### Outside Interface ###
nameif outside
ip address 10.255.255.2 255.255.255.0
interface vlan 20
description ### Inside Interface ###
nameif inside
ip address 192.168.0.1 255.255.255.0


PIX

interface ethernet 0
description ### Outside Interface ###
nameif outside
ip address 10.255.255.2 255.255.255.0
no shutdown
interface ethernet 1
description ### Inside Interface ###
nameif inside
ip address 192.168.0.1 255.255.255.0
no shutdown

global (outside) 1 interface
nat (inside) 1 192.168.0.0 255.255.255.0
route outside 0.0.0.0 0.0.0.0 10.255.255.254
! 10.255.255.254 is the next hop router from the ISP

crypto ipsec transform-set ESP-AES256-MD5 esp-aes-256 esp-md5-hmac

crypto dynamic-map DynOutsideMap 100 set transform-set ESP-AES256-MD5
! configuration for dynamic Clients like the Cisco VPN Client
!
crypto map OutsideMap 65535 ipsec-isakmp dynamic DynOutsideMap
crypto map OutsideMap interface outside
! configuration of the over all Crypto Map that is applied on the outside Interface

crypto isakmp enable outside
crypto isakmp policy 100
authentication pre-share
encryption aes-256
hash sha
group 2
lifetime 86400


Thats the basic part that you need nearly everywhere. Next step would be to configure the specific parameters for your VPN client.


ip local pool POOL_VPN_Client 192.168.1.1-192.168.1.254 mask 255.255.255.0

group-policy GPOL_VPN_Client internal
group-policy GPOL_VPN_Client attributes
split-tunnel-policy tunnelall

tunnel-group GRP_VPN_Client type remote-access
tunnel-group GRP_VPN_Client general-attributes
default-group-policy GPOL_VPN_Client
address-pool POOL_VPN_Client
tunnel-group GRP_VPN_Client ipsec-attributes
pre-shared-key DoNotUseMe


So far, so good, your client should now be able to connect to your ASA or Pix but well, nothing more.
You still need to add a User that is allowed to log in. You could use AAA but for this scenario we stick to LOCAL users.

username VPNUser password none priv 1

Now lets start with the interesting parts
Assuming that you do NAT on your ASA/ Pix you need to configure a NAT exception so that you can access your hosts on the inside interface from your VPN Client.

I tend to use objects groups quite a lot since they enable you to quick change a lot of ACLs. For this reason I´ll set up some object groups and use them later.


Object-group network OBJ_VPN_Client
network 192.168.1.0 255.255.255.0
Object-group network OBJ_LAN
network 192.168.0.0 255.255.255.0

access-list NO_nat_inside remark ### NAT exceptions ###
access-list NO_nat_inside permit ip object-group OBJ_LAN object-group OBJ_VPN_Client


So we are nearly through add a new NAT statement


nat (outside) 1 192.168.1.0 255.255.255.0
! NAT on interface outside so that your VPN User get your public IP
nat (inside) 0 access-list NO_nat_inside


Finlay disable the default rule "No traffic between interfaces with the same security level".

same-security-traffic permit intra-interface


Thats it!

Hope you enjoyed and thanks for your attention.

Full PIX configuration

Samstag, 11. April 2009

DE - Task 2.1 - Grundlegendes OSPF zwischen Routern und ASA

In diesem Kapitel erarbeiten wir die Startkonfiguration wie sie beim Kunden existiert, mit kleinen Abänderungen um dem Blogthema gerecht zu werden.
Das Startnetzwerk besteht aus 3 Routern und 1 PIX die den Internetzugriff realisiert.

Wie bereits erwähnt stimmt das Netzwerk nicht zu 100 % mit dem des Kunden überein. Wir verwenden für die Bereiche Inner Core Routing und Outer Core Routing Cisco 3660 Router mit einem 12.3.26 IOS. Beim Kunden befinden sich in beiden Bereiche nicht nur Cisco Router sondern auch Geräte anderer Hersteller und natürlich sind es nicht nur 3 Geräte. Alle 3660 Router haben in den vorhanden Slots je 2 zusätzliche Fastethernet Interfaces installiert.

Das zentrale Internet Gateway wird wie bereits erwähnt von einer PIX 525 gestellt, diese läuft mit der Version 7.2.4 der PIX Software.

Zwischen allen Geräten wurden Transfernetze angelegt die genau groß genug sind um 2 IPs zu enthalten, sprich es wird mit einer Netzmaske von 255.255.255.252 (/30) gearbeitet. Alle Verbindungen zwischen Inner Core und Outer Core liegen im Netzwerkbereich 10.0.0.0 255.255.0.0. Alle Verbindungen die den Core Bereich verlassen liegen im Netzbereich 10.1.0.0 255.255.0.0. Dies sind Verbindungen zu den später einzufügenden VPN-Edge Routern und der PIX.

Am Inner Core Router hängt außerdem noch das Netzwerk 172.16.0.0 /24, dieses Netzwerk beinhaltet die Management Server des Kunden, unter anderem den CISCO ACS (Version 4.2), einen MS Active Directory Server mit einer bereits installierten CA und einen weiteren Radius Server. Alle Server sind relevant für die spätere Anbindung der VPN Nutzer. Aber mehr davon in den nächsten Kapiteln.

Wir haben als 3 Cisco Router und eine PIX, wo fängt man am besten an? Natürlich mit den Standard Aufgaben die man bei jedem Gerät einpflegt. Nur als Info, ich werde in den folgenden Konfigs nur Änderungen von den Vorgaben von Cisco einpflegen.

2.1.1 Grundlagen Konfiguration für Hostname, Domainname NTP Settings und IP Interfaces auf Cisco Routern und PIX/ ASA Firewall

Router für den Inner Core Bereich - R_Inner_Core

! Hostname und Domain Konfiguration
! =================================
hostname R_Inner_Core
ip domain name Task2.local
!
! Kein DNS Lookup fuer Router
! ===========================
no ip domain lookup
!
! Interface Konfiguration
! =======================
interface Loopback0
description ### Loop 0 for MGMT ###
ip address 10.99.99.1 255.255.255.255
!
interface FastEthernet0/0
description ### Uplink R_Outer_Core_1 ###
ip address 10.0.0.1 255.255.255.252
full-duplex
speed 100
no shutdown
!
interface FastEthernet0/1
description ### Uplink R_Outer_Core_2 ###
ip address 10.0.0.5 255.255.255.252
full-duplex
speed 100
no shutdown
!
interface FastEthernet1/0
description ### Uplink to internet gateway PIX ###
ip address 10.0.0.13 255.255.255.252
full-duplex
speed 100
no shutdown
!
interface FastEthernet2/0
description ### Connection to Server Network ###
ip address 172.16.0.5 255.255.255.0
speed 100
full-duplex
no shutdown
!
! Konfiguration der NTP Einstellungen
! ===================================
ntp server 192.53.103.108 prefer
ntp server 192.53.103.104
! external NTP Server


Router für den Netzwerkbereich Outer Core Routing - R_Outer_Core_1 und R_Outer_Core_2

! Hostname und Domain Konfiguration
! =================================
hostname R_Outer_Core_1
ip domain name Task2.local
!
! Kein DNS Lookup fuer Router
! ===========================
no ip domain lookup
!
! Interface Konfiguration
! =======================
interface Loopback0
description ### Loop 0 for MGMT ###
ip address 10.99.99.2 255.255.255.255

!
interface FastEthernet1/0
description ### Link to R_Inner_Core ###
ip address 10.0.0.2 255.255.255.252
full-duplex
speed 100
no shutdown
!
interface FastEthernet2/0
description ### inter Link to R_Outer_Core_2 ###
ip address 10.0.0.9 255.255.255.252
full-duplex
speed 100
no shutdown
!
! Konfiguration der NTP Einstellungen
! ===================================
ntp server 10.99.99.1 prefer
! Hier fällt gleich auf das als NTP Quelle der Router R_Inner_Core verwendet
! wird. Damit werden die Zugriffe der Router auf das Internet minimiert


Als letztes kommt Router R_Outer_Core_2

! Hostname und Domain Konfiguration
! =================================
hostname R_Outer_Core_2
ip domain name Task2.local
!
! Kein DNS Lookup fuer Router
! ===========================
no ip domain lookup
!
! Interface Konfiguration
! =======================
interface Loopback0
description ### Loop 0 for MGMT ###
ip address 10.99.99.3 255.255.255.255
!
interface FastEthernet1/0
description ### Link to R_Inner_Core ###
ip address 10.0.0.6 255.255.255.252
speed 100
full-duplex
no shutdown
!
interface FastEthernet2/0
description ### inter Link to R_Outer_Core_1 ###
ip address 10.0.0.10 255.255.255.252
speed 100
full-duplex
no shutdown
!
! Konfiguration der NTP Einstellungen
! ===================================
ntp server 10.99.99.1 prefer


Als letztes wird die PIX das Internet Gateway konfiguriert - FW-GW-1


! Hostname und Domain Konfiguration
! =================================
hostname FW-GW-1
domain-name Task2.local
!
! Interface Konfiguration
! =======================
interface Ethernet0
description ### Central Breakout Point ###
speed 100
duplex full
nameif IF_Outside
security-level 0
ip address 192.168.33.2 255.255.255.240
no shutdown
!
interface Ethernet1
description ### Link to Core Router ###
speed 100
duplex full
nameif IF_Inside
security-level 100
ip address 10.0.0.14 255.255.255.252
no shutdown
!
! Default Route für unbekannten Traffic
! =====================================
route IF_Outside 0.0.0.0 0.0.0.0 192.168.33.1 1
! 192.168.33.1 ist der Nächste Hop, der Router des ISP


Ab jetzt sollte es möglich sein von jedem gerät die direkt verbundenen Geräte anzupingen.

Es fällt auf das auf der PIX noch kein NAT konfiguriert ist. Das werden wir später nachholen.

2.1.2 OSPF zwischen Cisco Routern und PIX/ ASA

Nachdem wir die grundlegende Konfiguration der Router und der PIX /ASA hinter uns haben, geht es nun weiter mit OSPF. Mehr Informationen über Grundlagen Konfigurationvon Routern werft einen Blick in ZIFs Blog Eintrag von vor einigen Tagen.

OSPF ist recht einfach zu konfigurieren!
Als erstes muss ein Routing Prozess definiert werden, in diesem wird festgelegt welche Routen der Router mitteilen soll und wenn alle richtig gemacht wurde, war es das schon.

R_Inner_Core

! Erzeugen des Routing Prozesses
router ospf 100
! definieren der Router ID
router-id 10.99.99.1
! Konfigurieren des Loggings
log-adjacency-changes
! Bestimmen was der Router bekannt geben soll
redistribute connected subnets
redistribute static subnets
! keine Routing Updates für Interface Loopback 0
passive-interface Loopback0
!
! Bestimmen welche Netzwerk an dem Router hängen. Wird ein Netzwerk hier nicht
! eingepflegt wird dort kein Routing ausgeführt.
!
network 10.0.0.0 0.0.0.3 area 0
network 10.0.0.4 0.0.0.3 area 0
network 10.0.0.13 0.0.0.3 area 0
! Auch das Loopback Interface (Netzwerk mit 32er Maske) wird bekannt gegeben
network 10.99.99.1 0.0.0.0 area 0
network 172.16.0.0 0.0.0.255 area 0



Fast das gleiche wird auf den anderen Routern R_Outer_Core_1 und R_Outer_Core_2 konfiguriert.

R_Outer_Core_1

router ospf 100
router-id 10.99.99.2
log-adjacency-changes
redistribute connected subnets
redistribute static subnets
passive-interface Loopback0
network 10.0.0.0 0.0.0.3 area 0
network 10.0.0.8 0.0.0.3 area 0
network 10.99.99.2 0.0.0.0 area 0


R_Outer_Core_2

router ospf 100
log-adjacency-changes
redistribute connected subnets
redistribute static subnets
passive-interface Loopback0
network 10.0.0.4 0.0.0.3 area 0
network 10.0.0.8 0.0.0.3 area 0
network 10.99.99.3 0.0.0.0 area 0


Als letztes wird die PIX/ ASA dem OSPF Netzwerk hinzugefügt.
FW-GW-1

! erzeugen des Routing Prozesses
router ospf 100
! Definieren der Router ID
! Hinweis: da auf der ASA / PIX keine Loopback Interfaces angelegt werden
! können, kann man hier den Hostnamen oder ein anderes Interface nehmen
router-id 10.0.0.14
network 10.0.0.12 255.255.255.252 area 0
log-adj-changes
redistribute static subnets
! hier wird eine Defaultroute in das OSPF Netzwerk eingepflegt so das das
! Internet über DIESE PIX / ASA erreicht werden kann.
default-information originate


Das war es auch schon mit der grundlegenden OSPF Konfiguration. Es sollte nun möglich sein von jedem Gerät jedes andere Gerät anzupingen.

Nach dem Aufruf des Befehls show ip route auf R_Inner_Core sollte die Ausgabe etwa dieses Format haben.

R_Inner_Core#sh ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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 10.0.0.14 to network 0.0.0.0

172.16.0.0/24 is subnetted, 1 subnets
C 172.16.0.0 is directly connected, FastEthernet2/0
10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
O 10.0.0.8/30 [110/2] via 10.0.0.6, 00:01:18, FastEthernet0/1
[110/2] via 10.0.0.2, 00:01:18, FastEthernet0/0
C 10.0.0.12/30 is directly connected, FastEthernet1/0
O 10.99.99.2/32 [110/2] via 10.0.0.2, 00:01:18, FastEthernet0/0
O 10.99.99.3/32 [110/2] via 10.0.0.6, 00:01:18, FastEthernet0/1
C 10.0.0.0/30 is directly connected, FastEthernet0/0
C 10.99.99.1/32 is directly connected, Loopback0
C 10.0.0.4/30 is directly connected, FastEthernet0/1
O*E2 0.0.0.0/0 [110/1] via 10.0.0.14, 00:01:18, FastEthernet1/0


O*E2 0.0.0.0/0 [110/1] via 10.0.0.14, 00:01:18, FastEthernet1/0 ist die Interessanteste Route von allen. Sie besagt das jede unbekannte IP über die PIX erreicht werden kann. Es handelt sich hierbei um die vorhin angesprochende Default Route.


2.1.3 Anschliesen der Internetverbindung

Wenn OSPF läuft und alle Router die Route zum Internet kennen muss eigentlich nur noch NAT auf der ASA / PIX konfiguriert werden um den Router auch Internetzugriff zu ermöglichen.
NAT ist notwendig da unser Netzwerk mit privaten Adressen gestaltet ist und diese bekanntermassen nicht ins Internet geroutet werden. Wir benutzen an dieser Stelle eine Unterart des NAT nämlich PAT (Port Address Translation).

Nehmen wir an das unser Provider uns das Netzwerk 192.168.33.0 255.255.255.240 zur Verfügung gestellt hat und sein Router in dem Netz die 192.168.33.1 benutzt. Das bedeutet das unserem Netzwerk noch die IPs von 192.168.33.2- 192.168.33.14 zur Verfügung stehen.

Für das PAT werden wir die 192.168.33.3 benutzen, das sollte eigentlich reichen. Als zweiten Schritt müssen wir bestimmen welche Netze umgesetzt werden sollen. Natürlich alle Netzwerk die intern sind.


global (IF_Outside) 1 192.168.33.3
nat (IF_Inside) 1 0.0.0.0 0.0.0.0
! übersetze jede IP die über das Interface IF_Inside kommt
! in die Öffentliche Adresse + Port


Da wir noch keinen ISP Router konfiguriert haben, können wir NAT nur mit den Befehl show nat überprüfen.
Der Befehl sollte folgenden Output zurück geben:

show nat

NAT policies on Interface IF_Inside:
match ip IF_Inside any IF_Outside any
dynamic translation to pool 1 (192.168.33.3)


Gut das war´s. Mit dem nun funktionierenden Netzwerk, können wir später weiterarbeiten.

Netzwerk Diagramm:


Hier könnt ihr noch einmal die gesamte Konfiguration der Router herunterladen:
LINK: R_Inner_Core
LINK: R_Outer_Core_1
LINK: R_Outer_Core_2
LINK: FW-GW-1


Bald gibt es mehr. Wie immer sind Kommentare, Hinweise und natürlich Fragen sehr willkommen

Cheers NWG

Mittwoch, 8. April 2009

EN - Task 2.1 - Basic OSPF routing between router and ASA

This is the initial configuration from where we will start to deploy our scenario. We´ve got 3 router and one PIX, this pix is doing the uplink to the Internet.

As mentioned earlier this is a scheme that has been slightly changed to fit into this blog. Both inner and outer core routers are not only Cisco routers, as well as the used firewall is in the real world no ASA or PIX. Since we are focusing on Cisco this facts have been ignored and we stick to Cisco routers, PIXs and ASAs.
In this example the inner core routing network is represented by one 3660 router running IOS 12.3.26 The outer core routing network consist of 2x 3660 routers also running IOS 12.3.26. All 3660 got 2 additional Fast Ethernet Interfaces installed. Finally the firewall is a Cisco PIX 252 running 7.2.4.

Between the routers their are transfer networks, just big enough to hold 2 IP addresses, this means we use a 255.255.255.252 (/30)mask for those networks. All connections between inner and outer core as well as within the outer core are located in the network 10.0.0.0 255.255.0.0. Connections leaving the core network are usually 10.1.0.0 255.255.0.0 most times this is used for links to the edge devices like the PIX and later on to connect the VPN edge routers.

Attached to the inner core router is the network 172.16.0.0 /24 this network holds the customers servers like the Cisco ACS (version 4.2) an MS Active Directory Server (Server 2003)with a certification authority configured as well as a free radius server. All Servers will be used later for the VPN User configuration. But this will be important later.


So we´ve got 3 routers and a PIX. Where to start? Well we start with common tasks configuration of hostnames, domain names and interfaces. I´ll just post the changes I´ve made, no defaults included.


2.1.1 Basic Configuration including Hostname, Domainname, NTP Settings and IP Interfaces on Routers and PIX /ASA Firewalls

Router for the inner core area - R_Inner_Core

! Hostname and Domain configuration
! =================================
hostname R_Inner_Core
ip domain name Task2.local
!
! No hostname lookup for routers
! ==============================
no ip domain lookup
!
! Interface configuration
! =======================
interface Loopback0
description ### Loop 0 for MGMT ###
ip address 10.99.99.1 255.255.255.255
!
interface FastEthernet0/0
description ### Uplink R_Outer_Core_1 ###
ip address 10.0.0.1 255.255.255.252
full-duplex
speed 100
no shutdown
!
interface FastEthernet0/1
description ### Uplink R_Outer_Core_2 ###
ip address 10.0.0.5 255.255.255.252
full-duplex
speed 100
no shutdown
!
interface FastEthernet1/0
description ### Uplink to internet gateway PIX ###
ip address 10.0.0.13 255.255.255.252
full-duplex
speed 100
no shutdown
!
interface FastEthernet2/0
description ### Connection to Server Network ###
ip address 172.16.0.5 255.255.255.0
speed 100
full-duplex
no shutdown
!
! configuration for NTP settings
! ==============================
ntp server 192.53.103.108 prefer
ntp server 192.53.103.104
! external NTP Server


So first router done, to more to go.

Routers for the outer routing Network R_Outer_Core_1 and R_Outer_Core_2

! Hostename and domain configuration
! ==================================
hostname R_Outer_Core_1
ip domain name Task2.local
!
! No hostname lookup for routers
! ==============================
no ip domain lookup
!
! Interface configuration
interface Loopback0
description ### Loop 0 for MGMT ###
ip address 10.99.99.2 255.255.255.255

!
interface FastEthernet1/0
description ### Link to R_Inner_Core ###
ip address 10.0.0.2 255.255.255.252
full-duplex
speed 100
no shutdown
!
interface FastEthernet2/0
description ### inter Link to R_Outer_Core_2 ###
ip address 10.0.0.9 255.255.255.252
full-duplex
speed 100
no shutdown
!
! NTP Settings
! ============
ntp server 10.99.99.1 prefer
! You may note that the NTP server is the inner core router R_Inner_Core.
! This is to limit access to public resources.


Last router to be configured R_Outer_Core_2

! Hostname and domain name configuration
! ======================================
hostname R_Outer_Core_2
ip domain name Task2.local
!
! No hostname lookup for routers
! ==============================
no ip domain lookup
!
! Interface configuration
! =======================
interface Loopback0
description ### Loop 0 for MGMT ###
ip address 10.99.99.3 255.255.255.255
!
interface FastEthernet1/0
description ### Link to R_Inner_Core ###
ip address 10.0.0.6 255.255.255.252
speed 100
full-duplex
no shutdown
!
interface FastEthernet2/0
description ### inter Link to R_Outer_Core_1 ###
ip address 10.0.0.10 255.255.255.252
speed 100
full-duplex
no shutdown
!
! NTP Settings
! ============
ntp server 10.99.99.1 prefer


Last configured is the Internet Gateway in this scenario the PIX FW-GW-1


! Hostname and domain configuration
! =================================
hostname FW-GW-1
domain-name Task2.local
!
! Interface Configuration
! =======================
interface Ethernet0
description ### Central Breakout Point ###
speed 100
duplex full
nameif IF_Outside
security-level 0
ip address 192.168.33.2 255.255.255.240
no shutdown
!
interface Ethernet1
description ### Link to Core Router ###
speed 100
duplex full
nameif IF_Inside
security-level 100
ip address 10.0.0.14 255.255.255.252
no shutdown
!
! Default route for any unknown traffic
! =====================================
route IF_Outside 0.0.0.0 0.0.0.0 192.168.33.1 1
! 192.168.33.1 is the next hop to the ISP


By now you should be able to ping any directly connected device from each machine.

As you may notice the PIX is not doing NAT, this will be configured in a separate step later on in this section.


2.1.2 OSPF between Cisco Routers and PIX/ ASA

After we´ve finished the basic steps of configuring routers and PIX/ ASA Firewalls we will move to OSPF. For more information on setting up a basic router configuration have a look at ZIFs post some days ago.

OSPF is quite easy to configure.
First of you need to define a routing process, the routes you like to redistribute and if everything is fine you should have OSPF running in no time.
As earlier mentioned in this configs I´ll just post changes from the default configuration.

R_Inner_Core

! define your routing process
router ospf 100
! set your router ID
router-id 10.99.99.1
! configure logging
log-adjacency-changes
! define what you want to announce from this router
redistribute connected subnets
redistribute static subnets
! no routing updates on interface Loopback0
passive-interface Loopback0
!
! define networks attached to your router, if you do not add a network
! that is configured on one of your interfaces this interface will not be
! part of your OSPF (obvious!)
!
network 10.0.0.0 0.0.0.3 area 0
network 10.0.0.4 0.0.0.3 area 0
network 10.0.0.13 0.0.0.3 area 0
! announce even your loopback interface
network 10.99.99.1 0.0.0.0 area 0
network 172.16.0.0 0.0.0.255 area 0



The same is configured on router R_Outer_Core_1 and R_Outer_Core_2
R_Outer_Core_1

router ospf 100
router-id 10.99.99.2
log-adjacency-changes
redistribute connected subnets
redistribute static subnets
passive-interface Loopback0
network 10.0.0.0 0.0.0.3 area 0
network 10.0.0.8 0.0.0.3 area 0
network 10.99.99.2 0.0.0.0 area 0


R_Outer_Core_2

router ospf 100
log-adjacency-changes
redistribute connected subnets
redistribute static subnets
passive-interface Loopback0
network 10.0.0.4 0.0.0.3 area 0
network 10.0.0.8 0.0.0.3 area 0
network 10.99.99.3 0.0.0.0 area 0


Finally add your PIX /ASA to the OSPF network.
FW-GW-1

! create your routing process
router ospf 100
! define your router ID |
! NOTE: no loopback interfaces can be created on ASA and PIX
! you could use a hostname instead
router-id 10.0.0.14
network 10.0.0.12 255.255.255.252 area 0
log-adj-changes
redistribute static subnets
! Propagate a default route into the OSPF process so that every unknown IP
! can be reached via THIS pix /ASA
default-information originate


Well so much for basic OSPF. You should be able to ping every device in your network from every location.

If you issue a show ip route on R_Inner_Core the output should look like:

R_Inner_Core#sh ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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 10.0.0.14 to network 0.0.0.0

172.16.0.0/24 is subnetted, 1 subnets
C 172.16.0.0 is directly connected, FastEthernet2/0
10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
O 10.0.0.8/30 [110/2] via 10.0.0.6, 00:01:18, FastEthernet0/1
[110/2] via 10.0.0.2, 00:01:18, FastEthernet0/0
C 10.0.0.12/30 is directly connected, FastEthernet1/0
O 10.99.99.2/32 [110/2] via 10.0.0.2, 00:01:18, FastEthernet0/0
O 10.99.99.3/32 [110/2] via 10.0.0.6, 00:01:18, FastEthernet0/1
C 10.0.0.0/30 is directly connected, FastEthernet0/0
C 10.99.99.1/32 is directly connected, Loopback0
C 10.0.0.4/30 is directly connected, FastEthernet0/1
O*E2 0.0.0.0/0 [110/1] via 10.0.0.14, 00:01:18, FastEthernet1/0


O*E2 0.0.0.0/0 [110/1] via 10.0.0.14, 00:01:18, FastEthernet1/0 is one of the more interesting routes. This is the default route announced into the OSPF area by our PIX/ASA. As a consequence all traffic to unknown IPs will be send to the PIX/ASA.


2.1.3 Bringing up the Internet gateway

With OSPF running and a default route pointing to the Internet propagated we just need some few adjustments on our PIX/ASA to allow Internet access.
First of all, since our network is running with private IPs, we need NAT to be configured. In this case PAT (port address translation) is the better term.

Assuming that our ISP offered us the network 192.168.33.0 255.255.255.240 and his router got the IP 192.168.33.1 we have left the IP range 192.168.33.2-192.168.33.14 for our use.

We will use the IP address 192.168.33.3 for the PAT configuration that should be enough for a while. Second step is to configure what source IP addresses will be NATed. Since this is the central breakout point the answer is obvious every IP!


global (IF_Outside) 1 192.168.33.3
nat (IF_Inside) 1 0.0.0.0 0.0.0.0
! translate every IP on the inside Interface into
! the public IP + specific port


Since we've not configured the ISP router we check if NAT is correct configured by using show nat
This should return something like:

show nat

NAT policies on Interface IF_Inside:
match ip IF_Inside any IF_Outside any
dynamic translation to pool 1 (192.168.33.3)


All done now! You should have a running network from where we can go ahead.

Network Diagramm:


Attached you can find the configuration of our Routers and PIX
LINK: R_Inner_Core
LINK: R_Outer_Core_1
LINK: R_Outer_Core_2
LINK: FW-GW-1


More to come in a few days, feel free to post corrections, suggestions and of course questions.

Cheers NWG

Donnerstag, 2. April 2009

DE - VPN Netzwerk mit OSPF auf PIX/ ASA und Routern (Task 2)

Gut weiter geht´s mit den Aufgaben. Nachdem ich mir Aufgabe 1 noch einmal angesehen habe, habe ich entschieden die mir selbst auferlegten Aufgaben etwas anders zu bearbeiten. Die Aufgabe 1 enthält, so denke ich, viele Informationen die hilfreich sein können, aber Aufgrund der Fülle nicht einfach zu erfassen sind. Daher will ich weitere Aufgaben in kleinere Teilaufgaben untergliedern um das Lesen, Verstehen und ggf. auch wiederfinden einfacher zu machen.

Wie soll also Aufgabe 2 aufgeteilt werden

Task 2.1 Nachbau des Kundennetzwerk
Grundlegende OSPF Konfiguration auf Cisco Routern und PIX /ASA

Task 2.2 Hinzufügen von Sicherheitsfeatures und Einbau der VPN Router

Aktiveren der MD5 Authentifizierung für OSPF auf den Routern und der PIX/ASA
Hinzufügen der neuen VPN Edge Router zum OSPF Netzwerk

Task 2.3 Erstellen der ISP Router
Erstellen von 3 ISP Routern mit OSPF als Routing Protokoll
(nichts besonderes halt)

Task 2.4 Konfigurieren von HSRP auf den VPN Routern
Grundlegende HSRP Konfiguration auf Routern implementieren

Task 2.5 Aktivieren der VPN Verbindung für Clients auf den VPN Routern

Task 2.6 Hinzufügen von Site 2 Site VPN Funktionalität
Einrichten von Site 2 Site VPNs zwischen Router und Router sowie Router
und PIX/ASA

Task 2.7 Hinzufügen von NEM Hardware Clients
Hinzufügen von PIX/ASA als NEM Client
Einrichten von Routern als NEM Client

Task 2.8 Volle Redundanz
Aktivieren von SSO auf den Routern

Innerhalb der nächsten Tage will ich Stück für Stück die Lösungen der Teilaufgaben posten. Aber jetzt will ich erst mal das Netz etwas näher erklären



Das ist grundlegend das Netzwerk des Kunden (ja es handelt sich um ein Kunden Netzwerk). Das Netzwerk ist unterteilt in Inner Core Routing, Outer Core Routing und Edge Netzwerk. Inner und Outer Core Routing Netzwerk sind grundlegend identisch und bestehen aus mehreren Routern die OSPF als routing Protokoll verwenden. In Zukunft sollen diese Bereiche stärker getrennt werden aber das ist Zukunftsplanung und hier uninteressant. Der Edge Bereich enthält alle Netzwerk Geräte die Verbindung zum Internet haben. Im Edge Netzwerk steht Initial nur eine Firewall, ähnlich wie viele der Router handelt es sich nicht um ein Cisco Produkt aber das ignorieren wir im Interesse der Aufgabe einfach mal und setzen eine PIX/ ASA ein.



Im zweiten Diagramm sieht man die zwei neuen VPN Router wie sie ins Netzwerk eingebracht werden sollen. Ebenso die 3 ISP Router an die die VPN Router angeschlossen werden.

Wie immer gilt, wenn es Fragen gibt einfach in die Kommentare schreiben.

Cheers
NWG

EN - VPN network with OSPF on PIX/ ASA and routers (Task 2)

OK I´ve changed the way how I will handle the answering of the tasks. The problem is that Task 1 was (at least I think) informative but it was also quite a lot to read. So I´ll split up the solutions to my self created tasks into smaller chunks, thus will make it easier to read, understand and find (if you search for the problem).

So how will task 2 be divided?

Task 2.1 Recreating the customers network
Basic OSPF configuration on routers and PIX/ASA

Task 2.2 Adding security features and VPN endpoint routers
Enabling OSPF MD5 Authentication on PIX/ASA and Routers
Adding new VPN edge routers to the OSPF Network

Task 2.3 Creating ISP Access
Basic OSPF Configuration between 3 ISPs (nothing fancy)

Task 2.4 Creating HSRP on the VPN endpoint routers
Basic HSRP Configuration on the two VPN routers

Task 2.5 Adding VPN Support for VPN Clients
Creating VPN access on VPN Edge routers

Task 2.6 Adding Site 2 Site VPN
Creating Site2Site VPN between routers and PIX/ASA

Task 2.7 Adding network extension mode Clients (NEM)
Creating VPN hardware clients (Routers and PIX/ASA)for NEM access

Task 2.8 Full Redundancy
Enabling SSO on Routers

The next few days I´ll post solution step by step. But first some pictures to explain the network concept.



This is the basic network that I´ve found at the customer location. The routers of the inner core routing network are running OSPF with no security features enabled the routers are most times non Cisco products but since we focus on Cisco network devices we ignore this fact. ;)
The outer core routing network is nearly the same like the inner core routing network but in future the customer plans to divide those network parts more. (but this is future planing and not covered here). Last is the edge network, this part contains network devices that connect to the Internet. In this scenario the primary edge is a ASA/ PIX but in the customer scenario there is an other firewall device in place (but this fact is ignored to ;) )



Here you can see the planed next stage, where two VPN routers are placed in the edge network. These routers are connected to two independent ISPs routers for redundancy issues.

As always if you got questions just drop a not into the comments.
More to come.

Cheers NWG

Sonntag, 29. März 2009

DE- ASA Passwort Wiederherstellung – Hinweis

Wenn man mal in die Verlegenheit kommt und auf einer ASA die Passwortwiederherstellungsprozedur durchführen zu müssen wie auf der Cisco Seite beschrieben, (Passwort Recovery Guide) kann es zu merkwürdigen Symptomen kommen. Ich habe Gestern eine ganze Weile damit zugebracht herauszufinden warum auf einer Kunden ASA das PPPOE plötzlich nicht mehr ging. Nach einiger Zeit und der Tatsache das ein Debug auf PPPOE gar nichts brachte, konnte ich heraus finden das das Register der ASA nicht passte. Es zeigte sich dann, dass das zurücksetzen des Konfigurationsregisters zusammen mit einem Neustart das Problem restlos löste. Ergo hing die ASA die ganze Zeit im Passwortwiederherstellungsprozess. Interessanterweise funktionierte der Rest der aktivierten ASA Features wie gewohnt.

Cheers NWG

EN - ASA Password recovery - something to note

If you are doing ASA password recovery like it is discribed on CISCO.com
(Recovery procedure link)
One thing you might notice that some functions are not working as expected. Well the „disable system configuration?“ question has to be answerd with „Yes“ so sure nothing should realy work.
Yesterday I spend quite a lot of time till I recognised that the ASA was nearly working except for the PPPOE part. A debug on pppoe showed ..well nothing. After some time I figured that the customer did not switch the configuration register back to the defaults and did not do a reload, so we were still hanging in the password recovery process. Switching back the configuration register, reloading and hurray the ASA was back up online. Interesstingly the rest of the activated features worked like a charm.

Cheers NWG

Mittwoch, 25. März 2009

ENG – Task 2 VPN Networks

Task 2
Add two routers to an existing OSPF Network.
Terminate several VPN types on this routers and try to implement high availibilty.

Tools
GNS3
existing network core:
- 3x 3660 IOS 12.3.26

VPN edge routers:
- 2x 3725 IOS 12.4.15T8

ISP Routers:
- 3x 2691 IOS 12.4.15T7

VPN Devices:
- 2x PIX 7.2.4
- 2x 2610 12.4.15T7
- 1x Cisco VPN client 5.0.x

DE - Aufgabe 2 - VPN Netzwerke

Aufgabe 2
Anbinden zweier Router an ein bestehendes OSPF - Netz.
Terminierung dieverser VPN Arten auf den Routern moeglichst ausfallsicher.

Tools

GNS3
Bestehender Netzwerk Kern:
- 3x 3660 IOS 12.3.26

VPN Perimeterrouter:
- 2x 3725 IOS 12.4.15T8

ISP Router:
- 3x 2691 IOS 12.4.15T7

VPN Endpunkte:
- 2x PIX 7.2.4
- 2x 2610 12.4.15T7
- 1x Cisco VPN client 5.0.x

Donnerstag, 19. März 2009

ENG - Hub-Spoke Configuration PIX/ASA - Task 1

Finlay I've had the time to write this blog entry. As you may have noticed I´ve done the post in German some days ago, no big deal since it is my mother tong.

But back to the problem: creating a Hub Spoke VPN topology between 3 Cisco PIX. Where the two spoke PIX can send packets to each other

At first a small break for theory.

VPN networks are commonly divided into two topology schemes The first is Hub Spoke the other Full Mesh.
Hub Spoke is somehow easier to manage, because all you have to do is make sure that your remote location can connect to the central side. Everything else can be configured at the central location.

Full Mesh offers more redundancy and you don´t have to fear that your network is completely down if your central side is off-line In comparison to Hub Spoke Full mesh is harder to administrate

In larger enterprises you often find both schemes together, Full Mesh connecting the country offices and hub spoke for the regional offices connecting to the country headquarters

Now lets get started with solution to task 1
Setting:


Used networks
192.168.1.0 /24 - LAN main site ; routing via default route
192.168.2.0 /24 – LAN at customer 1 location 1 (Cust_1); routing via default route
192.168.3.0 /24 – LAN at customer 2 location (Cust_2); routing via default route
10.10.1.x /30 transfer network between ISP router and ASA/PIX; routing via default route
10.10.98.x /30 transfer networks between ISP routers, routing via OSPF
10.10.99.x /32 Management IP of the ISP Router; added to OSPF routing

Used tools, router and software versions
configuration and simulation using GNS3 + dynamips + PEMU
3x router 7200 (IOS 12.4.24T) as ISP router
3x router 1700 (IOS 12.3.26) as LAN hosts
3x PIX 525 (ASA/PIX 8.0.3) as Firewall and VPN endpoints

Step by step solution:
Configuration of the ISP zone
Interface creation at the routers:


device: ISP_Main
interface Loopback0
description ### MGMT INT ###
ip address 10.10.99.1 255.255.255.255
interface FastEthernet0/0
description ### FW_Main-e0 ###
ip address 10.10.1.1 255.255.255.252
duplex auto
speed auto
interface FastEthernet0/1
description ### Uplink ISP-Cust-2_f0/1 ###
ip address 10.10.98.5 255.255.255.252
duplex auto
speed auto
interface FastEthernet1/0
description ### Uplink ISP-Cust-1_f1/0 ###
ip address 10.10.98.1 255.255.255.252
duplex full
speed auto

device: ISP_Cust_1
interface Loopback0
description ### MGMT INT ###
ip address 10.10.99.3 255.255.255.255
interface FastEthernet0/0
description ### FW_Cust_1-e0 ###
ip address 10.10.1.5 255.255.255.252
duplex full
speed auto
interface FastEthernet0/1
description ### Uplink to ISP_Cust_2-f1/0 ###
ip address 10.10.98.10 255.255.255.252
duplex full
speed auto
interface FastEthernet1/0
description ### Uplink to ISP_Main-f1/0 ###
ip address 10.10.98.2 255.255.255.252
duplex full
speed auto

device: ISP_Cust_2
interface Loopback0
description ### MGMT INT ###
ip address 10.10.99.2 255.255.255.255
interface FastEthernet0/0
description ### FW-cust-2-e0 ###
ip address 10.10.1.9 255.255.255.252
duplex full
speed auto
interface FastEthernet0/1
description ### Uplink ISP_Main-f0/1 ###
ip address 10.10.98.6 255.255.255.252
duplex full
speed auto
interface FastEthernet1/0
description ### Uplink ISP_Cust_1-f0/1 ###
ip address 10.10.98.9 255.255.255.252
duplex full
speed auto


Configuration of OSPF
The task is easy but for the 3 internet routers I decided to work with a dynamic routing protocol OSPF
Using the command router ospf [prozess ID] will enable OSPF in your routers. The network statements define the networks that will be redistributed into OSPF.

device: ISP_Main
router ospf 100
router-id 10.10.99.1
log-adjacency-changes
network 10.10.1.0 0.0.0.3 area 0
network 10.10.98.0 0.0.0.3 area 0
network 10.10.98.4 0.0.0.3 area 0
network 10.10.99.1 0.0.0.0 area 0

device: ISP_Cust_1
router ospf 100
router-id 10.99.99.2
log-adjacency-changes
network 10.10.1.4 0.0.0.3 area 0
network 10.10.98.0 0.0.0.3 area 0
network 10.10.98.8 0.0.0.3 area 0
network 10.10.99.3 0.0.0.0 area 0

device: ISP_Cust_2
router ospf 100
router-id 10.99.99.3
log-adjacency-changes
network 10.10.1.8 0.0.0.3 area 0
network 10.10.98.4 0.0.0.3 area 0
network 10.10.98.8 0.0.0.3 area 0
network 10.10.99.2 0.0.0.0 area 0

The main configuration tasks are now done. Just do a quick ping from the router to the other routers
will ensure that the "Internet" works

Note:
I just wanted to use 12.4.24T and did get more trouble than necessary I´ve had to reconfigure quite a lot of times the IDLEPC value in Dynamips so that they do not consume all my CPU capacity. 3724 Router would have done the job running 12.4.15T8. This will be a lesson for me.

Configuration of the „Hosts“
Create an IP on the connected Interface and configure a default route to the Firewall. Nothing more to do here.

device: Host_Main
interface FastEthernet0
ip address 192.168.1.2 255.255.255.0
speed auto
ip route 0.0.0.0 0.0.0.0 192.168.1.1

device: Host_Cust_1
interface FastEthernet0
ip address 192.168.2.2 255.255.255.0
speed auto
ip route 0.0.0.0 0.0.0.0 192.168.2.1

device: Host_Cust_2
interface FastEthernet0
ip address 192.168.3.2 255.255.255.0
speed auto
ip route 0.0.0.0 0.0.0.0 192.168.3.1

The configuration of this Hosts was done quick and after no shutdown was issued on all Interfaces they could be pinged from the PIX.

Configuration of the PIX
Basics


In the first step basic configuration on every ASA/PIX have been made. This means Interfaces, default routes to the ISPs and object groups.

device: FW_Main
interface Ethernet0
nameif IF_Outside
security-level 0
ip address 10.10.1.2 255.255.255.252

interface Ethernet1
nameif IF_Inside
security-level 100
ip address 192.168.1.1 255.255.255.0

route IF_Outside 0.0.0.0 0.0.0.0 10.10.1.1 1


device: FW-Cust-1
interface Ethernet0
nameif IF_Outside
security-level 0
ip address 10.10.1.6 255.255.255.252

interface Ethernet1
nameif IF_Inside
security-level 100
ip address 192.168.2.1 255.255.255.0

route IF_Outside 0.0.0.0 0.0.0.0 10.10.1.5 1


device: FW-Cust-2
interface Ethernet0
nameif IF_Outside
security-level 0
ip address 10.10.1.10 255.255.255.252

interface Ethernet1
nameif IF_Inside
security-level 100
ip address 192.168.3.1 255.255.255.0

route IF_Outside 0.0.0.0 0.0.0.0 10.10.1.9 1

All object groups are the same on all firewalls.
device: FW-Main / FW-Cust-1 /FW-Cust-2
object-group network OBJ_VPN_Main
network-object 192.168.1.0 255.255.255.0
object-group network OBJ_VPN_Customer_1
network-object 192.168.2.0 255.255.255.0
object-group network OBJ_VPN_Customer_2
network-object 192.168.3.0 255.255.255.0
object-group network OBJ_VPN_Customer
group-object OBJ_VPN_Customer_1
group-object OBJ_VPN_Customer_2


Site 2 Site VPNs have 3 characteristics that have to be configured

1. Crypto ACLs that define what traffic has to be encrypted
2. Tunnel groups that characterize the tunnel
3. ISAKMP and IPSEC parameters to build the tunnel.

Crypto ACLs are somehow every time the same. Allow traffic from local network A to remote network B.
The only thing to remember is that you have to apply a exact mirror on the other side of your VPN connection.
So this nearly automatically leads to the following crypto ACLs.

device: FW-Main
access-list ACL_Cry_map_10 remark ### traffic for VPN to Customer 1 ###
access-list ACL_Cry_map_10 extended permit ip object-group OBJ_VPN_Main object-group OBJ_VPN_Customer_1
access-list ACL_Cry_map_10 extended permit ip object-group OBJ_VPN_Customer_2 object-group OBJ_VPN_Customer_1
access-list ACL_Cry_map_20 remark ### traffic for VPN to Customer 2 ###
access-list ACL_Cry_map_20 extended permit ip object-group OBJ_VPN_Main object-group OBJ_VPN_Customer_2
access-list ACL_Cry_map_20 extended permit ip object-group OBJ_VPN_Customer_1 object-group OBJ_VPN_Customer_2

device: FW-Cust-1
access-list ACL_Cry_map_10 remark ### traffic for VPN to Main Location ###
access-list ACL_Cry_map_10 extended permit ip object-group OBJ_VPN_Customer_1 object-group OBJ_VPN_Main
access-list ACL_Cry_map_10 extended permit ip object-group OBJ_VPN_Customer_1 object-group OBJ_VPN_Customer_2

device: FW-Cust-2
access-list ACL_Cry_map_10 remark ### traffic for VPN to Main Location ###
access-list ACL_Cry_map_10 extended permit ip object-group OBJ_VPN_Customer_2 object-group OBJ_VPN_Main
access-list ACL_Cry_map_10 extended permit ip object-group OBJ_VPN_Customer_2 object-group OBJ_VPN_Customer_1

So far the traffic that has to be encrypted is defined. Now the tunnel has to be specified
Together with several parameters the pre shared key is configured using the tunnel group.
If you use PSK you should use of course long and complex keys and change them from time to time.
Certificates may be an alternative for other scenarios but this will be covered in later tasks

For site 2 site VPNs usually the IP Address of the remote endpoint is the name of the tunnel group.

device: FW-Main
! Tunnel Group for FW-Cust-1
tunnel-group 10.10.1.6 type ipsec-l2l
tunnel-group 10.10.1.6 ipsec-attributes
pre-shared-key 1234567890
! Tunnel Group for FW-Cust-2
tunnel-group 10.10.1.10 type ipsec-l2l
tunnel-group 10.10.1.10 ipsec-attributes
pre-shared-key 0987654321

device: FW-Cust-1
! Tunnel Group for FW-Main
tunnel-group 10.10.1.2 type ipsec-l2l
tunnel-group 10.10.1.2 ipsec-attributes
pre-shared-key 1234567890

device: FW-Cust-2
! Tunnel Group for FW-Main
tunnel-group 10.10.1.2 type ipsec-l2l
tunnel-group 10.10.1.2 ipsec-attributes
pre-shared-key 0987654321

The last and biggest configuration block is for the ISAKMP and IPsec parameters and of course the matching between ISAKMP / IPSec parameters, the tunnel group and the ACLs.

device: FW-Main/ FW-Cust-1 / FW-Cust-2
crypto isakmp enable IF_Outside
crypto isakmp policy 100
authentication pre-share
encryption aes-256
hash sha
group 2
lifetime 86400

Creating the IPSec transform Sets

device: FW-Main/ FW-Cust-1 / FW-Cust-2
crypto ipsec transform-set TRANS_1 esp-aes-256 esp-sha-hmac

Defining the crypto map to match the parameters with each other. It is only possible to match one Crypto map on a logical interface, but every crypto map offers enough space for 65534 static connections

device: FW-Main
crypto map MAP_Outside 10 match address ACL_Cry_map_10
crypto map MAP_Outside 10 set peer 10.10.1.6
crypto map MAP_Outside 10 set transform-set TRANS_1
crypto map MAP_Outside 20 match address ACL_Cry_map_20
crypto map MAP_Outside 20 set peer 10.10.1.10
crypto map MAP_Outside 20 set transform-set TRANS_1
crypto map MAP_Outside interface IF_Outside

device: FW-Cust-1
crypto ipsec transform-set TRANS_1 esp-aes-256 esp-sha-hmac
crypto map MAP_Outside 10 match address ACL_Cry_map_10
crypto map MAP_Outside 10 set peer 10.10.1.2
crypto map MAP_Outside 10 set transform-set TRANS_1
crypto map MAP_Outside interface IF_Outside
crypto isakmp enable IF_Outside

device: FW-Cust-2
crypto map MAP_Outside 10 match address ACL_Cry_map_10
crypto map MAP_Outside 10 set peer 10.10.1.2
crypto map MAP_Outside 10 set transform-set TRANS_1
crypto map MAP_Outside interface IF_Outside
crypto isakmp enable IF_Outside

Basically the VPN tunnels are now ready to do their job. Often NAT is configured on the firewall and even more often this fact is forgotten, so that the tunnel will not work.
That is why the in this task is NAT zero configured.

device: FW-Main
access-list ACL_NAT_0 remark ### Nat ZERO ###
access-list ACL_NAT_0 extended permit ip object-group OBJ_VPN_Main object-group OBJ_VPN_Customer
access-list ACL_NAT_0 extended permit ip object-group OBJ_VPN_Customer_2 object-group OBJ_VPN_Customer_1
access-list ACL_NAT_0 extended permit ip object-group OBJ_VPN_Customer_1 object-group OBJ_VPN_Customer_2
nat (IF_Outside) 0 access-list ACL_Nat_0

device: FW-Cust-1
access-list ACL_NAT_0 remark ### Nat ZERO ###
access-list ACL_Nat_0 extended permit ip object-group OBJ_VPN_Customer_1 object-group OBJ_VPN_Main
access-list ACL_Nat_0 extended permit ip object-group OBJ_VPN_Customer_1 object-group OBJ_VPN_Customer_2
nat (IF_Outside) 0 access-list ACL_Nat_0

device: FW-Cust-2
access-list ACL_NAT_0 remark ### Nat ZERO ###
access-list ACL_Nat_0 extended permit ip object-group OBJ_VPN_Customer_2 object-group OBJ_VPN_Customer_1
access-list ACL_Nat_0 extended permit ip object-group OBJ_VPN_Customer_2 object-group OBJ_VPN_Main
nat (IF_Outside) 0 access-list ACL_Nat_0

Last but not least we have to enable that traffic can flow from one VPN tunnel to the other. This is by default not possible. Why VPN tunnel have the same security level and by design traffic within the same level is not allowed. Solution, enable

device: FW-Main
same-security-traffic permit intra-interface

If everything works as expected we should now be able to ping from any host to the other hosts





The ASA and PIX will now show a MM_Actif if you run show crypto isakmp sa

Feel free to comment, ask question or give feedback (corrections).
cheers NWG

Samstag, 14. März 2009

DE - Hub-Spoke Konfiguration Pix /ASA - Task 1

Endlich ist es geschafft und vor allem beschrieben. Also jetzt zur Frage Task 1 wie konfiguriere ich 2 Pixen so das sie mit der Zentralen Pix kommunizieren können und auch untereinander Daten verschicken können.

Ein bisschen was zu Theorie aber vorab.
Im VPN Netzwerken (nicht nur dort) kann man grundsätzlich zwischen zwei Topologie unterscheiden. Zum Einen Hub-Spoke und zum Anderen Full-Mesh Netzen.
Hub Spoke Netze sind Zentral ausgerichtet. Alle Remotestandorte verbinden sich zu einer Zentrale und über diese findet auch die Kommunikation zwischen den Remotestandorten statt. Administrativ ist die Konfiguration vermeintlich sehr elegant, da der Administrator sich nur an einer Stelle Gedanken machen muss, wer worauf zugreifen darf. In den Remotestandorten muss nur sicherstellen werden das die Zentrale erreicht wird. Fällt die Zentrale oder die Verbindung dorthin aus, ist das Datentechnisch der Super GAU – der Ausdruck „Nichts geht mehr“ trifft es so ziemlich genau.

Im Gegensatz dazu sind Full-Mesh Netzwerke ausfallsicher. Es gibt keine klare Zentrale und jeder Teilnehmer ist, an sich, mit jedem anderen vernetzt. Dies ermöglicht eine große Flexibilität falls einmal eine Lokation nicht erreichbar ist, sorgt aber im schlimmsten Fall auch für einen enormen administrativen Zusatzaufwand, da die Verbindungen konfiguriert, gemonitort und auch „gepflegt“ werden müssen.

Oft findet man in großen Organisationen eine Mischform aus beiden Konzepten. So sind oft bei einer Firma die Landesfilialen untereinander mittels Full-Mesh Konzept verbunden, die Regionalbüros aber dann wiederum mittels Hub-Spoke Topologie an die Landesfiliale angebunden.

Aber zurück zur Aufgabe
Testaufbau:


Verwendete Netzwerke:
192.168.1.0 /24 - LAN in der Zentrale (Main); Routing via Default Route
192.168.2.0 /24 – LAN bei Kunden 1 (Cust_1); Routing via Default Route
192.168.3.0 /24 – LAN bei Kunden 2 (Cust_2); Routing via Default Route
10.10.1.x /30 Verbindungsnetze zwischen ISP Router und PIX/ASA ; Routing via Default Route
10.10.98.x /30 Verbindungsnetze zwischen den ISP Routern, Routing via OSPF
10.10.99.x /32 Management IP der ISP Router; in OSPF Routing eingebunden

Verwendete Tools, Router, Software Versionen
Konfiguration und Simulation GNS3 + Dynamips + Pemu
3x Router 7200 (IOS 12.4.24T) als ISP Router
3x Router 1700 (IOS 12.3.26) als LAN Hosts
3x PIX 525 (ASA/PIX 8.0.3) als Firewall und VPN Endpunkt

Schritt für Schritt Lösung der Aufgabe:

Konfiguration der ISP Zone
Anlegen der Interface auf den Routern:


Gerät: ISP_Main
interface Loopback0
description ### MGMT INT ###
ip address 10.10.99.1 255.255.255.255
interface FastEthernet0/0
description ### FW_Main-e0 ###
ip address 10.10.1.1 255.255.255.252
duplex auto
speed auto
interface FastEthernet0/1
description ### Uplink ISP-Cust-2_f0/1 ###
ip address 10.10.98.5 255.255.255.252
duplex auto
speed auto
interface FastEthernet1/0
description ### Uplink ISP-Cust-1_f1/0 ###
ip address 10.10.98.1 255.255.255.252
duplex full
speed auto

Gerät: ISP_Cust_1
interface Loopback0
description ### MGMT INT ###
ip address 10.10.99.3 255.255.255.255
interface FastEthernet0/0
description ### FW_Cust_1-e0 ###
ip address 10.10.1.5 255.255.255.252
duplex full
speed auto
interface FastEthernet0/1
description ### Uplink to ISP_Cust_2-f1/0 ###
ip address 10.10.98.10 255.255.255.252
duplex full
speed auto
interface FastEthernet1/0
description ### Uplink to ISP_Main-f1/0 ###
ip address 10.10.98.2 255.255.255.252
duplex full
speed auto

Gerät: ISP_Cust_2
interface Loopback0
description ### MGMT INT ###
ip address 10.10.99.2 255.255.255.255
interface FastEthernet0/0
description ### FW-cust-2-e0 ###
ip address 10.10.1.9 255.255.255.252
duplex full
speed auto
interface FastEthernet0/1
description ### Uplink ISP_Main-f0/1 ###
ip address 10.10.98.6 255.255.255.252
duplex full
speed auto
interface FastEthernet1/0
description ### Uplink ISP_Cust_1-f0/1 ###
ip address 10.10.98.9 255.255.255.252
duplex full
speed auto


Konfiguration des OSPF auf den Routern
Auf wenn die Aufgabe einfach ist, wird für die drei Internet Router ein Routing Protokoll in der einfachsten Form implementiert.
Mit dem Befehl router ospf [Prozess ID] wird auf dem Router das OSPF Protokoll aktiviert. Die network Statements definieren die Netze die im Routing verteilt werden sollen. In diesem Fall werden alle Netze nur im Area 0 des OSPF Netzwerks bekannt gegeben.

Gerät: ISP_Main
router ospf 100
router-id 10.10.99.1
log-adjacency-changes
network 10.10.1.0 0.0.0.3 area 0
network 10.10.98.0 0.0.0.3 area 0
network 10.10.98.4 0.0.0.3 area 0
network 10.10.99.1 0.0.0.0 area 0

Gerät: ISP_Cust_1
router ospf 100
router-id 10.99.99.2
log-adjacency-changes
network 10.10.1.4 0.0.0.3 area 0
network 10.10.98.0 0.0.0.3 area 0
network 10.10.98.8 0.0.0.3 area 0
network 10.10.99.3 0.0.0.0 area 0

Gerät: ISP_Cust_2
router ospf 100
router-id 10.99.99.3
log-adjacency-changes
network 10.10.1.8 0.0.0.3 area 0
network 10.10.98.4 0.0.0.3 area 0
network 10.10.98.8 0.0.0.3 area 0
network 10.10.99.2 0.0.0.0 area 0

Die Kernaufgaben auf den Routern sind damit abgeschlossen. Ein kurzes pingen der einzelnen Interfaces von jedem Router aus, ergab das das „Internet“ funktioniert.

Anmerkungen:
Ich wollte unbedingt 12.4.24T einsetzen, und habe mir damit mehr Ärger als nötig eingehandelt, da die 72er Router regelmäßig nachdem sie konfiguriert wurden, mussten ihren IDLEPC Werte im Dynamips angepasst werden. 37er hätten es wohl auch getan und dann 12.4.15T8.

Konfiguration der LAN „Hosts“
Einrichten einer IP auf dem angeschlossenen Interface und setzen einer statischen Default Router in Richtung der PIX war alles was hier zu konfigurieren war.

Gerät: Host_Main
interface FastEthernet0
ip address 192.168.1.2 255.255.255.0
speed auto
ip route 0.0.0.0 0.0.0.0 192.168.1.1

Gerät: Host_Cust_1
interface FastEthernet0
ip address 192.168.2.2 255.255.255.0
speed auto
ip route 0.0.0.0 0.0.0.0 192.168.2.1

Gerät: Host_Cust_2
interface FastEthernet0
ip address 192.168.3.2 255.255.255.0
speed auto
ip route 0.0.0.0 0.0.0.0 192.168.3.1

Die Hosts waren schnell erledigt und nachdem ein no shutdown auf allen Interfaces gesetzt war, konnte man sie auch von den PIXen nach deren Konfiguration erreichen.

Konfiguration der PIX
Grundlagen


Als erstes wurden die Dinge, die es auf jeder PIX/ ASA gibt konfiguriert. Also in dem Fall die Interfaces, die (default) Routen zu den ISPs und die Optionalen Objekt Gruppen.

Gerät: FW_Main
interface Ethernet0
nameif IF_Outside
security-level 0
ip address 10.10.1.2 255.255.255.252

interface Ethernet1
nameif IF_Inside
security-level 100
ip address 192.168.1.1 255.255.255.0

route IF_Outside 0.0.0.0 0.0.0.0 10.10.1.1 1


Gerät: FW-Cust-1
interface Ethernet0
nameif IF_Outside
security-level 0
ip address 10.10.1.6 255.255.255.252

interface Ethernet1
nameif IF_Inside
security-level 100
ip address 192.168.2.1 255.255.255.0

route IF_Outside 0.0.0.0 0.0.0.0 10.10.1.5 1


Gerät: FW-Cust-2
interface Ethernet0
nameif IF_Outside
security-level 0
ip address 10.10.1.10 255.255.255.252

interface Ethernet1
nameif IF_Inside
security-level 100
ip address 192.168.3.1 255.255.255.0

route IF_Outside 0.0.0.0 0.0.0.0 10.10.1.9 1

Die Objekt Gruppen sind auf allen drei PIXen identisch.

Geräte: FW-Main / FW-Cust-1 /FW-Cust-2
object-group network OBJ_VPN_Main
network-object 192.168.1.0 255.255.255.0
object-group network OBJ_VPN_Customer_1
network-object 192.168.2.0 255.255.255.0
object-group network OBJ_VPN_Customer_2
network-object 192.168.3.0 255.255.255.0
object-group network OBJ_VPN_Customer
group-object OBJ_VPN_Customer_1
group-object OBJ_VPN_Customer_2

Die definierten Objekt Gruppen werden vor allem in ACLs eingesetzt, da man dann die ACLs bereits durch das ändern der Objekt Definition anpassen kann.


Site 2 Site VPNs zeichnen sich durch 3 Punkte aus, die zwingend in der Konfiguration vorhanden sein müssen.

1. ACLs die den zu verschlüsselnden Traffice definieren
2. Eine Tunnelgruppe die den Tunnel charakterisiert
3. den ISAKMP und IPSEC Parametern um den Tunnel aufzubauen

Die ACLs die die Tunnel definieren sind im Grunde genommen immer gleich. Erlaube Traffic von IP oder Netz A nach IP oder Netz B im Remote-Standort. Dabei ist nur zu beachten das die ACL gespiegelt auf dem anderen Teilnehmer zur Anwendung kommt.
So ergibt sich für die Crypto ACLs folgender Inhalt:

Gerät: FW-Main
access-list ACL_Cry_map_10 remark ### traffic for VPN to Customer 1 ###
! Folgende Zeile erlaubt: Traffic von der Zentralen Main Seite zum Netz im Standort Cust_1
access-list ACL_Cry_map_10 extended permit ip object-group OBJ_VPN_Main object-group OBJ_VPN_Customer_1
! Folgende Zeile erlaubt: Traffic vom LAN Cust_2 zum LAN Cust_1
access-list ACL_Cry_map_10 extended permit ip object-group OBJ_VPN_Customer_2 object-group OBJ_VPN_Customer_1
access-list ACL_Cry_map_20 remark ### traffic for VPN to Customer 2 ###
! Folgende Zeile erlaubt: Traffic aus dem Main LAN zum Netz Standort Cust_2
access-list ACL_Cry_map_20 extended permit ip object-group OBJ_VPN_Main object-group OBJ_VPN_Customer_2
! Folgende Zeile erlaubt: Traffic vom LAN Cust_2 zum LAN Cust_1
access-list ACL_Cry_map_20 extended permit ip object-group OBJ_VPN_Customer_1 object-group OBJ_VPN_Customer_2

Gerät: FW-Cust-1
access-list ACL_Cry_map_10 remark ### traffic for VPN to Main Location ###
! Folgende Zeile erlaubt: Traffic vom LAN Cust_1 zum Main_LAN
access-list ACL_Cry_map_10 extended permit ip object-group OBJ_VPN_Customer_1 object-group OBJ_VPN_Main
! Folgende Zeile erlaubt: Traffic vom LAN Cust_1 zum LAN Cust_2
access-list ACL_Cry_map_10 extended permit ip object-group OBJ_VPN_Customer_1 object-group OBJ_VPN_Customer_2

Gerät: FW-Cust-2
access-list ACL_Cry_map_10 remark ### traffic for VPN to Main Location ###
! Folgende Zeile erlaubt: Traffic vom LAN Cust_2 zum Main LAN
access-list ACL_Cry_map_10 extended permit ip object-group OBJ_VPN_Customer_2 object-group OBJ_VPN_Main
! Folgende Zeile erlaubt: Traffic vom LAN Cust_2 zum LAN Cust_1
access-list ACL_Cry_map_10 extended permit ip object-group OBJ_VPN_Customer_2 object-group OBJ_VPN_Customer_1

Somit wäre definiert, welcher Traffic zu verschlüsseln ist. Jetzt muss Der Tunnel genauer definiert werden. Neben diversen Parametern lässt sich vor allem in der Tunnelgruppe der Pre Shared Key bestimmen. Setzt man PSK ein sollte dieser möglichst Lang und Komplex sein und von Zeit zur Zeit geändert werden. Alternativ lassen sich Zertifikate verwenden. Der Einfachheit der Aufgabe aber ist das hier außen vor.
Für Site 2 Site VPNs werden in der Regel als Tunnelbezeichnung die IP Adresse der entfernten Seite der VPN Verbindung verwendet.

Gerät: FW-Main
! Tunnel Gruppe zur FW-Cust-1
tunnel-group 10.10.1.6 type ipsec-l2l
tunnel-group 10.10.1.6 ipsec-attributes
pre-shared-key 1234567890
! Tunnel Gruppe zur FW-Cust-2
tunnel-group 10.10.1.10 type ipsec-l2l
tunnel-group 10.10.1.10 ipsec-attributes
pre-shared-key 0987654321

Gerät: FW-Cust-1
! Tunnel Gruppe zur FW-Main
tunnel-group 10.10.1.2 type ipsec-l2l
tunnel-group 10.10.1.2 ipsec-attributes
pre-shared-key 1234567890

Gerät: FW-Cust-2
! Tunnel Gruppe zur FW-Main
tunnel-group 10.10.1.2 type ipsec-l2l
tunnel-group 10.10.1.2 ipsec-attributes
pre-shared-key 0987654321

Als letzten und größten Block müssen die ISAKMP und IPSec Parameter der Tunnel festgelegt werden und natürlich ein Zuordnung zwischen ISAKMP/ IPSec Parametern, Tunnel Gruppe und ACLs erfolgen.

Geräte: FW-Main/ FW-Cust-1 / FW-Cust-2
! Definieren der ISAKMP Parameter auf allen 3 Firewall Geräten gleich
crypto isakmp enable IF_Outside
crypto isakmp policy 100
authentication pre-share
encryption aes-256
hash sha
group 2
lifetime 86400

Bestimmen des IPSec Transform Sets

Geräte: FW-Main/ FW-Cust-1 / FW-Cust-2
crypto ipsec transform-set TRANS_1 esp-aes-256 esp-sha-hmac

Definieren der Crypto Map um die Parameter miteinander zu verknüpfen. Die Auswahl erfolgt beim Verbindungsaufbau über den bereits definierten Traffic durch die ACL.
Es kann pro Logischem Interface nur eine Crypto map gebunden werden, aber jede Crypto map bietet theoretisch Platz für 65534 statische Verbindungen.

Gerät: FW-Main
crypto map MAP_Outside 10 match address ACL_Cry_map_10
crypto map MAP_Outside 10 set peer 10.10.1.6
crypto map MAP_Outside 10 set transform-set TRANS_1
crypto map MAP_Outside 20 match address ACL_Cry_map_20
crypto map MAP_Outside 20 set peer 10.10.1.10
crypto map MAP_Outside 20 set transform-set TRANS_1
! Binden der Crypto Map auf das Extern Interface
crypto map MAP_Outside interface IF_Outside

Gerät: FW-Cust-1
crypto ipsec transform-set TRANS_1 esp-aes-256 esp-sha-hmac
crypto map MAP_Outside 10 match address ACL_Cry_map_10
crypto map MAP_Outside 10 set peer 10.10.1.2
crypto map MAP_Outside 10 set transform-set TRANS_1
crypto map MAP_Outside interface IF_Outside
crypto isakmp enable IF_Outside

Gerät: FW-Cust-2
crypto map MAP_Outside 10 match address ACL_Cry_map_10
crypto map MAP_Outside 10 set peer 10.10.1.2
crypto map MAP_Outside 10 set transform-set TRANS_1
crypto map MAP_Outside interface IF_Outside
crypto isakmp enable IF_Outside

Grundlegend ist nun alle Bereit um als VPN Tunnel zu arbeiten. Oft wird jedoch vergessen das auf der PIX/ASA NAT definiert ist. Dann versucht die Firewall Aufgrund der NAT Regeln den Traffic im Tunnel zu NATen.
Daher wird im Beisiel noch NAT 0 mit zugehöriger ACL konfiguriert. NAT 0 bedeutet das der Traffic der auf diese ACL zutrifft vom generellen NAT Prozess ignoriert wird.
Wieder erfolgt die Konfiguration der ACLs nach dem Syntax Erlaube von Netz A nach Remote Netz B.

Gerät: FW-Main
access-list ACL_NAT_0 remark ### Nat ZERO ###
! Kein NAT für Verbindungen von Main Lan zu den Remote Standorten
access-list ACL_NAT_0 extended permit ip object-group OBJ_VPN_Main object-group OBJ_VPN_Customer
! Kein NAT für Verbindungen von Kundennetz 1 zu Kundennetz 1
access-list ACL_NAT_0 extended permit ip object-group OBJ_VPN_Customer_2 object-group OBJ_VPN_Customer_1
! Kein NAT für Verbindungen von Kundennetz 1 zu Kundennetz 2
access-list ACL_NAT_0 extended permit ip object-group OBJ_VPN_Customer_1 object-group OBJ_VPN_Customer_2
! aktivieren der Nat Aufnahme für Traffic der der ACL entspricht und über das Interface IF_Outside geht
nat (IF_Outside) 0 access-list ACL_Nat_0

Gerät: FW-Cust-1
access-list ACL_NAT_0 remark ### Nat ZERO ###
! Kein NAT für Verbindungen von Kundennetz 1 zum Main Netz
access-list ACL_Nat_0 extended permit ip object-group OBJ_VPN_Customer_1 object-group OBJ_VPN_Main
! Kein NAT für Verbindungen von Kundennetz 1 zu Kundennetz 2
access-list ACL_Nat_0 extended permit ip object-group OBJ_VPN_Customer_1 object-group OBJ_VPN_Customer_2
! aktivieren der Nat Aufnahme für Traffic der der ACL entspricht und über das Interface IF_Outside geht
nat (IF_Outside) 0 access-list ACL_Nat_0

Gerät: FW-Cust-2
access-list ACL_NAT_0 remark ### Nat ZERO ###
! Kein NAT für Verbindungen von Kundennetz 2 zum Kundennetz 1
access-list ACL_Nat_0 extended permit ip object-group OBJ_VPN_Customer_2 object-group OBJ_VPN_Customer_1
! Kein NAT für Verbindungen von Kundennetz 2 zum Main Netz
access-list ACL_Nat_0 extended permit ip object-group OBJ_VPN_Customer_2 object-group OBJ_VPN_Main
! aktivieren der Nat Aufnahme für Traffic der der ACL entspricht und über das Interface IF_Outside geht
nat (IF_Outside) 0 access-list ACL_Nat_0

Zu Guterletz muss eine Restriktion der ASA / PIX aufgegeben werden, damit die Remote Netzwerke sich gegenseitig sehen können. Grundsätzlich dürfen Interfaces mit gleichem Security Level keine Daten austauschen. Dies wird generell mit folgendem Befehl aufgehoben.
Gerät: FW-Main
same-security-traffic permit intra-interface

Wenn alles glatt gelaufen ist, sollten sich von allen Drei Hosts nun Pings zu den Remote Hosts absetzen lassen.





Auf den PIXen /ASA zeigt sich ein „wunderschönes“ MM_Active sobald man show crypto isakmp sa eingibt.


Für Anregungen ,Idee und so weiter(gern auch Fragen und Richtigstellungen) bin ich gern zu haben. Einfach in die Kommentare posten.


Links zu den Konfigs
ISP1
ISP2
ISP3
Host_Main
Host_Cust_1
Host_Cust_2
FW-Main
FW-Cust-1
FW-Cust-2