[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
route-to reply-to problème avec PPPOE
Bonjour,
J'installe un Liantec avec 4 interfaces gigabit et openbsd embarqué dans
une compact.
j'ai 2 interfaces externe une PPPOE (modem en mode bridge) et une FIBRE.
J'ai un LAN avec des postes qui sont routés vers le PPPOE et d'autre
vers la FIBRE.
J'ai mis en place 1 TABLES <IP_FIBRE>,( j'aurais pu , aussi mettre en
place 2 VLAN).
J'ai aussi une DMZ.
Tout se passe bien pour les postes sur la fibre. Par contre pour les
postes passant sur l'adsl j'ai un comportement anormale.
Certain sites sont accessibles et d'autres non. (www.openbsd.com ne
passe pas, c'est un comble). La connection passe le syn mais reste blocquée.
Le pflog est correcte ( un pass in sur int_if et un nat pass out ext_if).
L'adresse de nat est aussi correcte.
Je n'arrive pas à interpréter les log provenant (pppoe) du bridge modem.
C'est pourquoi je soupçonne un problème sur la couche ETHERNET du pppoe
Je vais faire un essai sans le mode bridge du modem. c'est à dire sans
le pppoe.
Modem Routeur Fibre
Bridge | |
pppoe | |
ext_adsl ext_fibre
| |
| |
[ ROUTEUR OPENBSD]--------------DMZ
|
|
LAN
J'ai fait un essai de la même config chez moi sur ma connexion ADSL,
avec la même passerelle pour ext_if_fibre et ext_if_adsl.
modemADSL----------routeurADSL
| |
| |
ext_if1 ext_if2
| |
| |
[ ROUTEUR OPENBSD]--------------DMZ
|
|
LAN
Et voici le pf :
-----------------------------------------------------------------------------------------------------------------------
##########################################
# MACROS
#
##########################################
# ADSL
EXT_PPPOE_IF = "pppoe0"
ADSL_IP_NAT = "?.?.?.?"
ADSL_GW = "?.?.?.?"
# FIBRE
EXT_FIBRE_IF = "em1"
FIBRE_NET = "?.?.?.?/29"
FIBRE_GW = "?.?.?.?"
FIBRE_IP_NAT ="?.?.?.?"
# DMZ
INT_DMZ_IF = "em2"
DMZ_NET = $INT_DMZ_IF:network
# LAN
INT_LAN_IF = "em3"
LAN_NET = $INT_LAN_IF:network
# proto
ALL_PROTO = "{ tcp, udp, icmp }"
# port ssh exterieur
EXT_PORT_SSH = "????"
# Serveur en DMZ
SIGONLINE = "?.?.?.?/32"
# ICMP-TYPE
icmp_types= "echoreq"
##########################################
# TABLES #
##########################################
# Ip routées sur la FIBRE
table <IP_FIBRE> persist {?.?.?.?, ?.?.?.?, ?.?.?.?, ?.?.?.? }
# Reseaux privé non routable sur internet
table <RFC1918> const { 192.168.0.0/16, 172.16.0.0/12, \
10.0.0.0/8 }
# ssh brut-force
table <bruteforce> persist
# hackers
table <hackers> persist
#########################################
# OPTIONS #
#########################################
set timeout { interval 10, frag 30 }
set timeout { tcp.first 120, tcp.opening 30, tcp.established 86400 }
set timeout { tcp.closing 900, tcp.finwait 45, tcp.closed 90 }
set timeout { udp.first 60, udp.single 30, udp.multiple 60 }
set timeout { icmp.first 20, icmp.error 10 }
set timeout { other.first 60, other.single 30, other.multiple 60 }
set timeout { adaptive.start 0, adaptive.end 0 }
set limit { states 10000, frags 5000 }
set loginterface $EXT_PPPOE_IF
set optimization normal
set block-policy drop
set require-order yes
set fingerprints "/etc/pf.os"
set skip on lo
########################################
# SCRUB #
########################################
scrub in all
########################################
# QOS #
########################################
########################################
# Traslantion & Redirection #
########################################
# LAN_NAT
nat pass log on $EXT_FIBRE_IF from <IP_FIBRE> to !<RFC1918> ->
$FIBRE_IP_NAT
nat pass log on $EXT_PPPOE_IF from !<IP_FIBRE> to !<RFC1918> ->
$ADSL_IP_NAT
# DMZ NAT
nat pass log on $EXT_FIBRE_IF from $DMZ_NET to !<RFC1918> -> $FIBRE_IP_NAT
# SERVER WEB
binat on $EXT_FIBRE_IF from $SIGONLINE to any -> $FIBRE_IP_NAT
# Reflexion lan -> web
rdr on $INT_LAN_IF proto tcp from $LAN_NET to $EXT_FIBRE_IF port { http,
https, ftp, ftp-data} -> $SIGONLINE
no nat on $INT_LAN_IF proto tcp from $INT_LAN_IF to $LAN_NET
nat on $INT_LAN_IF proto tcp from $LAN_NET to $SIGONLINE port { http,
https, ftp, ftp-data} -> $INT_LAN_IF
# FTP-NAT
nat-anchor "ftp-proxy/*"
rdr-anchor "ftp-proxy/*"
# redirection des services web sur SIGONLINE
rdr on $EXT_FIBRE_IF proto tcp from any to any port { http, https, ftp,
ftp-data} -> $SIGONLINE
# redirection du ssh externe sur la fibre
rdr on $EXT_FIBRE_IF proto tcp from any to any port $EXT_PORT_SSH ->
127.0.0.1 port ?????
#RD FTP
rdr on $INT_LAN_IF proto tcp from any to any port ftp -> 127.0.0.1 port
8021
########################################
# Politique de Filtrage #
########################################
# Politique par défaut:
# 1: filtré les flux arrivant de l'exterieur
# 2: ne pas filtré les flux sortant de l'interieur
block in log all
pass out log all
antispoof quick for { lo $INT_LAN_IF $INT_DMZ_IF }
# filtrage dynamique
block quick from <bruteforce>
block quick from <hackers>
# phase de test
pass in log inet proto icmp all icmp-type $icmp_types keep state
#pass in log on $INT_LAN_IF proto icmp icmp-type $icmp-types
# EXT_SSH --> FW
pass quick proto tcp from any to $FIBRE_NET port $EXT_PORT_SSH \
keep state (max-src-conn 15, max-src-conn-rate 5/3, \
overload <bruteforce> flush global)
#EXT_FIBRE ouverture des services réseaux
pass in on $EXT_FIBRE_IF proto { tcp } from any port 80 to any flags
S/SA synproxy state
pass in on $EXT_FIBRE_IF proto { tcp } from any port 443 to any flags
S/SA synproxy state
pass in on $EXT_FIBRE_IF proto { tcp } from any port 21 to any
pass in on $EXT_FIBRE_IF proto { tcp } from any port 20 to any
pass in on $EXT_FIBRE_IF proto { tcp } from any port $EXT_PORT_SSH to any
#ROUTAGE DYNAMIC EXT_FIBRE <-- DMZ
pass in log on $EXT_FIBRE_IF reply-to {($EXT_FIBRE_IF $FIBRE_GW)} proto
$ALL_PROTO from !<RFC1918> to any
# DMZ -> FIBRE
pass in on $INT_DMZ_IF route-to {($EXT_FIBRE_IF $FIBRE_GW)} inet proto
$ALL_PROTO from $DMZ_NET to !<RFC1918>
# DMZ <-> LAN
pass in log on $INT_DMZ_IF proto { tcp, udp, icmp } from $DMZ_NET to
$LAN_NET
pass in log on $INT_LAN_IF proto { tcp, udp, icmp } from $LAN_NET to
$DMZ_NET
# ROUTAGE DYNAMIC LAN -> EXT_ADSL
# Suit la route par default par l'ADSL
pass in log on $INT_LAN_IF route-to {($EXT_PPPOE_IF $ADSL_GW)} inet
proto $ALL_PROTO from !<IP_FIBRE> to !<RFC1918>
#ROUTAGE DYNAMIC LAN -> EXT_FIBRE
pass in log on $INT_LAN_IF route-to {($EXT_FIBRE_IF $FIBRE_GW)} inet
proto $ALL_PROTO from <IP_FIBRE> to ! <RFC1918>
#Autorisation du ssh dans le LAN
pass in on $INT_LAN_IF proto tcp from $LAN_NET to $LAN_NET port 2222
# DNS
pass in on $INT_LAN_IF proto {tcp,udp} from $LAN_NET to $LAN_NET port
domain
#FTP RULES
-----------------------------------------------------------------------------------------------------------------------
Quelqu'un aurait il eu un cas similaire.
Ou est ce un bug dans les règles.
Cordialement
Eric Papet
--