Posts mit dem Label on-a-stick werden angezeigt. Alle Posts anzeigen
Posts mit dem Label on-a-stick werden angezeigt. Alle Posts anzeigen

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, 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

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