nmartin89
Goto Top

Homeoffice VPN Mikrotik eigenes VLan?

Hallo Ihr Lieben☺️

Folgender Aufbau bzw Anforderung.

Ich arbeite seit kurzem in der IT . Dort baut jeder MA der einen Homeoffice Platz hat eine VPN Verbindung zum AG auf. Soweit ja auch klar.

Jetzt ein andere geplanter Aufbau für mich. Ich möchte gern eine IPSEC Verbindung zur FW auf Arbeit aufbauen über meinen HEXs.

Sodas ich nicht über eine VPN Client Software laufen muss. Also wie eine S2S bzw. C2S Verbindung.

Sprich :
Laptop per RJ45 an eine Dose dann auf den Switch Port der ein extra VLAN hat . Halt so gebaut das nur dieser Pc bzw dieses VLAN oder Port am Hexs nur Zugriff auf den VPN Tunnel hat.

Oder Laptop an Dose dann auf einen freien Port am Hexs mit VLAN oder wie auch immer

Wie kann ich das am MT Hexs realisieren ?

Wichtig für meinen Chef ist das nur der Firmen Laptop an einem bestimmten Port Bei mir zuhause mit dem VPN Kommunizieren kann . Sodas sicher gestellt ist das kein anderes Gerät Zugriff hat …

Klar könnte ich auch ein Sophos Red oder sonst was in Keller stellen und da den Laptop anschließen aber wir wollen das gern mal so testen er hat eine Dreammaschien und will das auch bauen 🤪

Content-Key: 82696835824

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

Printed on: April 28, 2024 at 16:04 o'clock

Mitglied: 10138557388
Solution 10138557388 Jan 15, 2024 updated at 16:21:28 (UTC)
Goto Top
Aloha.
Klar geht das überhaupt kein Problem, aber das wichtigste fehlt hier leider: Um welche Art von VPN geht es hier?
IPSec IKEv1/IKEv2/OpenVPN/Wireguard/SSTP/ ... ?

Danach richtet sich nämlich die Vorgehensweise. Denn beim einen richtet man es primär schon über die Phase2 Policies ein (IPSec), bei den anderen primär über Firewall-Regeln in der Forward-Chain welche nur Traffic aus dem genannten Subnetz über den Tunnel gestatten.
z.B. so
/ip firewall filter add chain=forward in-interface=vlan20 out-interface=wg0 action=accept
/ip firewall filter add chain=forward out-interface=wg0 action=reject

PJ.
Member: nmartin89
nmartin89 Jan 15, 2024 at 16:19:43 (UTC)
Goto Top
Ups voll vergessen 🫣

Das Läuft alles über IPSec oder über den Sophos VPN Client das dann glaube Ssl oder so . Aber in meinem Fall wäre es dann IPSec entweder mit Zertifikat oder Preshare Key . Mein Router muss die Verbindung aufbauen. Auf Arbeit die Sophos wartet auf Verbindungen
Mitglied: 10138557388
Solution 10138557388 Jan 15, 2024 updated at 16:44:16 (UTC)
Goto Top
L2TP o. IPSec, oder pure IPSec?
Dann in der Phase2 Policy als SRC Netz das Subnetz/IP angeben und per Firewall zusätzlich noch einschränken.
/ip firewall filter add chain=forward src-address=10.11.12.5 dst-address=10.99.0.0/24 action=accept
/ip firewall filter add chain=forward dst-address=10.99.0.0/24 action=reject
Achtung die Reihenfolge der Regeln ist essentiell!

Grundlagen IPSec mit Mikrotik findest du hier Anleitungen en masse, da brauchen wir nicht nochmal zu Fuß anfangen.
https://administrator.de/user/aqui/?search=Ipsec&action=content& ...

Happy Networking. 🤙
Member: aqui
Solution aqui Jan 15, 2024 updated at 18:19:06 (UTC)
Goto Top
Wie Kollege @10138557388 schon sagt ist das eine einfache Nummer mit dem Mikrotik und im Handumdrehen erledigt. Die Sophos wird sehr wahrscheinlich pure IPsec machen wozu du aber leider nichts zielführendes sagst. face-sad
Dein Mikrotik ist dann der VPN Initiator und die Firmen Sophos der VPN Responder.
Vergleichbar ist ein Setup mit einer pfSense/OPNsense. Beispiele findest du außer den o.g. auch hier:
IPsec VPN Praxis mit Standort Vernetzung Cisco, Mikrotik, pfSense, FritzBox u.a
Mikrotik VLAN Konfiguration ab RouterOS Version 6.41
Member: colinardo
Solution colinardo Jan 16, 2024 updated at 17:24:36 (UTC)
Goto Top
Servus @nmartin89.

Da ich gerade mit einer aktuellen Sophos-Firewall-VM (SFOS 20.0.0 GA-Build222) experimentiere mal schnell eine kurze exemplarische Anleitung Mikrotik <> Sophos-Firewall.

back-to-top IKEv2 S2S VPN with PSK Mikrotik <=> Sophos Firewall



back-to-topTest-Environment


  • WAN-IP Sophos: 1.2.3.4
  • WAN-IP Mikrotik: 3.4.5.6
  • Local Subnet Mikrotik: 192.168.100.0/24
  • Remote Subnet Sophos: 172.16.16.0/24

back-to-topConfiguration Sophos-Firewall


back-to-topAdd Network Objects


back-to-topLocal network

localnet_3

back-to-topRemote Network

mikrotik_net_4

back-to-topAdd IKEv2 Profile


profile_2

back-to-topAdd VPN Peer


peer_1

back-to-topEnable Peer


activate_vpn_connection

back-to-topAdd Firewall Rules (IN/OUT)


fiw_overview_7

back-to-topFirewall Rule IN

fw_rule_in_5

back-to-topFirewall Rule OUT

fw_rule_out_5

back-to-topAllow ICMP to firewall from VPN zone


allow_ping

back-to-topConfiguration Mikrotik


back-to-topConfiguration Skript

change variables for psk/ips/subnets to your environment
{
# ======================
# SOPHOS IKEv2 S2S VPN
# ======================

# Preshared Key
:local PSK "Passw0rd"  
# remote public ip
:local REMOTEIP 1.2.3.4
# local public ip
:local LOCALIP 3.4.5.6
# local subnet
:local LOCALNET 192.168.100.0/24
# remote subnet
:local REMOTENET 172.16.16.0/24

# add ikev2 peer
/ip ipsec peer add address=$REMOTEIP exchange-mode=ike2 name=sophos profile=profile_sophos
# add phase1 proposals
/ip ipsec profile add enc-algorithm=aes-256,aes-128 hash-algorithm=sha256 lifetime=8h name=profile_sophos
# add phase2 proposals
/ip ipsec proposal add auth-algorithms=sha256 enc-algorithms=aes-256-cbc,aes-128-cbc lifetime=1h name=proposal_sophos pfs-group=modp2048
# add phase2 sa policy
/ip ipsec policy add src-address=$LOCALNET dst-address=$REMOTENET level=unique peer=sophos tunnel=yes
# add peer auth identities (PSK)
/ip ipsec identity add my-id=address:$LOCALIP peer=sophos remote-id=address:$REMOTEIP secret="$PSK"  
}
 
Important note: The empty line at the end also needs to be copied when copy and pasting into the terminal

back-to-topExclude IPSec from MASQUERADE rule


Add this extension to your general MASQUERADE rule on WAN if it does not already exist.

mikrotik_exclude_ipsec_from_nat

back-to-topFinal Test


back-to-topMikrotik Phase 2 established


mikrotik_phase2_success

back-to-topSophos connection state success


ipsec_success_sophos

back-to-topPing Mikrotik => Sophos


mikrotik_ping

back-to-topPing Sophos => Mikrotik


ping_sophos


back-to-topUse Mikrotik without static IP


Falls der Mikrotik keine feste IP-Adresse hat ist das auch kein Problem, du kannst hier bspw. auch eine E-Mail Adresse als Identifier benutzen, die nötigen Änderungen zu oben sehen dann so aus:

back-to-topSophos


screenshot

back-to-topMikrotik


screenshot

Die nötigen Firewall-Regeln für die Einschränkung auf dem Mikrotik hat @10138557388 ja oben schon exemplarisch gezeigt.

Viel Erfolg.

Grüße Uwe
Member: colinardo
colinardo Jan 16, 2024 updated at 17:25:39 (UTC)
Goto Top
Und noch als Ergänzung falls der Arbeitgeber dich nicht an die Sophos lässt face-wink, nicht hier noch die Variante L2TP o. IPSEC Client DialIn vom Mikrotik mit deinen existierenden Credentials. Umgebung wie oben.

back-to-topL2TP o. IPSec Client Dialin Mikrotik => Sophos-Firewall


back-to-topMikrotik Configuration Skript

change variables for psk/ips/subnets to your environment
{
# =====================================
# Mikrotik => SOPHOS-Firewall L2TP o. IPSec VPN
# =====================================

# Preshared Key
:local PSK "Passw0rd"  
# Username
:local USERNAME "MaxMuster"  
# User-Password
:local PASSWORD "Passw0rd"  
# remote public ip
:local REMOTEIP 1.2.3.4
# local subnet
:local LOCALNET 192.168.100.0/24
# remote subnet
:local REMOTENET 172.16.16.0/24
# remote LAN IP of Sophos Firewall
:local REMOTEGWIP 172.16.16.1
# =====================================

# add l2tp profile
/ppp profile add name=profile_sophos_l2tp remote-address=$REMOTEGWIP
# add l2tp-client interface
/interface l2tp-client add connect-to=$REMOTEIP disabled=no ipsec-secret="$PSK" name=l2tp-sophos user="$USERNAME" password="$PASSWORD" profile=profile_sophos_l2tp use-ipsec=yes  
# add route to remote subnet
/ip route add dst-address=$REMOTENET gateway=$REMOTEGWIP
# masquerade traffic originating from local lan out l2tp interface
/ip firewall nat add action=masquerade chain=srcnat out-interface=l2tp-sophos src-address=$LOCALNET
}
 
Important note: The empty line at the end also needs to be copied when copy and pasting into the terminal

Grüße Uwe
Member: aqui
aqui Jan 16, 2024 at 17:26:14 (UTC)
Goto Top
Mehr Silbertablett für den TO geht ja nicht! 👍
Member: colinardo
colinardo Jan 17, 2024 updated at 15:36:14 (UTC)
Goto Top
Habe gerade noch die Methode IPSec IKEv1 Remote-ClientDialin PresharedKey + XAuth Variante der Sophos evaluiert (für welches sie einen extra Client zum Download anbieten) und mit einem Mikrotik verbunden. Klappt ebenfalls auf Anhieb, aber was echt heftig ist, ist das der Client damit den gesamten Verkehr der Sophos und deren angeschlossenen Netze auf den Mikrotik über die erstellten Phase2 SAs umleiten kann, die akzeptiert nämlich 0.0.0.0/0 als SRC in der SA, die Remote-Netze sind bei dieser Variante in keinster Weise eingeschränkt.
In den falschen Händen eine Sicherheitslücke par Excellence, sowas derbes hätte ich jetzt nicht von Sophos erwartet. 🙉

screenshot

screenshot

Traffic der Sophos geht nun per Default über den Client (hier ein Ping von der Sophos an 1.1.1.1) 🙃

screenshot

Unglaublich aber wahr. *Kopfschüttel*

Fazit: Durchgefallen
Mitglied: 10138557388
10138557388 Jan 17, 2024 updated at 11:43:36 (UTC)
Goto Top
Member: aqui
aqui Jan 17, 2024, updated at Jan 19, 2024 at 13:10:02 (UTC)
Goto Top
Oha...in der Tat ein böser Fauxpas für einen Security Anbieter wie Sophos! Ohne Worte...