PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Kofiguration von Shorewall mit openvpn und tomcat



andaluzo
28.01.13, 11:53
Hallo,

ich versuche folgende Konfiguration einzurichten.

1. Ubuntu 12.04 Server (als root Server)

2. Openvpn als Tunnel zum Server

3. Tomcat (soll nur über den tunnel Openvpn erreichbar sein)

Nach endlosen Versuchen auf Basis von den Manuals von Shorewall.net komme ich nicht wirklich weiter.

Der OPENVPN Server läuft, connect funktioniert auch allerdings komme ich nicht an den Tomcat auf dem Port 8080, außer ich gebe den Port fürs gesamte Netz frei.

hier einmal die letzte Version der Shorewall und OpenVPN Config Files

/etc/shorewall/rules


#
# Shorewall version 4 - Rules File
#
# For information on the settings in this file, type "man shorewall-rules"
#
# The manpage is also online at
# http://www.shorewall.net/manpages/shorewall-rules.html
#
################################################## ################################################## ################################################## ##########################$
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK CONNLIMIT TIME HEADERS SWI$
# PORT PORT(S) DEST LIMIT GROUP
#SECTION ALL
#SECTION ESTABLISHED
#SECTION RELATED
SECTION NEW

SSH/ACCEPT net $FW

Ping/ACCEPT net $FW

# Permit all ICMP traffic FROM the firewall TO the net zone
ACCEPT $FW net icmp

# mail lines
SMTP/ACCEPT net $FW
SMTPS/ACCEPT net $FW
Submission/ACCEPT net $FW
IMAP/ACCEPT net $FW
IMAPS/ACCEPT net $FW

#web
Web/ACCEPT net $FW
#ftp
FTP/ACCEPT net $FW
ACCEPT net fw tcp 20,21

#tomcat
#
ACCEPT road fw tcp 8080


/etc/shorewall/interfaces



#
# Shorewall version 4 - Interfaces File
#
# For information about entries in this file, type "man shorewall-interfaces"
#
# The manpage is also online at
# http://www.shorewall.net/manpages/shorewall-interfaces.html
#
################################################## #############################
#ZONE INTERFACE BROADCAST OPTIONS
net eth0 detect dhcp,tcpflags,logmartians,nosmurfs
road tun+



/etc/shorewall/zones



#
# Shorewall version 4 - Zones File
#
# For information about this file, type "man shorewall-zones"
#
# The manpage is also online at
# http://www.shorewall.net/manpages/shorewall-zones.html
#
################################################## #############################
#ZONE TYPE OPTIONS IN OUT
# OPTIONS OPTIONS
fw firewall
loc ipv4
net ipv4
#loc Local
road ipv4

/etc/shorewall/tunnels


#TYPE ZONE GATEWAY GATEWAY ZONE
openvpn:1194 net 0.0.0.0/0



/etc/shorewall/policy



#
# Shorewall version 4 - Policy File
#
# For information about entries in this file, type "man shorewall-policy"
#
# The manpage is also online at
# http://www.shorewall.net/manpages/shorewall-policy.html
#
################################################## #############################
#SOURCE DEST POLICY LOG LIMIT: CONNLIMIT:
# LEVEL BURST MASK
$FW net ACCEPT
road loc ACCEPT
net $FW DROP info
net all DROP info
# The FOLLOWING POLICY MUST BE LAST
all all REJECT info


/etc/openvpn/server.conf


#################################################
# Sample OpenVPN 2.0 config file for #
# multi-client server. #
# #
# This file is for the server side #
# of a many-clients <-> one-server #
# OpenVPN configuration. #
# #
# OpenVPN also supports #
# single-machine <-> single-machine #
# configurations (See the Examples page #
# on the web site for more info). #
# #
# This config should work on Windows #
# or Linux/BSD systems. Remember on #
# Windows to quote pathnames and use #
# double backslashes, e.g.: #
# "C:\\Program Files\\OpenVPN\\config\\foo.key" #
# #
# Comments are preceded with '#' or ';' #
#################################################

port 1194

;proto tcp
proto udp

;dev tap
dev tun

ca ./easy-rsa2/keys/ca.crt
cert ./easy-rsa2/keys/server.crt
key ./easy-rsa2/keys/server.key # Diese Datei geheim halten.
dh ./easy-rsa2/keys/dh1024.pem # Diffie-Hellman-Parameter

server 10.8.0.0 255.255.255.0

ifconfig-pool-persist ipp.txt

keepalive 10 120

comp-lzo

persist-key
persist-tun

status openvpn-status.log

verb 3


Über Tipps, Hinweise, Manuals wäre ich sehr dankbar :)

andaluzo
29.01.13, 19:46
Falls es noch jemand finden sollte

das Problem liegt daran, dass die road zone keinen Zugriff auf das FW hat.

In den Policy entsprechend eintragen und es rockt :)