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

Montag, 14. Dezember 2009

DE - dynamisches Routeleanking oder "Inter VRF routing"

Dynamisches Route Leaking oder Routing Protokolle fürs Routing zwischen der globales Routingtabelle (GRT) und VRFs

Hallo zusammen,

das letzte mal gab es ein Beispiel, wie man statisch das Routing zwischen 2 VRFs einrichtet und dachte, daß es doch garnicht so schwer sein kann, dies auch dynamisch zu realisieren ... das war reichlich naiv ;)
Nach massig herumprobieren und mit dem Rat von ein paar anderen habe ich ein kleines Lab zusammengebaut, wo Routen zwischen der GRT und einem VRF dynamisch ausgetauscht werden.
Soweit ich es sagen kann, gibt es keine Möglichkeit Routen auf normalem Wege zu redistributen, wenn ein Routingprozess der globale ist. Wenn man es dennoch versucht, bekommt man eine kryptische Fehlermeldung wie diese:
VRF -> GRT [code]%OSPF process 1 is attached to Default-IP-Routing-Table[/code]
GRT -> VRF [code]OSPF process 22 already exists and is attached to Default-IP-Routing-Table[/code]

Dies müssen wir einfach "austricksen" und dafür brauchen wir einige Tunnelinterfaces und ein paar Loopbacks

So sieht mein Netzplan aus:


Der globale Client und der VRF_Client werden wieder durch missbrauchte Router dargestellt, die lediglich eine IP haben und eine Default Router auf das ausgehende Interface+Next Hop IP.

grt_host
[code]interface FastEthernet0/0
ip address 10.10.10.10 255.255.255.0
ip route 0.0.0.0 0.0.0.0 10.10.10.1 FastEthernet0/0[/code]

vrf_host
[code]interface FastEthernet0/1
ip address 20.20.20.20 255.255.255.0
ip route 0.0.0.0 0.0.0.0 20.20.20.1 FastEthernet0/1[/code]

Nun brauchen wir ein paar Grundkonfigurationen für den VRF Router:

ein vrf erstellen:
ip vrf zif
rd 1:1
route-target both 1:1


Interface config zum grt_host:
interface FastEthernet0/0
ip address 10.10.10.1 255.255.255.0
speed 100
full-duplex


Interface config zum vrf_host:
interface FastEthernet0/1
ip vrf forwarding zif
ip address 20.20.20.1 255.255.255.0
speed 100
full-duplex


Das alles ist kein Hexenwerk ... bis jetzt ;)

Das erste was wir uns überlegen müssen: wie tricksen wir die Grenzen des Designs aus?

Die erste Zutat sind "Tunnel-Interfaces", die andere sind "Loopbacks".

Unterm Strich brauchen wir:
ein Tunnel-Interface pro VRF,
ein Tunnel-Interface für die GRT
ein Loopback pro VRF und
ein Loopback für die GRT.

Wenn wir mehrere VRFs mit der GRT verknüpfen wollen, brauchen wir entsprechend der obigen Liste das gleiche nochmal pro zusätlichem VRF.

Beide Loopbacks werden in der GRT gelassen:
VRF Router
interface Loopback111
ip address 111.111.111.111 255.255.255.255

interface Loopback222
ip address 222.222.222.222 255.255.255.255


Jetzt brauchen wir die dazugehörigen Tunnel-Interfaces.
Das für die GRT:
interface Tunnel102
ip address 100.100.100.1 255.255.255.0
tunnel source 111.111.111.111
tunnel destination 222.222.222.222

Und das für das VRF:
interface Tunnel201
ip vrf forwarding RED
ip address 100.100.100.2 255.255.255.0
tunnel source 222.222.222.222
tunnel destination 111.111.111.111


Was macht dieses Konstrukt? Wir zeigen mit dem dem Tunnel 201 auf die Loopback in der GRT, mit der Quelle in der GRT und packen das ganze dann ins VRF. Hört sich nicht nur komisch an, es ist komisch (und "fühlt sich komisch an), ABER es funktioniert ;)

Jetzt haben wir schicke Netzwerke, zwischen denen wir ein Routingprozess wie zB OSPF laufen lassen können.

Der globale Routingprozess:
router ospf 1
router-id 10.10.10.10
log-adjacency-changes
network 100.100.100.1 0.0.0.0 area 0
network 10.10.10.0 0.0.0.255 area 0


Der VRF Routingprozess:
router ospf 2 vrf zif
router-id 20.20.20.20
log-adjacency-changes
network 20.20.20.0 0.0.0.255 area 0
network 102.102.102.2 0.0.0.0 area 0


Die Routing Tabelle schaut danach wiefolgt aus::
global

VRF_Router#sh ip route
[...snip...]

Gateway of last resort is not set

102.0.0.0/24 is subnetted, 1 subnets
C 102.102.102.0 is directly connected, Tunnel102
200.200.200.0/32 is subnetted, 1 subnets
C 200.200.200.200 is directly connected, Loopback200
100.0.0.0/32 is subnetted, 1 subnets
C 100.100.100.100 is directly connected, Loopback100
20.0.0.0/24 is subnetted, 1 subnets
O 20.20.20.0 [110/11112] via 102.102.102.2, 00:24:29, Tunnel102
10.0.0.0/24 is subnetted, 1 subnets
C 10.10.10.0 is directly connected, FastEthernet0/0

vrf

Router#sh ip route vrf zif

Routing Table: zif
[...snip...]

Gateway of last resort is not set

102.0.0.0/24 is subnetted, 1 subnets
C 102.102.102.0 is directly connected, Tunnel201
20.0.0.0/24 is subnetted, 1 subnets
C 20.20.20.0 is directly connected, FastEthernet0/1
10.0.0.0/24 is subnetted, 1 subnets
O 10.10.10.0 [110/11112] via 102.102.102.1, 00:26:19, Tunnel201




Und das wars auch schon!
Nun ist es möglich vom grt_host direkt den vrf_host zu pingen und umgekehrt.

Bei Fragen nutzt einfach die Kommentarfunktion

Bis dann,
Zif

Samstag, 21. November 2009

DE - "Router on a Stick" oder "Inter VLAN routing" mit ASA 5505

Da ich eben beim durchschauen der Google Auswertung unserer Seite festgestellt hab das mehrere Abfragen bzgl. ASA 5505 und Router on-a-stick kamen will ich hier ein kurze Antwort posten.

Die Frage ob es überhaupt geht, ist mit einem klaren Ja und Nein zu beantworten. Die ASA 5505 bietet in der Basis Lizenz 3 Vlans an und enthält keine Trunk Option. Das bedeutet in der Basis Lizenz geht ein Router on-a-stick nicht, da ja on-a-stick bedeutet, rein und raus am selben physikalischen Interface.
Hat man die erweiterte (Plus) Lizenz gekauft, hat man mehr Vlans und kann auch Trunks bauen. Dies erfolgt dann ähnlich der Konfiguration von Trunk Ports auf einem Switch:

Anlegen der entsprechenden Vlan Interfaces


interface vlan 10
nameif IF_outside
security-level 0
ip address 172.20.2.1 255.255.255.0
no shutdown

interface vlan 20
nameif IF_Core
security-level 100
ip address 172.20.3.1 255.255.255.0
no shutdown

interface vlan 30
nameif IF_MGMT
security-level 99
ip address 172.20.4.1 255.255.255.0
no shutdown

interface vlan 30
nameif IF_Marketing
security-level 20
ip address 172.20.5.1 255.255.255.0
no shutdown


Aufbauen des „Sticks" Interfaces

interface ethernet 0/0
description ### Stick Interfaces ###
switchport mode trunk
switchport trunk allowed vlan 10,20,30
no shutdown


Access-listen können wie gewohnt eingebunden werden und auch der Rest arbeitet genau wie erwartet. Am anderen Ende der Verbindung von Ethernet 0/0 sollte ein Switch dann den Trunk wieder aufteilen. Routing erfolg gemaess den richtlinien der ASA bzgl der Security-Level der einzelnen Vlans (vom hohen Level zum niedrigen ist default erlaubt, andersherum muss freigeschalten werden)

Vielleicht eine Anmerkung, die 5505 hat 8 Ports, daher ist eigentlich eine on-a-stick Konfiguration nur bedingt sinnvoll. Ich persönlich würde zumindest die WAN Seite von den Internen Ports trennen. Aber das ist nur meine Meinung.
Anmerkung 2, auf den anderen ASA 55x0 funktioniert das bauen von Router on-a-stick Konfigurationen fast genau wie bei einem Cisco Router.

Cheers NWG

Mittwoch, 1. Juli 2009

EN - dynamic routleaking or Inter VRF routing

dynamic route leaking or routing protcols between global routing table (GRT) and VRFs

Hey Everybody,

last time I showed some exampel config for static roue leaking and thought that dynamic routing between GRT and VRF can't be that hard ... how green.
After some hard trys and help from other people I will now show you, how to exchange routes between GRT and VRF-RT dynamicly.
There is no chance to do a normal redistrubution between routing processes if one is the global one.
If you try so, you'll get some cryptic message like
VRF -> GRT [code]%OSPF process 1 is attached to Default-IP-Routing-Table[/code]
GRT -> VRF [code]OSPF process 22 already exists and is attached to Default-IP-Routing-Table[/code]

How ever, now we need to get this tricked. Therefor we use tunnel interfaces and some loopbacks.

This is my tiny topology:


The global Client and the VRF_Client are again just some as host missused routers with one IP address and a default route pointing on the outgoing IF.
grt_host
[code]interface FastEthernet0/0
ip address 10.10.10.10 255.255.255.0
ip route 0.0.0.0 0.0.0.0 10.10.10.1 FastEthernet0/0[/code]

vrf_host
[code]interface FastEthernet0/1
ip address 20.20.20.20 255.255.255.0
ip route 0.0.0.0 0.0.0.0 20.20.20.1 FastEthernet0/1[/code]

Now are some basic config for the vrf_router needed:

Create a vrf:
ip vrf zif
rd 1:1
route-target both 1:1


Link to grt_host:
interface FastEthernet0/0
ip address 10.10.10.1 255.255.255.0
speed 100
full-duplex


Link to vrf_host:
interface FastEthernet0/1
ip vrf forwarding zif
ip address 20.20.20.1 255.255.255.0
speed 100
full-duplex


This all was no rocket science yet, until now ;)

First thing to figure out: how to outsmart the limitations of design?

One credential are "Tunnel-Interfaces", an other one "loopbacks".

In sum we need one tunnel-IF per VRF and GRT plus one loopback for each.

Both loopbacks are left in GRT:
VRF Router
interface Loopback111
ip address 111.111.111.111 255.255.255.255

interface Loopback222
ip address 222.222.222.222 255.255.255.255


Now we need the correspondent tunnel IFs.
The global one:
interface Tunnel102
ip address 100.100.100.1 255.255.255.0
tunnel source 111.111.111.111
tunnel destination 222.222.222.222

And the VRF one:
interface Tunnel201
ip vrf forwarding RED
ip address 100.100.100.2 255.255.255.0
tunnel source 222.222.222.222
tunnel destination 111.111.111.111


What this is doing: pointing with the tunnel 201 to a GRT loopback with a source in GRT putting itself in a VRF. It sounds, strange, it looks strange, it feels strange, BUT it works ;)

Now you have sweet networks which you can add to routing processes like OSPF.

The global routing process:
router ospf 1
router-id 10.10.10.10
log-adjacency-changes
network 100.100.100.1 0.0.0.0 area 0
network 10.10.10.0 0.0.0.255 area 0


The VRF routing process:
router ospf 2 vrf zif
router-id 20.20.20.20
log-adjacency-changes
network 20.20.20.0 0.0.0.255 area 0
network 102.102.102.2 0.0.0.0 area 0


The routintg tables looks like this:
global

VRF_Router#sh ip route
[...snip...]

Gateway of last resort is not set

102.0.0.0/24 is subnetted, 1 subnets
C 102.102.102.0 is directly connected, Tunnel102
200.200.200.0/32 is subnetted, 1 subnets
C 200.200.200.200 is directly connected, Loopback200
100.0.0.0/32 is subnetted, 1 subnets
C 100.100.100.100 is directly connected, Loopback100
20.0.0.0/24 is subnetted, 1 subnets
O 20.20.20.0 [110/11112] via 102.102.102.2, 00:24:29, Tunnel102
10.0.0.0/24 is subnetted, 1 subnets
C 10.10.10.0 is directly connected, FastEthernet0/0

vrf

Router#sh ip route vrf zif

Routing Table: zif
[...snip...]

Gateway of last resort is not set

102.0.0.0/24 is subnetted, 1 subnets
C 102.102.102.0 is directly connected, Tunnel201
20.0.0.0/24 is subnetted, 1 subnets
C 20.20.20.0 is directly connected, FastEthernet0/1
10.0.0.0/24 is subnetted, 1 subnets
O 10.10.10.0 [110/11112] via 102.102.102.1, 00:26:19, Tunnel201



And thats it! Now you are able to ping from you grt_host straight through the vrf_host.

For questions just use the comments.

so long,
Zif

EN - Upcomming: dynamic route leaking or routing protcols between global routing table (GRT) and VRFs

Hey everyone,

due to NWG asked me for this I started investigation about a way to do some dynamic redistribution between a VRF and the GRT. Everyone trying to solve this by a simple "redistribute" command in the routing process knows, thats that is not the way ;)

At the moment I am preparing the entry for this blog. At this point big thanks to "conspathas" from the dynamip forum for his time explaining this way.

See ya soon,
Zif

Update 09-07-10: due to heavy load @work there is a delay in publication, please stand by :)

Mittwoch, 29. April 2009

EN - "Route Leaking" or Inter VRF routing

Heyho,

today I want to give a small guide, how to configure inter-VRF (VRF = VPN Routung and Forwarding) routing.
The Cisco documentation I found for this is more likely rocket science than a working guide.

The task was to implement static routes on one device routing between different VRFs.
I used following network map:

Both routers "VRF_1" and "VRF_2" are only hosts with only an IP and a default route pointing at the outgoin interface:
VRF1
interface FastEthernet0/1
description Link to VRF_Router
ip address 10.0.100.2 255.255.255.0
speed 100
full-duplex
!
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0

VRF2
interface FastEthernet0/1
description Link to VRF_Router
ip address 10.0.200.2 255.255.255.0
speed 100
full-duplex
!
ip route 0.0.0.0 0.0.0.0 FastEthernet0/1


Now to the routing part:
At first you need an basic VRF lite config:
ip vrf vrf1
rd 1:1
route-target export 1:1
route-target import 1:1
!
ip vrf vrf2
rd 2:2
route-target export 2:2
route-target import 2:2

The two commands route-target export 2:2 and route-target import 2:2 can be summed up with the command "route-target both. In your config this will be automaticaly replaced with to commands shown.

In addition to this there is some IF configuration:
interface FastEthernet0/0
ip vrf forwarding vrf1
ip address 10.0.100.1 255.255.255.0
speed 100
full-duplex
!
interface FastEthernet0/1
ip vrf forwarding vrf2
ip address 10.0.200.1 255.255.255.0
speed 100
full-duplex


The command ip vrf forwarding [vrf_name] associates the IF into a VRF so the traffic is marked up.

Now you need to set up the routing. There for you only need a route for each VRF pointing on the IF and Next-Hop-IP of the targeted VRF.
ip route vrf vrf1 10.0.200.0 255.255.255.0 FastEthernet0/1 10.0.200.2

ip route vrf vrf2 10.0.100.0 255.255.255.0 FastEthernet0/0 10.0.100.2


And thats all. If you issue the command show ip route.
VRF_Router#show 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 not set

VRF_Router#

You'll see an empty global routing table. If you add show ip route vrf [vrf_name]. As example only the output of one vrf:
VRF_Router#show ip route vrf vrf1

Routing Table: vrf1

[... snip ...]

Gateway of last resort is not set

10.0.0.0/24 is subnetted, 2 subnets
C 10.0.100.0 is directly connected, FastEthernet0/0
S 10.0.200.0 [1/0] via 10.0.200.2, FastEthernet0/1
VRF_Router#

Note that it says explictly which routing table it's showing you and you have one extra routing table for each VRF.




If there are any open questions left, just use the commenting funtion


Regrads,
Zif

Freitag, 24. April 2009

DE - Task 2.2.1 hinzufügen der VPN Edge Geräte

Entschuldigung, dass das letzte Post zum Thema so lang her ist, ich hoffe es stört nicht allzu sehr. Prinzipiell sind die Konfigs fertig nur das dokumentieren nervt furchtbar :)
Wir fangen mit unserem Netzwerk aus dem letzten Task an, das heißt wir haben 3 Router und eine PIX die untereinander OSPF sprechen (LINK).

Zuerst werden wir die VPN Endgeräte hinzufügen, so das wir später unser Sicherheitskonzept auf das ganze Netzwerk ausrollen können.

Die Router sind an sich sehr einfach konfiguriert und ich werde nicht tiefer darauf eingehen. Wir konfigurieren wie übliche, die Interfaces für externe und interne Kommunikation, OSPF und zum Schluss sollten wir einen blick auf die anderen Router werfen ob die Routen alle sauber übertragen werden.
Näheres zum Konfigurieren der Router lässt sich unter Task 2.1 finden.

VPN Edge Router 1 - R_VPN_1

version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R_VPN_1
!
boot-start-marker
boot-end-marker
!
no aaa new-model
no logging console
no logging monitor
!
memory-size iomem 5
ip cef
!
no ip domain lookup
ip domain name Task2.local
!
multilink bundle-name authenticated
!
archive
log config
hidekeys
!
interface Loopback0
description ### Loop 0 for MGMT ###
ip address 10.99.99.4 255.255.255.255
!
interface FastEthernet0/0
description ### Uplink ISP 1 ###
ip address 192.168.11.2 255.255.255.128
speed 100
full-duplex
!
interface FastEthernet0/1
description ### Uplink ISP 2 ###
ip address 192.168.22.2 255.255.255.128
speed 100
full-duplex
!
interface FastEthernet1/0
description ### Uplink to R_Outer_Core_1 ###
ip address 10.1.0.2 255.255.255.252
speed 100
full-duplex
!
interface FastEthernet2/0
description ### Uplink to R_Outer_Core_2 ###
ip address 10.1.0.10 255.255.255.252
speed auto
full-duplex
!
router ospf 100
log-adjacency-changes
redistribute connected subnets
redistribute static subnets
network 10.1.0.0 0.0.0.3 area 0
network 10.1.0.8 0.0.0.3 area 0
network 10.99.99.4 0.0.0.0 area 0
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 192.168.11.1
ip route 0.0.0.0 0.0.0.0 192.168.22.1 10
!
ip http server
no ip http secure-server
!
control-plane
!
line con 0
line aux 0
line vty 0 4
!
ntp server 10.99.99.1 prefer

VPN Edge Router 2 - R_VPN_2

version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R_VPN_2
!
no logging console
no logging monitor
!
no aaa new-model
memory-size iomem 5
ip cef
!
no ip domain lookup
ip domain name Task2.local
!
multilink bundle-name authenticated
!
archive
log config
hidekeys
!
interface Loopback0
description ### Loop 0 for MGMT ###
ip address 10.99.99.5 255.255.255.255
!
interface FastEthernet0/0
description ### Uplink ISP 1 ###
ip address 192.168.11.3 255.255.255.128
speed 100
full-duplex
!
interface FastEthernet0/1
description ### Uplink to ISP 2 ###
ip address 192.168.22.3 255.255.255.128
speed 100
full-duplex
!
interface FastEthernet1/0
description ### Uplink to R_Outer_Core_1 ###
ip address 10.1.0.6 255.255.255.252
speed 100
full-duplex
!
interface FastEthernet2/0
description ### Uplink to R_Outer_Core_2 ###
ip address 10.1.0.14 255.255.255.252
speed 100
full-duplex
!
router ospf 100
log-adjacency-changes
redistribute connected subnets
redistribute static subnets
network 10.1.0.4 0.0.0.3 area 0
network 10.1.0.12 0.0.0.3 area 0
network 10.99.99.5 0.0.0.0 area 0
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 192.168.11.1
ip route 0.0.0.0 0.0.0.0 192.168.22.1 10
!
!
no ip http server
no ip http secure-server
!
control-plane
!
line con 0
line aux 0
line vty 0 4
!
ntp server 10.99.99.1 prefer


Das war es im großen und ganzen, wir haben nun 5 Router und eine PIX, auf diesem Netzwerk Sicherheit zu implementieren ist etwas aufwändiger und bekommt daher einen eigenen Blogeintrag.

cheers
NWG

EN - Task 2.2.1 adding VPN Edge devices

Well it has been a while since the last task update and I hope you don´t mind to much.
So we start with our network from last time, this means 3 routers and a pix running OSPF. (LINK)

First of all we will add the two VPN Edge devices, so that we can build security concept for the complete network.
The Routers are set up quit easily and i won´t explain in detail what to do on those machines. We will do the usual stuff like setting up network interfaces for internal and external communication, add OSPF and have a look on the other routers to see if the routes are propagated as expected. Fore more information about see the Task 2.1 Post.

VPN Edge Router 1 - R_VPN_1

service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R_VPN_1
!
boot-start-marker
boot-end-marker
!
no aaa new-model
no logging console
no logging monitor
!
memory-size iomem 5
ip cef
!
no ip domain lookup
ip domain name Task2.local
!
multilink bundle-name authenticated
!
archive
log config
hidekeys
!
interface Loopback0
description ### Loop 0 for MGMT ###
ip address 10.99.99.4 255.255.255.255
!
interface FastEthernet0/0
description ### Uplink ISP 1 ###
ip address 192.168.11.2 255.255.255.128
speed 100
full-duplex
!
interface FastEthernet0/1
description ### Uplink ISP 2 ###
ip address 192.168.22.2 255.255.255.128
speed 100
full-duplex
!
interface FastEthernet1/0
description ### Uplink to R_Outer_Core_1 ###
ip address 10.1.0.2 255.255.255.252
speed 100
full-duplex
!
interface FastEthernet2/0
description ### Uplink to R_Outer_Core_2 ###
ip address 10.1.0.10 255.255.255.252
speed auto
full-duplex
!
router ospf 100
log-adjacency-changes
redistribute connected subnets
redistribute static subnets
network 10.1.0.0 0.0.0.3 area 0
network 10.1.0.8 0.0.0.3 area 0
network 10.99.99.4 0.0.0.0 area 0
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 192.168.11.1
ip route 0.0.0.0 0.0.0.0 192.168.22.1 10
!
ip http server
no ip http secure-server
!
control-plane
!
line con 0
line aux 0
line vty 0 4
!
ntp server 10.99.99.1 prefer

VPN Edge Router 2 - R_VPN_2

service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R_VPN_2
!
no logging console
no logging monitor
!
no aaa new-model
memory-size iomem 5
ip cef
!
no ip domain lookup
ip domain name Task2.local
!
multilink bundle-name authenticated
!
archive
log config
hidekeys
!
interface Loopback0
description ### Loop 0 for MGMT ###
ip address 10.99.99.5 255.255.255.255
!
interface FastEthernet0/0
description ### Uplink ISP 1 ###
ip address 192.168.11.3 255.255.255.128
speed 100
full-duplex
!
interface FastEthernet0/1
description ### Uplink to ISP 2 ###
ip address 192.168.22.3 255.255.255.128
speed 100
full-duplex
!
interface FastEthernet1/0
description ### Uplink to R_Outer_Core_1 ###
ip address 10.1.0.6 255.255.255.252
speed 100
full-duplex
!
interface FastEthernet2/0
description ### Uplink to R_Outer_Core_2 ###
ip address 10.1.0.14 255.255.255.252
speed 100
full-duplex
!
router ospf 100
log-adjacency-changes
redistribute connected subnets
redistribute static subnets
network 10.1.0.4 0.0.0.3 area 0
network 10.1.0.12 0.0.0.3 area 0
network 10.99.99.5 0.0.0.0 area 0
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 192.168.11.1
ip route 0.0.0.0 0.0.0.0 192.168.22.1 10
!
!
no ip http server
no ip http secure-server
!
control-plane
!
line con 0
line aux 0
line vty 0 4
!
ntp server 10.99.99.1 prefer

Well thats it for now. Since adding security to those devices is a larger task I´ll create a new blog post about this topic.

cheers NWG

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

Freitag, 27. März 2009

DE - 'Router on a Stick' oder "Inter VLAN routing"

Hallo zusammen,

ich versuche heute einmal in einfachen Schritten das Inter-VLAN Routing zu erläuterm.
Weil ich mein Heim noch nicht mit Routern und Switchen tapeziert habe, habe ich Dynamips aus dem GNS3 Paket benutzt.

Das folgende Setup habe ich mit 3725er Routern gebaut:
R0 ist der eigentliche Rrouter.
R2 habe ich als Switch im Einsatz. In Slot1 steckt ein NM-16ESW welches den Switch darstellt.
Host1 und Host2 stellen sind wie der Name schon erahnen lässt, lediglich Hosts.

inter vlan routing

Ich werde nur die Zeilen der Config posten, die nicht standartmäßig drin sind.

R0
hostname R0
!
interface FastEthernet0/0
no ip address
speed 100
full-duplex
!
interface FastEthernet0/0.100
encapsulation dot1Q 100
ip address 10.0.100.1 255.255.255.0
!
interface FastEthernet0/0.200
encapsulation dot1Q 200
ip address 10.0.200.1 255.255.255.0
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
ip route 10.0.100.0 255.255.255.0 FastEthernet0/0.100
ip route 10.0.200.0 255.255.255.0 FastEthernet0/0.200
Für jedes VLAN muss ein Subinterface angelegt werden. Ich empfehle die VLAN-Nummern als Sub-IFnummer zu benutzen, aber das ist jedem freigelassen.
Als erstes muß auf dem Subinterface der encapsulation Befehl abgesetzt werden.
encapsulation dot1Q <vlan ID>

Um das Routing zwischen den VLANs einzuschalten kann man entweder statisches Routing nutzen, oder aber ein belieibiges Routing Protokoll. Ich habe statitische Routen benutzt, die jedes Subnetz über das zugehörige Subinterface erreichbar machen.

R2
hostname R2
!
interface FastEthernet1/0
description Link to R0
switchport mode trunk
duplex full
speed 100
!
interface FastEthernet1/5
description Link to Host1
switchport access vlan 100
duplex full
speed 100
!
interface FastEthernet1/10
description Link to Host2
switchport access vlan 200
duplex full
speed 100
Da dieser Router lediglich als L2 Switch dient, sind keinerlei IP Adressen konifguriert. Normalerweise sollte zumindest eine Management IP auf irgend ein VLAN gebunden werden.

Host1
hostname Host1
!
interface FastEthernet0/0
ip address 10.0.100.100 255.255.255.0
speed 100
full-duplex
!
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0

Da diese Router lediglich Hosts simulieren sollen, haben sie eine Defaultroute die auf das ausgehende Interface zeigt, und somit das Default Gateway darstellt.

Host2
hostname Host2
!
interface FastEthernet0/0
ip address 10.0.200.200 255.255.255.0
speed 100
full-duplex
!
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0


Ich empfehle dringend (eigentlich in jeder Config) speed und duplex Befehle, um "Missmatch"-Errors zu vermeiden.

Für Fragen benutzt einfach die Kommentar-Funktion.
Regards,
Zif

Mittwoch, 25. März 2009

EN - 'Router on a Stick' or Inter VLAN routing

Hey again,

I try to explain in simple steps how to do inter vlan routing.
Due to the lack of real equipment @home I used dynamips from the GNS3 package.

I built the folowing setup using 3725 routers.
R0 is the real router.
R2 is used as switch. In Slot1 I inserted a NM-16ESW which simulates the switch.
Host1 and Host2 are used as host only.

inter vlan routing

I will only post non-auto config lines.

R0
hostname R0
!
interface FastEthernet0/0
no ip address
speed 100
full-duplex
!
interface FastEthernet0/0.100
encapsulation dot1Q 100
ip address 10.0.100.1 255.255.255.0
!
interface FastEthernet0/0.200
encapsulation dot1Q 200
ip address 10.0.200.1 255.255.255.0
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
ip route 10.0.100.0 255.255.255.0 FastEthernet0/0.100
ip route 10.0.200.0 255.255.255.0 FastEthernet0/0.200
For each VLAN a subinterface has to be created. I recommend using the VLAN number but there are no rule for it.
When configuring the subinterfaces enter first the encapsulation command.
encapsulation dot1Q <vlan ID>

To enable routing between VLANs you need either static routes or a routing protocol. I used static routes pointing for each subnet to its related subinterface.

R2
hostname R2
!
interface FastEthernet1/0
description Link to R0
switchport mode trunk
duplex full
speed 100
!
interface FastEthernet1/5
description Link to Host1
switchport access vlan 100
duplex full
speed 100
!
interface FastEthernet1/10
description Link to Host2
switchport access vlan 200
duplex full
speed 100
Due to this router is used as Switch only, there are no IP addresses configured. In a real scenario there would be at least a management IP normaly bound on a VLAN.

Host1
hostname Host1
!
interface FastEthernet0/0
ip address 10.0.100.100 255.255.255.0
speed 100
full-duplex
!
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0

Due to these routers are (mis)used as host, the have an default gateway pointing at the outgoing interface.

Host2
hostname Host2
!
interface FastEthernet0/0
ip address 10.0.200.200 255.255.255.0
speed 100
full-duplex
!
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0


I highly recommend (in every environment) to use the speed and duplex settings to avoid running in mismatch errors!

For questions just use the comment section.
Regards,
Zif

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