skyacer
Goto Top

Mikrotik L2TP IPSec Verbindung klappt nicht richtig

Hallo,

ich habe folgendes Problem das meine Einwahl zum Router aufgebaut wird aber er dann z.B. auf dem Handy keine Seiten aufbauen kann weder intern noch extern. Wenn ich das Log richtig deute dann hat er Problem mit dem DNS (siehe Bild). Router ist so eingerichtet wie im Codebereich untenstehen. VPN hab ich nach der Seite VPN einrichten eingerichtet. Ich hab schon einige Zeit im Internet nach einer Lösung gesucht aber die meisten Seiten kommen auf die gleichen Eingaben nur halt teilweie etwas anders.

So jetzt ist meine Frage was mache ich falsch? Sehr wahrscheinlich ist es nur eine absolute Kleinigkeit.

Grüße
Jascha


# jun/30/2019 15:09:07 by RouterOS 6.44.3
# software id = FK2U-MQW7
#
# model = RouterBOARD 3011UiAS
# serial number = 8EED09496644
/interface bridge
add arp=proxy-arp name=bridge1
/interface ethernet
set [ find default-name=ether1 ] loop-protect=on rx-flow-control=auto \
    tx-flow-control=auto
set [ find default-name=ether2 ] loop-protect=on rx-flow-control=auto \
    tx-flow-control=auto
set [ find default-name=ether3 ] loop-protect=on rx-flow-control=auto \
    tx-flow-control=auto
set [ find default-name=ether4 ] loop-protect=on rx-flow-control=auto \
    tx-flow-control=auto
set [ find default-name=ether5 ] loop-protect=on rx-flow-control=auto \
    tx-flow-control=auto
set [ find default-name=ether6 ] loop-protect=on rx-flow-control=auto \
    tx-flow-control=auto
set [ find default-name=ether7 ] loop-protect=on rx-flow-control=auto \
    tx-flow-control=auto
set [ find default-name=ether8 ] loop-protect=on rx-flow-control=auto \
    tx-flow-control=auto
set [ find default-name=ether9 ] loop-protect=on rx-flow-control=auto \
    tx-flow-control=auto
set [ find default-name=ether10 ] loop-protect=on rx-flow-control=auto \
    tx-flow-control=auto
set [ find default-name=sfp1 ] loop-protect=on rx-flow-control=auto \
    tx-flow-control=auto
/interface pppoe-client
add add-default-route=yes disabled=no interface=ether1 name=pppoe-out1-wtnet \
    user=jherber
/interface vlan
add interface=bridge1 name="vlan 999-Management" vlan-id=999  
add interface=bridge1 name=vlan1 vlan-id=1
add interface=bridge1 name=vlan10-home vlan-id=10
add interface=bridge1 name=vlan99-guest vlan-id=99
/interface list
add name=WAN
add name=mac-winbox
add exclude=WAN name=discover
add exclude=WAN name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip ipsec profile
set [ find default=yes ] dh-group=modp1024 enc-algorithm=aes-256,3des
add dh-group=modp1024 enc-algorithm=aes-256,3des name=l2tp-vpn-peer-profile
/ip ipsec peer
add name=l2tp-vpn-peer passive=yes profile=l2tp-vpn-peer-profile
/ip ipsec proposal
set [ find default=yes ] enc-algorithms=aes-256-cbc,3des pfs-group=none
add enc-algorithms=aes-256-cbc,3des name=l2tp-vpn-proposal pfs-group=none
/ip pool
add name=dhcp_pool-lan ranges=10.10.9.100-10.10.9.149
add name=dhcp_pool-vpn ranges=10.10.9.150-10.10.9.155
add name=dhcp_pool-guest ranges=10.10.10.1-10.10.10.253
/ip dhcp-server
add address-pool=dhcp_pool-lan disabled=no interface=bridge1 lease-script=\
    dhcp-lease-script lease-time=1h name=DHCP-Homenet
add address-pool=dhcp_pool-guest disabled=no interface=vlan99-guest name=\
    dhcp1
/ip ipsec mode-config
add address-pool=dhcp_pool-vpn name=l2tp-vpn-mode-config
/ppp profile
add bridge=bridge1 change-tcp-mss=yes dns-server=10.10.10.254 local-address=\
    10.10.9.254 name=lt2tp-vpn-profile remote-address=dhcp_pool-vpn \
    use-encryption=required use-mpls=yes
/tool user-manager customer
set admin access=\
    own-routers,own-users,own-profiles,own-limits,config-payment-gw
/user group
add name=Edomi policy="ftp,reboot,read,write,password,api,!local,!telnet,!ssh,\  
    !policy,!test,!winbox,!web,!sniff,!sensitive,!romon,!dude,!tikapp"  
/interface bridge port
add bridge=bridge1 interface=ether10
add bridge=bridge1 frame-types=admit-only-vlan-tagged interface=\
    "vlan 999-Management" pvid=999  
add bridge=bridge1 frame-types=admit-only-vlan-tagged interface=vlan99-guest \
    pvid=99
/ip neighbor discovery-settings
set discover-interface-list=discover
/ip settings
set rp-filter=strict tcp-syncookies=yes
/interface bridge vlan
add bridge=bridge1 tagged=bridge1,vlan1 untagged=ether10 vlan-ids=1
add bridge=bridge1 tagged=ether10,vlan99-guest untagged=bridge1 vlan-ids=99
add bridge=bridge1 tagged="ether1,vlan 999-Management" untagged=bridge1 \  
    vlan-ids=999
/interface l2tp-server server
set authentication=mschap2 default-profile=lt2tp-vpn-profile enabled=yes \
    max-mru=1460 max-mtu=1460 use-ipsec=yes
/interface list member
add interface=ether2 list=discover
add interface=ether3 list=discover
add interface=ether4 list=discover
add interface=ether5 list=discover
add interface=ether6 list=discover
add interface=ether7 list=discover
add interface=ether8 list=discover
add interface=ether9 list=discover
add interface=ether10 list=discover
add interface=sfp1 list=discover
add interface=bridge1 list=discover
add interface=ether2 list=mac-winbox
add interface=ether3 list=mac-winbox
add interface=ether4 list=mac-winbox
add interface=ether5 list=mac-winbox
add interface=ether6 list=mac-winbox
add interface=ether7 list=mac-winbox
add interface=ether8 list=mac-winbox
add interface=ether9 list=mac-winbox
add interface=ether10 list=mac-winbox
add interface=sfp1 list=mac-winbox
add interface=bridge1 list=LAN
add interface=ether9 list=LAN
/ip address
add address=10.10.9.254/24 interface=bridge1 network=10.10.9.0
add address=192.168.178.2 interface=ether9 network=192.168.178.1
add address=10.10.10.254/24 interface=vlan99-guest network=10.10.10.0
/ip cloud
set update-time=no
/ip dhcp-server lease
add address=10.10.9.26 comment="Reverse Proxy & DNS" mac-address=\  
    B8:27:EB:74:10:74 server=DHCP-Homenet
add address=10.10.9.10 comment=Edomi mac-address=90:1B:0E:4E:D9:65 server=\
    DHCP-Homenet
/ip dhcp-server network
add address=10.10.9.0/24 dns-server=10.10.9.26 domain=home.arpa gateway=\
    10.10.9.254 ntp-server=10.10.9.254
add address=10.10.10.0/24 dns-server=10.10.10.254 gateway=10.10.10.254
/ip dns
set allow-remote-requests=yes servers=213.209.104.220,213.209.104.250,9.9.9.9
/ip dns static
add address=10.10.9.254 name=bartsimpson.home.arpa ttl=1h
add address=10.10.9.26 name=reverseproxy.home.arpa ttl=1h
add address=10.10.9.10 name=edomi.home.arpa ttl=1h
/ip firewall address-list
add address=0.0.0.0/8 list=bogons
add address=10.0.0.0/8 list=bogons
add address=100.64.0.0/10 list=bogons
add address=127.0.0.0/8 list=bogons
add address=169.254.0.0/16 list=bogons
add address=172.16.0.0/12 list=bogons
add address=192.0.0.0/24 list=bogons
add address=192.0.2.0/24 list=bogons
add address=192.168.0.0/16 disabled=yes list=bogons
add address=198.18.0.0/15 list=bogons
add address=198.51.100.0/24 list=bogons
add address=203.0.113.0/24 list=bogons
add address=240.0.0.0/4 list=bogons
add address=10.10.10.0/24 comment="Guest Vlan" disabled=yes list=guestvlan99  
/ip firewall filter
add action=accept chain=input connection-state=new in-interface=\
    pppoe-out1-wtnet port=500,1701,4500 protocol=udp
add action=accept chain=input connection-state="" in-interface=\  
    pppoe-out1-wtnet protocol=ipsec-esp
add action=accept chain=input comment="accept established,related" \  
    connection-state=established,related
add action=accept chain=input comment=\
    "Accept all connections from local network" in-interface=bridge1  
add action=accept chain=input comment=\
    "Accept all connections from local network" dst-address=10.10.9.0/24 \  
    in-interface=ether9 log=yes src-address=192.168.178.1
add action=drop chain=input comment="drop invalid" connection-state=invalid  
add action=accept chain=input comment="accept ICMP echo reply->WAN" \  
    dst-address=!10.10.9.0/24 icmp-options=0:0 in-interface=pppoe-out1-wtnet \
    protocol=icmp src-address=!10.10.9.0/24
add action=accept chain=input comment=\
    "accept ICMP destination unreachable->WAN" dst-address=!10.10.9.0/24 \  
    icmp-options=3:0-1 in-interface=pppoe-out1-wtnet protocol=icmp \
    src-address=!10.10.9.0/24
add action=accept chain=input comment="accept ICMP echo request->WAN" \  
    dst-address=!10.10.9.0/24 icmp-options=8:0 in-interface=pppoe-out1-wtnet \
    protocol=icmp src-address=!10.10.9.0/24
add action=accept chain=input comment="accept ICMP time exceeded->WAN" \  
    dst-address=!10.10.9.0/24 icmp-options=11:0 in-interface=pppoe-out1-wtnet \
    protocol=icmp src-address=!10.10.9.0/24
add action=accept chain=input comment="accept ICMP echo reply->LAN" \  
    dst-address=10.10.9.0/24 icmp-options=0:0 in-interface=bridge1 protocol=\
    icmp src-address=10.10.9.0/24
add action=accept chain=input comment=\
    "accept ICMP destination unreachable->LAN" dst-address=10.10.9.0/24 \  
    icmp-options=3:0-1 in-interface=bridge1 protocol=icmp src-address=\
    10.10.9.0/24
add action=accept chain=input comment="accept ICMP echo request->LAN" \  
    dst-address=10.10.9.0/24 icmp-options=8:0 in-interface=bridge1 protocol=\
    icmp src-address=10.10.9.0/24
add action=accept chain=input comment="accept ICMP time exceeded->LAN" \  
    dst-address=10.10.9.0/24 icmp-options=11:0 in-interface=bridge1 protocol=\
    icmp src-address=10.10.9.0/24
add action=accept chain=input dst-address=10.10.10.0/24 dst-port=53 \
    in-interface=vlan99-guest log-prefix="input vlan dns" protocol=udp \  
    src-address=10.10.10.0/24
add action=accept chain=input dst-address=10.10.10.0/24 dst-port=53 \
    in-interface=vlan99-guest protocol=tcp src-address=10.10.10.0/24
add action=accept chain=input comment="accept DNS-UDP->LAN" dst-address=\  
    10.10.9.0/24 dst-port=53 in-interface=bridge1 protocol=udp src-address=\
    10.10.9.0/24
add action=accept chain=input comment="accept DNS-TCP->LAN" dst-address=\  
    10.10.9.0/24 dst-port=53 in-interface=bridge1 protocol=tcp src-address=\
    10.10.9.0/24
add action=accept chain=input comment="accept SSH->LAN" dst-address=\  
    10.10.9.0/24 dst-port=22 in-interface=bridge1 protocol=tcp src-address=\
    10.10.9.0/24
add action=accept chain=input comment="accept HTTPS->LAN" dst-address=\  
    10.10.9.0/24 dst-port=443 in-interface=bridge1 protocol=tcp src-address=\
    10.10.9.0/24
add action=accept chain=input comment="accept WinBox->LAN" dst-address=\  
    10.10.9.0/24 dst-port=8291 in-interface=bridge1 protocol=tcp src-address=\
    10.10.9.0/24
add action=drop chain=input comment=drop log=yes log-prefix=DROP
add action=fasttrack-connection chain=forward comment=\
    "fasttrack established,related" connection-mark=!ipsec connection-state=\  
    established,related
add action=accept chain=forward comment="accept established,related" \  
    connection-state=established,related
add action=drop chain=forward comment="drop invalid" connection-state=invalid  
add action=drop chain=forward comment="drop bogons<-WAN" in-interface=\  
    pppoe-out1-wtnet src-address-list=bogons
add action=drop chain=forward comment="drop ->WAN w/o DSTNAT" \  
    connection-nat-state=!dstnat connection-state=new in-interface=\
    pppoe-out1-wtnet
add action=reject chain=forward comment="reject SMTP->WAN" dst-port=25 \  
    out-interface=pppoe-out1-wtnet protocol=tcp reject-with=\
    icmp-network-unreachable
add action=accept chain=forward comment="accept LAN->cable modem" \  
    dst-address=192.168.178.1 out-interface=ether9 src-address=10.10.9.0/24
add action=accept chain=forward comment="accept LAN->WAN GuestVlan99" \  
    dst-address=!10.10.10.0/24 in-interface=vlan99-guest log-prefix=\
    "forward vlan" out-interface=pppoe-out1-wtnet src-address=10.10.10.0/24  
add action=accept chain=forward comment="accept LAN->WAN" dst-address=\  
    !10.10.9.0/24 in-interface=bridge1 out-interface=pppoe-out1-wtnet \
    src-address=10.10.9.0/24
add action=drop chain=forward comment=drop
add action=drop chain=output comment="drop invalid" connection-state=invalid  
/ip firewall mangle
add action=mark-connection chain=forward comment=\
    "mark ipsec connections to exclude them from fasttrack" disabled=yes \  
    ipsec-policy=out,ipsec new-connection-mark=ipsec passthrough=yes
add action=mark-connection chain=forward comment=\
    "mark ipsec connections to exclude them from fasttrack" disabled=yes \  
    ipsec-policy=in,ipsec new-connection-mark=ipsec passthrough=yes
/ip firewall nat
add action=masquerade chain=srcnat comment="masquerade LAN->WAN" dst-address=\  
    !10.10.9.0/24 out-interface=pppoe-out1-wtnet src-address=10.10.9.0/24
add action=masquerade chain=srcnat dst-address=!10.10.10.0/24 out-interface=\
    pppoe-out1-wtnet src-address=10.10.10.0/24
/ip firewall service-port
set tftp disabled=yes
set irc disabled=yes
set h323 disabled=yes
set sip disabled=yes
set pptp disabled=yes
set udplite disabled=yes
set dccp disabled=yes
set sctp disabled=yes
/ip ipsec identity
add generate-policy=port-override peer=l2tp-vpn-peer
/ip ipsec policy
set 0 dst-address=0.0.0.0/0 src-address=0.0.0.0/0
add dst-address=0.0.0.0/0 proposal=l2tp-vpn-proposal src-address=0.0.0.0/0 \
    template=yes
/ip service
set telnet address=10.10.9.0/24 disabled=yes
set ftp address=10.10.9.0/24
set www address=10.10.9.0/24 disabled=yes
set ssh address=10.10.9.0/24
set www-ssl address=10.10.9.0/24 certificate=bartsimpson.home.arpa disabled=\
    no
set api address=10.10.9.0/24 disabled=yes
set winbox address=10.10.9.0/24
set api-ssl address=10.10.9.0/24 certificate=bartsimpson.home.arpa
/ip ssh
set host-key-size=4096 strong-crypto=yes
/lcd
set backlight-timeout=5m color-scheme=light default-screen=stats \
    read-only-mode=yes
/lcd pin
set hide-pin-number=yes pin-number=6464
/ppp secret
add name=jascha profile=lt2tp-vpn-profile service=l2tp
/system clock
set time-zone-name=Europe/Berlin
/system identity
set name=BartSimpson
/system logging
add prefix="L2TPDBG===>" topics=l2tp  
add prefix="IPSECDBG===>" topics=ipsec  
/system note
set note=\
    " Authorized administrators only. Access to this device is monitored."  
/system ntp client
set enabled=yes server-dns-names=pool.ntp.org,time.google.com
/system routerboard settings
set boot-protocol=dhcp
/system scheduler
add interval=1m name="DDNS_Updater GoIP" on-event=\  
    "/system script run DDNS_Goip" policy=\  
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-time=startup
/tool bandwidth-server
set enabled=no
/tool mac-server
set allowed-interface-list=mac-winbox
/tool mac-server mac-winbox
set allowed-interface-list=mac-winbox
/tool sniffer
set filter-interface=bridge1 streaming-enabled=yes streaming-server=\
    10.10.9.25
/tool user-manager database
set db-path=user-manager
fw_vpn

Content-Key: 467854

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

Printed on: April 20, 2024 at 12:04 o'clock

Member: areanod
Solution areanod Jul 01, 2019 at 09:55:33 (UTC)
Goto Top
Hey Jascha,

Nachdem ich jetzt die Antwort zwei Mal geschrieben habe, weil mir immer was neues aufgefallen ist, glaube ich das Problem gefunden zu haben:

Du hast in den INPUT-Chains zu viele bzw. widersprüchliche Filter gesetzt, z.B.:

add action=accept chain=input comment="accept DNS-UDP->LAN" dst-address=\  
    10.10.9.0/24 dst-port=53 in-interface=bridge1 protocol=udp src-address=\
    10.10.9.0/24

1.) Es gibt zwar bestimmte Ausnahme für diese Regel, in deinem Fall jedoch nicht: Bei einer Input-Rule wird für die dst-address kein Subnetz gesetzt. Setze entweder die spezifische Adresse für den Router (10.10.9.254) oder lass das Feld ganz frei.
2.) Der Grund warum dein L2TP-Client keine Antwort bekommt ist, weil es keine Regel für ihn gibt, die ihm das erlaubt. In der Regel des Codeschnipsels oben wird das "in-interface" als bridge1 angegeben. Lass das in-interface leer und die Regel wird greifen.


Weitere Kommentare:
1.) Pass auf die Reihenfolge der Filter auf, ich hab da ein paar ACCEPT Regeln nach DROP-Filter gesehen und die goldene Regel lautet: Erstes in der Reihenfolge trifft, alle anderen nicht mehr.
2.) Schau dir deine Firewall-Regeln generell an und versuche zu spezifische Regeln zu entschärfen, z.B:
add action=accept chain=input comment=\
    "Accept all connections from local network" dst-address=10.10.9.0/24 \  
    in-interface=ether9 log=yes src-address=192.168.178.1
Wenn am Ether9 nur und ausschließlich die Fritzbox dranhängt, dann brauchst du keine SRC Adresse; wenn du jedoch auch mal Kabel umstecken können willst, nimm anstatt dessen in-interface=ether9 raus und sei mit der Regel unabhängig vom Ethernetport.

lG
Areanod
Member: skyacer
skyacer Jul 01, 2019 updated at 12:54:29 (UTC)
Goto Top
Hi,

danke für deine Hilfe. Hab jetzt mal in der Input Chain die dst-adress und das in-interface gelöscht. Leider geht es immer nich nicht. Ich kann zwar connecten aber keine Seiten aufbauen.

Also die first match win Regel kannte ich bereits. Aber wie du ja gesehen hast betrifft das meistens die "Invalid" drop Regel.

Und immer raus damit was dir noch alles auffällt oder besser laufen könnte. Nur so lern ich auch dazu.

Grüße
Member: quax08
quax08 Jul 01, 2019 at 16:15:49 (UTC)
Goto Top
Hey,

ich habe die Konfig zwar nur überflogen, schau mal bei deinen Einstellungen vom "PPP Profile". Da hast du als Local Adress dein Gastnetz angegeben. Da hast du dich vermutlich vertan, es soll ja das andere Netz sein.

Gruß
Member: skyacer
skyacer Jul 01, 2019 at 17:34:57 (UTC)
Goto Top
@quax08 Danke aber das hatte ich hinterher schon geändert. Daran lag es auch nicht.

Was ich jetzt habe nachdem ich mal mit der Firewall rumgespielt habe. Ich habe ja einen internen DNS Server (Pihole 10.10.9.26). Hab den DNS auf den Router DNS umgestellt und siehe da ich konnte externe Seiten öffnen. Also wieder auf internen DNS umgestellt und ich konnte wieder keine externen Seiten öffnen. Also weitergesucht und einfach mal eine weitere Forwardchain angelegt mit accept auf in-interface "Bridge1". Und siehe da ich erreiche sogar meine Server.

So nun ist natürlich die Frage ob meine Firewall ausreichend gesichert ist von Ausserhalb oder was ich besser machen könnte damit es sicherer wird?

# jul/01/2019 19:17:39 by RouterOS 6.44.3
# software id = FK2U-MQW7
#
# model = RouterBOARD 3011UiAS
# serial number = 8EED09496644
/ip firewall address-list
add address=0.0.0.0/8 list=bogons
add address=10.0.0.0/8 disabled=yes list=bogons
add address=100.64.0.0/10 list=bogons
add address=127.0.0.0/8 list=bogons
add address=169.254.0.0/16 list=bogons
add address=172.16.0.0/12 list=bogons
add address=192.0.0.0/24 list=bogons
add address=192.0.2.0/24 list=bogons
add address=192.168.0.0/16 disabled=yes list=bogons
add address=198.18.0.0/15 list=bogons
add address=198.51.100.0/24 list=bogons
add address=203.0.113.0/24 list=bogons
add address=240.0.0.0/4 list=bogons
add address=10.10.10.0/24 comment="Guest Vlan" disabled=yes list=guestvlan99  
/ip firewall filter
add action=accept chain=input connection-state=new in-interface=\
    pppoe-out1-wtnet port=500,1701,4500 protocol=udp
add action=accept chain=input connection-state="" in-interface=\  
    pppoe-out1-wtnet protocol=ipsec-esp
add action=accept chain=input comment="accept established,related" \  
    connection-state=established,related
add action=accept chain=input comment=\
    "Accept all connections from local network" in-interface=bridge1  
add action=accept chain=input comment=\
    "Accept all connections from fritzbox network" dst-address=10.10.9.0/24 \  
    log=yes src-address=192.168.178.1
add action=drop chain=input comment="drop invalid" connection-state=invalid  
add action=accept chain=input comment="accept ICMP echo reply->WAN" \  
    dst-address=!10.10.9.0/24 icmp-options=0:0 in-interface=pppoe-out1-wtnet \
    protocol=icmp src-address=!10.10.9.0/24
add action=accept chain=input comment=\
    "accept ICMP destination unreachable->WAN" dst-address=!10.10.9.0/24 \  
    icmp-options=3:0-1 in-interface=pppoe-out1-wtnet protocol=icmp \
    src-address=!10.10.9.0/24
add action=accept chain=input comment="accept ICMP echo request->WAN" \  
    dst-address=!10.10.9.0/24 icmp-options=8:0 in-interface=pppoe-out1-wtnet \
    protocol=icmp src-address=!10.10.9.0/24
add action=accept chain=input comment="accept ICMP time exceeded->WAN" \  
    dst-address=!10.10.9.0/24 icmp-options=11:0 in-interface=pppoe-out1-wtnet \
    protocol=icmp src-address=!10.10.9.0/24
add action=accept chain=input comment="accept ICMP echo reply->LAN" \  
    dst-address=10.10.9.0/24 icmp-options=0:0 in-interface=bridge1 protocol=\
    icmp src-address=10.10.9.0/24
add action=accept chain=input comment=\
    "accept ICMP destination unreachable->LAN" dst-address=10.10.9.0/24 \  
    icmp-options=3:0-1 in-interface=bridge1 protocol=icmp src-address=\
    10.10.9.0/24
add action=accept chain=input comment="accept ICMP echo request->LAN" \  
    dst-address=10.10.9.0/24 icmp-options=8:0 in-interface=bridge1 protocol=\
    icmp src-address=10.10.9.0/24
add action=accept chain=input comment="accept ICMP time exceeded->LAN" \  
    dst-address=10.10.9.0/24 icmp-options=11:0 in-interface=bridge1 protocol=\
    icmp src-address=10.10.9.0/24
add action=accept chain=input dst-address=10.10.10.0/24 dst-port=53 \
    in-interface=vlan99-guest log-prefix="input vlan dns" protocol=udp \  
    src-address=10.10.10.0/24
add action=accept chain=input dst-address=10.10.10.0/24 dst-port=53 \
    in-interface=vlan99-guest protocol=tcp src-address=10.10.10.0/24
add action=accept chain=input comment="accept DNS-UDP->LAN" dst-port=53 \  
    protocol=udp src-address=10.10.9.0/24
add action=accept chain=input comment="accept DNS-TCP->LAN" dst-port=53 \  
    protocol=tcp src-address=10.10.9.0/24
add action=accept chain=input comment="accept SSH->LAN" dst-address=\  
    10.10.9.0/24 dst-port=22 in-interface=bridge1 protocol=tcp src-address=\
    10.10.9.0/24
add action=accept chain=input comment="accept HTTPS->LAN" dst-address=\  
    10.10.9.0/24 dst-port=443 in-interface=bridge1 protocol=tcp src-address=\
    10.10.9.0/24
add action=accept chain=input comment="accept WinBox->LAN" dst-address=\  
    10.10.9.0/24 dst-port=8291 in-interface=bridge1 protocol=tcp src-address=\
    10.10.9.0/24
add action=drop chain=input comment=drop log=yes log-prefix=DROP
add action=fasttrack-connection chain=forward comment=\
    "fasttrack established,related" connection-mark=!ipsec connection-state=\  
    established,related
add action=accept chain=forward comment="accept established,related" \  
    connection-state=established,related
add action=accept chain=forward dst-port=53 out-interface=pppoe-out1-wtnet \
    protocol=udp
add action=accept chain=forward out-interface=bridge1
add action=drop chain=forward comment="drop invalid" connection-state=invalid  
add action=drop chain=forward comment="drop bogons<-WAN" in-interface=\  
    pppoe-out1-wtnet src-address-list=bogons
add action=drop chain=forward comment="drop ->WAN w/o DSTNAT" \  
    connection-nat-state=!dstnat connection-state=new in-interface=\
    pppoe-out1-wtnet
add action=reject chain=forward comment="reject SMTP->WAN" dst-port=25 \  
    out-interface=pppoe-out1-wtnet protocol=tcp reject-with=\
    icmp-network-unreachable
add action=accept chain=forward comment="accept LAN->WAN" dst-address=\  
    !10.10.9.0/24 out-interface=pppoe-out1-wtnet src-address=10.10.9.0/24
add action=accept chain=forward comment="accept LAN->cable modem" \  
    dst-address=192.168.178.1 out-interface=ether9 src-address=10.10.9.0/24
add action=accept chain=forward comment="accept LAN->WAN GuestVlan99" \  
    dst-address=!10.10.10.0/24 in-interface=vlan99-guest log-prefix=\
    "forward vlan" out-interface=pppoe-out1-wtnet src-address=10.10.10.0/24  
add action=drop chain=forward comment=drop log=yes log-prefix=DROPFORWARD
add action=drop chain=output comment="drop invalid" connection-state=invalid  
/ip firewall mangle
add action=mark-connection chain=forward comment=\
    "mark ipsec connections to exclude them from fasttrack" disabled=yes \  
    ipsec-policy=out,ipsec new-connection-mark=ipsec passthrough=yes
add action=mark-connection chain=forward comment=\
    "mark ipsec connections to exclude them from fasttrack" disabled=yes \  
    ipsec-policy=in,ipsec new-connection-mark=ipsec passthrough=yes
/ip firewall nat
add action=masquerade chain=srcnat comment="masquerade LAN->WAN" dst-address=\  
    !10.10.9.0/24 out-interface=pppoe-out1-wtnet src-address=10.10.9.0/24
add action=masquerade chain=srcnat dst-address=!10.10.10.0/24 out-interface=\
    pppoe-out1-wtnet src-address=10.10.10.0/24
/ip firewall service-port
set tftp disabled=yes
set irc disabled=yes
set h323 disabled=yes
set sip disabled=yes
set pptp disabled=yes
set udplite disabled=yes
set dccp disabled=yes
set sctp disabled=yes
Member: areanod
areanod Jul 02, 2019 at 12:08:42 (UTC)
Goto Top
Zitat von @skyacer:
Also weitergesucht und einfach mal eine weitere Forwardchain angelegt mit accept auf in-interface "Bridge1". Und siehe da ich erreiche sogar meine Server.

Ich nehme an du meinst "out-interface", ansonsten macht das keinen Sinn face-smile
In der Konfig stehts zwar richtig drin, war mir aber nicht sicher ob du dies gemeint hast:
add action=accept chain=forward out-interface=bridge1

Eventuell würde ich hier noch das in-Interface mit NOT-Präfix dazu schreiben, also:
add action=accept chain=forward out-interface=bridge1 in-interface=!pppoe-out1-wtnet


Du solltest außerdem noch schauen, ob du dieses Setup etwas vereinfachen kannst, für ein verhältnißmäßig kleines Setup hast du hier nämlich 30+ Filter Rules, wo du vermutlich auch mit der Hälfte oder weniger auskommen würdest.

Diese Regel ist z.B. komplett unnötig:
add action=accept chain=input comment="accept ICMP echo reply->LAN" \  
    dst-address=10.10.9.0/24 icmp-options=0:0 in-interface=bridge1 protocol=\
    icmp src-address=10.10.9.0/24

Du hast weiter oben bereits angegeben, dass du sämtliche Verbindungen von bridge1 in der chain "input" zulässt.
Selbiges für die Einträge mit den Kommentaren
"accept HTTPS->LAN", "accept SSH->LAN", "accept WinBox->LAN", usw.

Die NAT Regeln könntest du auch zusammenfassen, anstatt der beiden bestehenden (Zeile 113-116) fasst du beide zusammen mit

/ip firewall nat add action=masquerade chain=srcnat comment="masquerade LAN->WAN" out-interface=pppoe-out1-wtnet  


Eine weitere Optimierungsmöglichkeit siehst du auch, wenn dein Tik ein paar Stunden mal gelaufen ist. Wenn du die häufig getroffenen Regeln (=mit vielen Paketen/viel Traffic drüber) innterhalb der Berechtigungsstruktur nach oben verschiebst verbraucht der Tik weniger CPU Power zum matchen von Firewall Regeln.
Achte nur beim Verschieben darauf, dass du ein DROP dann nicht über ein ACCEPT drüber schiebst ;)

lG
Areanod
Member: skyacer
skyacer Jul 02, 2019 at 13:53:07 (UTC)
Goto Top
Super. Ist auch gleich alles umgesetzt. Die Hälfte der Input Chains sind dann auch gleich mal rausgeflogen. Auch wenn es bei mir nur mit kleinen Schritten geht. Es wird langsam... Wird bestimmt nicht mein letzter Beutrag dazu sein. face-wink

Danke und liebe Grüße
Jascha
Member: areanod
areanod Jul 02, 2019 at 19:04:36 (UTC)
Goto Top
NP, die Lernkurve bei Mikrotik ist verhältnismäßig steil und selbst ich hab das eine oder andere Mal ein Problem, bei dem ich den MT-Support brauche face-smile

lG
Areanod
Member: aqui
aqui Sep 09, 2021 at 11:28:43 (UTC)
Goto Top
Weitere Infos auch hier:
Scheitern am IPsec VPN mit MikroTik