eriks
Goto Top

Smtp- und Webserver hinter Cisco PIX501

Hallo,

so, ist nun mein erster Beitrag hier nachdem ich schon einiges mitgelesen habe. Super Forum, echt klasse face-smile

Cisco Firewalls sind Neuland für mich und ich stehe gerade vor dem Problem eine PIX 501 so zu konfigurieren, daß ein Smtp und Web-Server dahinter erreichbar ist.
Als Inside 192.168.0.x und Outside dynamische IP über DSL.
von Inside nach draußen klappt alles wunderbar. Aber ich kann von außen nicht auf den Server (192.168.0.7) zugreifen.
Telner und PDM klappt auch.
Folgende Ports sollten von außen erreichbar sein: 80 TCP, 25 TCP, 8767 UDP

Config schaut momentan wie folgt aus und so langsam verliere ich die Nerver...

Also fall mir jemand weiterhelden kann, schon mal im Voraus vielen Dank!

Erik


: Written by enable_15 at 03:26:26.175 CEST Wed Nov 29 2006
PIX Version 6.3(3)
interface ethernet0 auto
interface ethernet1 100full
nameif ethernet0 outside security0
nameif ethernet1 inside security100
enable password XXXXXXXXX encrypted
passwd XXXXXXXXX encrypted
hostname ciscopix
domain-name XXXXXX
clock timezone CEST 1
clock summer-time CEDT recurring last Sun Mar 2:00 last Sun Oct 3:00
fixup protocol dns maximum-length 512
fixup protocol ftp 21
fixup protocol h323 h225 1720
fixup protocol h323 ras 1718-1719
fixup protocol http 80
fixup protocol rsh 514
fixup protocol rtsp 554
fixup protocol sip 5060
fixup protocol sip udp 5060
fixup protocol skinny 2000
fixup protocol smtp 25
fixup protocol sqlnet 1521
fixup protocol tftp 69
names
object-group service 102 tcp
port-object eq www
port-object eq https
port-object eq smtp
object-group service ts udp
port-object range 8767 8767
access-list 102 permit tcp any host 192.168.0.1 eq smtp
access-list 102 permit tcp any host 192.168.0.1 eq www
access-list 102 permit udp any host 192.168.0.1 eq 8767
access-list inbound permit tcp any any eq smtp
pager lines 24
logging on
logging timestamp
logging trap informational
mtu outside 1500
mtu inside 1500
ip address outside pppoe setroute
ip address inside 192.168.0.1 255.255.255.0
ip audit info action alarm
ip audit attack action alarm
pdm location 192.168.0.0 255.255.0.0 inside
pdm location 192.168.0.7 255.255.255.255 inside
pdm location 192.168.0.102 255.255.255.255 inside
pdm logging errors 100
pdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 1 0.0.0.0 0.0.0.0 0 0
static (inside,outside) tcp interface smtp 192.168.0.7 smtp netmask 255.255.255.255 0 0
static (inside,outside) tcp interface www 192.168.0.7 www netmask 255.255.255.255 0 0
static (inside,outside) udp interface 8767 192.168.0.7 8767 netmask 255.255.255.255 0 0
access-group 102 in interface outside
timeout xlate 0:05:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 rpc 0:10:00 h225 1:00:00
timeout h323 0:05:00 mgcp 0:05:00 sip 0:30:00 sip_media 0:02:00
timeout uauth 0:05:00 absolute
aaa-server TACACS+ protocol tacacs+
aaa-server RADIUS protocol radius
aaa-server LOCAL protocol local
http server enable
http 192.168.0.0 255.255.255.0 inside
no snmp-server location
no snmp-server contact
snmp-server community public
no snmp-server enable traps
floodguard enable
telnet 192.168.0.102 255.255.255.255 inside
telnet timeout 5
ssh timeout 5
console timeout 0
vpdn group pppoe_group request dialout pppoe
vpdn group pppoe_group localname XXXXXXXXXXXXXX
vpdn group pppoe_group ppp authentication chap
vpdn username XXXXXXXXXXXXX password
dhcpd auto_config outside
terminal width 80
Cryptochecksum:fabc877105b8bd4d68066d6c1abbf1c1

Content-Key: 45584

Url: https://administrator.de/contentid/45584

Printed on: April 23, 2024 at 18:04 o'clock

Member: aqui
aqui Nov 29, 2006 at 13:21:36 (UTC)
Goto Top
Hier:

http://www.cisco.com/en/US/products/hw/vpndevc/ps2030/prod_configuratio ...

findest du genug Beispiele die dir das zeigen wie es geht.
Member: ErikS
ErikS Nov 29, 2006 at 13:42:24 (UTC)
Goto Top
Hallo aqui,

vielen Dank für die schnelle Antwort und den super Link. Bei Konfigurationsbeispiele kannte ich jedoch schon aus einem anderen Beitrag und komme einfach nicht weiter.
Wenn ich beispielsweise SMTP nehme und meine Konfiguration mit der Beispielkonfiguration von cisco (http://www.cisco.com/en/US/products/hw/vpndevc/ps2030/products_configur ..) vergleiche kann ich nicht wirklich Unterschiede erkennen - wobei die Sache auch Neuland für mich ist.

Die soweit ich es erkennen kann relevanten Teile für z.B. SMTP sollte doch sein:

Auszug aus Cisco-Beispiel:

fixup protocol smtp 25 <- Cisco Beispielkonfiguration
!fixup protocol smtp 25 <- bei meiner Konfiguration

access-list smtp permit tcp any host 209.164.3.5 eq smtp <- Cisco Beispielkonfiguration
!access-list 102 permit tcp any host 192.168.0.1 eq smtp <- bei meiner Konfiguration
!access-list inbound permit tcp any any eq smtp <- bei meiner Konfiguration


static (inside,outside) 209.164.3.5 192.168.2.57 netmask 255.255.255.255 <- Cisco Beispielkonfiguration
!static (inside,outside) tcp interface smtp 192.168.0.7 smtp netmask 255.255.255.255 0 0 <- bei meiner Konfiguration

access-group smtp in interface outside <- Cisco Beispielkonfiguration
!access-group 102 in interface outside <- bei meiner Konfiguration


Den einzigen nennenswerten Unterschid den ich erkenne ist bei static, oder sind andere Teile der Konfiguration noch für smtp relevant.

Vielleicht hat noch jemand eine Idee, währe für jeden Tipp dankbar.
Member: aqui
aqui Nov 29, 2006 at 14:32:43 (UTC)
Goto Top
Hier:

http://www.cisco.com/warp/public/707/28.html

Ist ein separates Dokument was die NAT Translation von Outside Traffic genau erklärt. Damit sollte es auf Anhieb funktionieren. Denk dran das Outside NAT erst ab Rel. 6.2 verfügbar ist, diese Version solltest du also Minimum drauf haben !
Member: Rafiki
Rafiki Nov 29, 2006 at 20:32:15 (UTC)
Goto Top
Hi Erik,

die config, die du in deiner Frage angehängt hast, zeigt version 6.3. Die von dir gewollte Konfiguration sollte damit funktionieren.

in der access-list 102 verwendest du die IP 192.168.0.1 für emails, aber in der static Zeile die IP 192.168.0.7
Aus der Konfig entnehme ich, dass die .1 die PIX ist. Bitte die access-list berichtigen.

Gruß Rafiki

PS: die snmp-server community public ist default und muß geändert werden, oder abschalten.
Member: ErikS
ErikS Nov 29, 2006 at 22:55:38 (UTC)
Goto Top
Hallo Rafiki und aqui,

vielen Dank für die Tipps, aber irgendwie stell ich mich scheinbar zu blöd an oder ich sehe den Wald vor lauter Bäumen nicht mehr.

Habe jetzt nach Lektüre diverser Anleitungen per Telnet und PDM versucht den Zugriff hinzubekommen aber scheitere immer noch face-sad
Ich habe nun folgende config in dem Zusammenhang: Nach draußen geht Alles nach wie vor wunderbar, aber keiner der Ports wird an den Server weitergeleitet:

access-list inbound permit tcp any host 192.168.0.7 eq smtp
access-list inbound permit tcp any host 192.168.0.7 eq www
access-list inbound permit udp any host 192.168.0.7 eq 8767
static (inside,outside) tcp interface smtp 192.168.0.7 smtp netmask 255.255.255.255 0 0
static (inside,outside) tcp interface www 192.168.0.7 www netmask 255.255.255.255 0 0
static (inside,outside) udp interface 8767 192.168.0.7 8767 netmask 255.255.255.255 0 0
access-group inbound in interface outside

Falls noch jemand die Nerven dazu hat, würde mir viel helfen....

Güße

Erik

P.S.: ich hänge noch die ganze config dran, falls dort noch ein Bock begraben sein sollte:

PIX Version 6.3(3)
interface ethernet0 auto
interface ethernet1 100full
nameif ethernet0 outside security0
nameif ethernet1 inside security100
enable password XXXXXXX encrypted
passwd XXXXXXX encrypted
hostname ciscopix
domain-name XXXXX
clock timezone CEST 1
clock summer-time CEDT recurring last Sun Mar 2:00 last Sun Oct 3:00
fixup protocol dns maximum-length 512
fixup protocol ftp 21
fixup protocol h323 h225 1720
fixup protocol h323 ras 1718-1719
fixup protocol http 80
fixup protocol rsh 514
fixup protocol rtsp 554
fixup protocol sip 5060
fixup protocol sip udp 5060
fixup protocol skinny 2000
fixup protocol smtp 25
fixup protocol sqlnet 1521
fixup protocol tftp 69
names
name 192.168.0.7 cosmo
name 192.168.0.102 silvercore
access-list inside_access_in permit ip any any
access-list inbound permit tcp any host cosmo eq smtp
access-list inbound permit tcp any host cosmo eq www
access-list inbound permit udp any host cosmo eq 8767
pager lines 24
logging on
logging timestamp
logging trap informational
mtu outside 1500
mtu inside 1500
ip address outside pppoe setroute
ip address inside 192.168.0.1 255.255.255.0
ip audit info action alarm
ip audit attack action alarm
pdm location 192.168.0.0 255.255.0.0 inside
pdm location silvercore 255.255.255.255 inside
pdm location cosmo 255.255.255.255 inside
pdm logging errors 100
pdm history enable
arp timeout 14400
global (outside) 1 interface
global (inside) 1 cosmo
nat (inside) 1 0.0.0.0 0.0.0.0 0 0
static (inside,outside) tcp interface smtp cosmo smtp netmask 255.255.255.255 0 0
static (inside,outside) tcp interface www cosmo www netmask 255.255.255.255 0 0
static (inside,outside) udp interface 8767 cosmo 8767 netmask 255.255.255.255 0 0
access-group inbound in interface outside
access-group inside_access_in in interface inside
timeout xlate 0:05:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 rpc 0:10:00 h225 1:00:00
timeout h323 0:05:00 mgcp 0:05:00 sip 0:30:00 sip_media 0:02:00
timeout uauth 0:05:00 absolute
aaa-server TACACS+ protocol tacacs+
aaa-server RADIUS protocol radius
aaa-server LOCAL protocol local
http server enable
http 192.168.0.0 255.255.255.0 inside
no snmp-server location
no snmp-server contact
snmp-server community snmp.ciscopix.local
no snmp-server enable traps
floodguard enable
telnet silvercore 255.255.255.255 inside
telnet timeout 5
ssh timeout 5
console timeout 0
vpdn group pppoe_group request dialout pppoe
vpdn group pppoe_group localname XXXXXXXX
vpdn group pppoe_group ppp authentication chap
vpdn username XXXXXXX password *
dhcpd auto_config outside
terminal width 80
Cryptochecksum:087ed29bd710c28606dc616b6f84fa95
Member: aqui
aqui Nov 29, 2006 at 23:19:09 (UTC)
Goto Top
Dein NAT ist immer nur "inside outside". So wie ich dich verstanden habe willst du aber doch vom Outiside (weniger sicherem Netz) zur Inside (sicheres Netz) ??? Das heist dein static kommando ist logisch falsch. Da müsste outside inside die Reihenfolge der Wahl sein !
Member: ErikS
ErikS Nov 29, 2006 at 23:55:44 (UTC)
Goto Top
Am NAT sollte es nicht liegen, habe jetzt mal aus lauter Verzeiflung ein

access-list inbound permit ip any interface outside

noch reingesetzt. Jetzt ist der Server auch erreichbar, daher denke ich, daß irgednwas an den ACLs nicht korrekt ist. Oder hab ich da was Mißverstanden?
Jetzt ist wenigstens der Mail-Server wider online, aber ich würde schon gerne daß ganze bald etwas weiter Einschränken...
Member: Rafiki
Rafiki Nov 30, 2006 at 15:26:06 (UTC)
Goto Top
Ich vermute unstimmigkeiten beim NAT / PAT. Mir ist folgende Zeile aufgefallen: global (inside) 1 cosmo
In der ersten konfig war diese Zeile nicht drin und den Sinn "global (inside)" verstehe ich noch nicht. Bitte mal löschen.

Die Zeile nat (inside) 1 0.0.0.0 0.0.0.0 0 0 würde ich so nicht schreiben, etwas schhöner wäre das lokale Netz anzugeben.
nat (inside) 1 192.168.0.0 255.255.255.0 Aber das ist nur für die optik.

Gruß Rafiki
Member: ErikS
ErikS Nov 30, 2006 at 20:50:45 (UTC)
Goto Top
So, Endlich geschafft. Nochmal vielen Dank für Eure Hilfe. :D

Es lang einfach an der Access-List, die muß sich natürlich auf daß interface outside beziehen und nicht auf die interne Server-IP. Im Nachinein sieht es so einfach aus.

Hier den Vorllständigkeit halber die nun aktuelle Konfiguration:

access-list inside_access_in permit ip any any
access-list inbound deny icmp interface outside any
access-list inbound permit tcp any interface outside eq smtp
access-list inbound permit tcp any interface outside eq www
access-list inbound permit udp any interface outside eq 8767

static (inside,outside) tcp interface smtp cosmo smtp netmask 255.255.255.255 0 0
static (inside,outside) tcp interface www cosmo www netmask 255.255.255.255 0 0
static (inside,outside) udp interface 8767 cosmo 8767 netmask 255.255.255.255 0 0

access-group inbound in interface outside
access-group inside_access_in in interface inside

NAT habe ich noch auf das lokale Netz geändert, sieht wirklich besser aus face-wink
nat (inside) 1 192.168.0.0 255.255.255.0 0 0

und "global (inside) 1 cosmo" gelöscht.

Was mich jetzt nur noch wundert ist, daß nach wie vor ICMP akzeptiert wird. Aber wenns weiter Nichts ist.....
Also nächstes ist nun die VPN Konfiguration dran.

Also viele Grüße und einen schönen Abend

Erik
Member: gemini
gemini Nov 30, 2006 at 21:12:43 (UTC)
Goto Top
Was mich jetzt nur noch wundert ist, daß nach wie vor ICMP akzeptiert wird.
icmp deny any outside
Member: ErikS
ErikS Nov 30, 2006 at 21:19:01 (UTC)
Goto Top
Perfekt face-smile

ICMP wird nicht mehr akzeptiert, Danke!
Member: krachtor
krachtor Jan 23, 2007 at 10:23:41 (UTC)
Goto Top
Moin,

- die Adress-Translation ist richtig!
- die ACL 102 ist falsch:
Du hast sie incoming auf das Outside-Interface gebunden (access-group 102 in interface outside)
Daher muss die ACL auch folgende Syntax haben:
'access-list 102 permit tcp any any eq smtp'
'access-list 102 permit tcp any any eq www'
'access-list 102 permit udp any any eq 8767'
Durch das NAT (static) werden die Ports TCP:25, TCP:80 und UDP:8767 direkt auf 192.168.0.1 umgeleitet
Das zweite 'any' muss sein, da Du extern keine fest IP besitzt (sonst wuerde die hier stehen)

Sollten Deine eMail-Header durch Sternchen ersetzt werden (geschrottet), so ist folgender Befehl wichtig:
'no fixup protocol smtp 25'

Ich hoffe, damit sind Deine Probleme behoben...

Gruss,
krachtor
Member: krachtor
krachtor Jan 23, 2007 at 10:27:45 (UTC)
Goto Top
Moin nochmal,

Deine ACL ist nicht auf ein Interface gebunden, daher kann sie raus...

access-list inbound permit tcp any any eq smtp

P.S.: kleiner TIP: vergiss das PDM, es ist fehlerhaft und ungeeignet fuer tricky configurations

Gruss,
krachtor