Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
OpenVPN Gateway Firewall. [Löst]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Scandinavian
View previous topic :: View next topic  
Author Message
Sputnik
Tux's lil' helper
Tux's lil' helper


Joined: 29 Apr 2003
Posts: 84

PostPosted: Sun Aug 21, 2005 10:27 pm    Post subject: OpenVPN Gateway Firewall. [Löst] Reply with quote

Hej har följt HowTo:n
http://gentoo-wiki.com/HOWTO_OpenVPN_Server_for_Ethernet_Bridging_with_Server_Certificates

Har lykats få allt att funka i min labmiljö så testade att köra den på nätet idag.
Dock funka den inte där som jag tänkt mig har nämligen 2st nätverkskort i datorn så den fungerar som en gatway också.

Problemet är att slår jag på min brandvägg så kan man inte komma åt VPN server utifrån Internet.
Slår jag dock av den går de perfekt.. vet inte va som är fel.. =(
Den här ska ju öppna porten:
iptables -A INPUT -p udp --dport 1149 -j ACCEPT
Funkar bra på SSH servern, Någon mer port som ska öppnas för att de ska fungera ?


Last edited by Sputnik on Sat Oct 08, 2005 3:05 pm; edited 1 time in total
Back to top
View user's profile Send private message
patrix_neo
Guru
Guru


Joined: 08 Jan 2004
Posts: 520
Location: The Maldives

PostPosted: Mon Aug 22, 2005 11:46 am    Post subject: Reply with quote

Hej. Eftersom du har lyckats få det fungera i ett LAN (?) så verkar din setup vara ok, och problemet ligga på din FW om jag inte är helt ute och fiskar här.

Själv har jag syslat lite med iptables, och dessa regler byggde jag upp med att sätta en
Code:
 /sbin/iptables -A INPUT -i <eth0/eth1> -p <proto> --dport <portnr> -s <inkommande ip> -d <fw ip> -j ACCEPT
Sedan kan en föregående regel få utgående trafik att 'DROP':as innan paketet hunnit fram till din regel. Något sådant som kan ligga bakom, tror du? Det är vad jag kan tänka mig kan vara ett möjligt fel. För att vara säker på att regeln kommer först i INPUT kedjan, byt ut -A med -I.

En sak til - PREROUTING kedjan kommer innan INPUT kedjan om jag inte missminner mig.
_________________
Life is a fog where some thinks to know where to go
To make an error is human, letting it be is the error.
Deus Vult
Back to top
View user's profile Send private message
Sputnik
Tux's lil' helper
Tux's lil' helper


Joined: 29 Apr 2003
Posts: 84

PostPosted: Tue Sep 06, 2005 2:31 pm    Post subject: Reply with quote

Sitter och fundera va som kan vara galet fortfarande.. inte haft så mycket tid att testa för äns nu.

Tar man tex. ssh så öpnas port 22 när ssh server körs igång om man kör en scan utifrån de görs dock inte på 1194 porten fast de är samma instälning i FW.

Sen har jag lite problem med va man ska skriva i local de interna IP:t eller de externa IP:t ?!!
Den körs ju på tap0 vilket är en Ethernet bridge till de interna eth1.

Code:
local 10.0.0.1
port 1194
proto udp
dev tap0
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/server.crt
key /etc/openvpn/easy-rsa/keys/server.key  # This file should be kept secret
dh /etc/openvpn/easy-rsa/keys/dh2048.pem

#this will assign connecting clients address between the range of 100 and 150
server-bridge 10.0.0.1 255.0.0.0 10.0.0.100 10.0.0.150

#this will allow for people to get the same IP address after a reconnect
ifconfig-pool-persist /etc/openvpn/ipp.txt

push "route 10.0.0.1 255.0.0.0"

#change this to your companies DNS server or omit it entirely
#push "dhcp-option DNS 192.168.20.240"
keepalive 10 120
comp-lzo
max-clients 10
user nobody
group nobody
persist-key
persist-tun
status /tmp/openvpn-status.log
log-append  /var/log/openvpn.log
verb 6
Back to top
View user's profile Send private message
Sputnik
Tux's lil' helper
Tux's lil' helper


Joined: 29 Apr 2003
Posts: 84

PostPosted: Mon Sep 19, 2005 4:10 pm    Post subject: Reply with quote

Inget öppnar 1194 porten.. va gör jag för fel ?!!!
SSH 22 öppnas ju ok...

Code:

#! /bin/sh
#
EXTIF="eth0" #External interface - to the Internet (could be ppp0 for dial-up connections)
INTIF="br0" #Internal interface - to the local network
INTLAN="10.0.0.1/11" #Address space for internal LAN
HOST1="10.0.0.6"
HOST2="10.0.0.1"

case "$1" in

start)
echo -n "Starting firewall"

# Turn on IP forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward

# Flush all tables
iptables -F
iptables -t nat -F
iptables -X

# Set default policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -t nat -P POSTROUTING ACCEPT


# Allow input from localhost and the local network
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i $INTIF -s $INTLAN -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# OPEN PORTS for ICQ, FTP, HTTP and whatever you like
iptables -A INPUT -p udp --dport 1194 -j ACCEPT
iptables -A INPUT -p tcp --dport 65535 -j ACCEPT
iptables -A FORWARD -p tcp --dport 65535 -j ACCEPT -d $HOST1

iptables -A INPUT -p tcp --dport 22 -j ACCEPT
Back to top
View user's profile Send private message
kallamej
Administrator
Administrator


Joined: 27 Jun 2003
Posts: 4975
Location: Gothenburg, Sweden

PostPosted: Tue Sep 20, 2005 7:46 am    Post subject: Reply with quote

Enligt http://openvpn.net/bridge.html måste du även ha en regel för tap0.
_________________
Please read our FAQ Forum, it answers many of your questions.
irc: #gentoo-forums on irc.libera.chat
Back to top
View user's profile Send private message
patrix_neo
Guru
Guru


Joined: 08 Jan 2004
Posts: 520
Location: The Maldives

PostPosted: Tue Sep 20, 2005 10:33 am    Post subject: Reply with quote

En annan sak (om inget annat hjälper) som defenitivt kommer att hjälpa dig, är att gå in på http://lartc.org/ och gå med i dess maillista, posta din fråga. De har väldigt bred kunskap där vad gäller ip-trafik, firewalls, routing och gud vet vad mer.
_________________
Life is a fog where some thinks to know where to go
To make an error is human, letting it be is the error.
Deus Vult
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Scandinavian All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum