User's banner
Avatar

Emotet

Emotet@slrpnk.net
Joined
6 posts • 30 comments

Dev and Maintainer of Lemmy Userdata Migration

Direct message

Because this repo is going viral from time to time to developers, I’m open for discussion if you want to promote a product/service in this README file. Just mail me at XXXX

Ew.

permalink
report
parent
reply

I’ve been tempted by Tailscale a few times before, but I don’t want to depend on their proprietary clients and control server. The latter could be solved by selfhosting Headscale, but at this point I figure that going for a basic Wireguard setup is probably easier to maintain.

I’d like to have a look at your rules setup, I’m especially curious if/how you approached the event of the commercial VPN Wireguard tunnel(s) on your exit node(s) going down, which depending on the setup may send requests meant to go through the commercial VPN through your VPS exit node.

Personally, I ended up with two Wireguard containers in the target LAN, a wireguard-server and a **wireguard-client **container.

They both share a docker network with a specific subnet {DOCKER_SUBNET} and wireguard-client has a static IP {WG_CLIENT_IP} in that subnet.


The wireguard-client has a slightly altered standard config to establish a tunnel to an external endpoint, a commercial VPN in this case:

[Interface]
PrivateKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Address = XXXXXXXXXXXXXXXXXXX

PostUp = iptables -t nat -A POSTROUTING -o wg+ -j MASQUERADE
PreDown = iptables -t nat -D POSTROUTING -o wg+ -j MASQUERADE

PostUp = iptables -I OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT && ip6tables -I OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT

PreDown = iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT && ip6tables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT

[Peer]
PublicKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AllowedIPs = 0.0.0.0/0,::0/0
Endpoint = XXXXXXXXXXXXXXXXXXXX

where

PostUp = iptables -t nat -A POSTROUTING -o wg+ -j MASQUERADE
PreDown = iptables -t nat -D POSTROUTING -o wg+ -j MASQUERADE

are responsible for properly routing traffic coming in from outside the container and

PostUp = iptables -I OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT && ip6tables -I OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT

PreDown = iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT && ip6tables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT

is your standard kill-switch meant to block traffic going out of any network interface except the tunnel interface in the event of the tunnel going down.


The wireguard-server container has these PostUPs and -Downs:

PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

default rules that come with the template and allow for routing packets through the server tunnel

PostUp = wg set wg0 fwmark 51820

the traffic out of the tunnel interface get marked

PostUp = ip -4 route add 0.0.0.0/0 via {WG_CLIENT_IP} table 51820

add a rule to routing table 51820 for routing all packets through the wireguard-client container

PostUp = ip -4 rule add not fwmark 51820 table 51820

packets not marked should use routing table 51820

PostUp = ip -4 rule add table main suppress_prefixlength 0

respect manual rules added to main routing table

PostUp = ip route add {LAN_SUBNET} via {DOCKER_SUBNET_GATEWAY_IP} dev eth0

route packages with a destination in {LAN_SUBNET} to the actual {LAN_SUBNET} of the host

PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip route del {LAN_SUBNET} via {DOCKER_SUBNET_GATEWAY_IP} dev eth0

delete those rules after the tunnel goes down

PostUp = iptables -I OUTPUT ! -o %i -m mark ! --mark 0xca6c -m addrtype ! --dst-type LOCAL -j REJECT && ip6tables -I OUTPUT ! -o %i -m mark ! --mark 0xca6c -m addrtype ! --dst-type LOCAL -j REJECT
PreDown = iptables -D OUTPUT ! -o %i -m mark ! --mark 0xca6c -m addrtype ! --dst-type LOCAL -j REJECT && ip6tables -D OUTPUT ! -o %i -m mark ! --mark 0xca6c -m addrtype ! --dst-type LOCAL -j REJECT

Basically the same kill-switch as in wireguard-client, but with the mark manually substituted since the command it relied on didn’t work in my server container for some reason and AFAIK the mark actually doesn’t change.


Now do I actually need the kill-switch in wireguard-server? Is the kill-switch in wireguard-client sufficient? I’m not even sure anymore.

permalink
report
parent
reply

In der üblichen paradoxen Kombination aus Politikverdrossenheit und -interesse meinen Kopf schütteln, weiterhin wählen gehen und versuchen, mich so wenig davon im Alltag beinflussen zu lassen wie möglich.

permalink
report
reply

Oh I’m fully aware. I personally don’t care, but one could add a capable VPS and deploy the Wireguard Host Container + two Client Containers, one for the LAN and one for the commercial VPN (like so), if the internet connection of the LAN in question isn’t sufficient.

permalink
report
parent
reply

Oh, neat! Never noticed that option in the Wireguard app before. That’s very helpful already. Regarding your opnsense setup:

I’ve dabbled in some (simple) routing before, but I’m far from anything one could call competent in that regard and even if I’d read up properly before writing my own routes/rules, I’d probably still wouldn’t trust that I hadn’t forgotten something to e.g. prevent IP/DNS leaks.

I’m mainly relying on a Docker and was hoping for pointers on how to configure a Wireguard host container to route only internet traffic through another Wireguard Client container.

I found this example, which is pretty close to my ideal setup. I’ll read up on that.

permalink
report
parent
reply

Ball-Gags mit O-Ringen, wann?

permalink
report
parent
reply

Weil ich keine Lust habe das Profitape in H-Form zu kaufen (ein Monat Mund zukleben für 19,99 Euro), schneide ich Pflastertape in zwei schmale Streifen und klebe sie als X über meine Lippen.

Schnell fühlt sich meine Zunge schwer an, als wäre sie zu groß für meinen Mund. Ich versuche es zu ignorieren, wie wenn es im Sommer zu heiß zum Einschlafen ist. Nicht bewegen und aushalten.

Im Schlaf muss ich mich von dem Klebeband befreit haben. Am Morgen klebt es über meinem Bett an der Wand. Auch die zweite Nacht halte ich nicht durch. Ich werde fast stündlich wach und gebe auf.

permalink
report
reply

Zu den bei Dieben besonders beliebten Warengruppen in Supermärkten und Discountern zählen Spirituosen, Tabakwaren, Kosmetikprodukte, Rasierklingen, Energydrinks sowie Babynahrung und Kaffee. Fleisch, Wurst und Käse werden ebenfalls häufiger genannt.

Meist handelt es sich um Gelegenheitstäter, für mindestens ein Viertel der Diebstähle sind professionelle Täter verantwortlich, die bandenmäßig agieren.

Bei Lebensmitteln kann ich die Position zumindest so halbwegs nachvollziehen, aber bei Spirituosen, Tabakwaren, Kosmetikprodukte, Rasierklingen, Energydrinks und Kaffee? Warum steht das Menschen zu, wenn als Folge des Diebstahls lediglich die Preise für die ehrlichen Kunden angezogen werden?

Ladendiebstahl ist kein nobler Protest oder gar eine Art Freiheitskampf gegen das böse kapitalistische Problem. Wenn das überhandnimmt, schließt einfach die lokale Filiale. Die meisten Diebe finden es wohl einfach geil, sich auf Kosten anderer zu bereichern. Fuck all of you, I got mine. Höchst asozial.

permalink
report
parent
reply

“Wir brauchen eine Debattenkultur, in der Menschen ihre Meinung und ihre Sorgen sagen können, ohne in Schubladen gesteckt zu werden”

Menschen über ihr Tun, ihr Wirken und nicht über ihre Herkunft zu definieren, dafür stehe für sie das neue Grundsatzprogramm der CDU, so die Politikerin.

Ah, die werte Frau Sekmen will also eine Debattenkultur ohne Schubladendenken und wechselt deswegen zur Union. Die sind ja bekanntlich sehr aufgeschlossen, besonders was populistische Positionen, Korruption und Verquickung von Mandat und persönlichen Interessen angeht.

Das hat garantiert nichts damit zu tun, dass die Ampel, und damit auch die Grünen, bei der nächsten Wahl höchstwahrscheinlich nicht mehr die regierende Koalition sein wird und die werte Frau Sekmen sich bessere Chancen zum Ausbauen von politischer Macht und persönlicher Bereicherung bei der politisch quasi gegenläufigen Union erhofft.

Das Landeslistenmandat, welches durch grüne Stimmen errungen wurde und durch welches sie nicht direkt gewählt wurde, niederlegen? Ne, Anstand ist out, gerade als neuer Parteifreund von Scheuer lernt man ja recht schnell, dass das Fußvolk lediglich ein zu manipulierender Pöbel ist, auf dessen Rücken man so viel besser nach mehr Macht grabschen kann.

permalink
report
reply

Absolute Randgruppe, aber als jemand, der mit GrapheneOS unterwegs ist:

Wäre toll, wenn Wero die Möglichkeit bietet, ohne Google Pay NFC Bezahlungen abzuwickeln.

permalink
report
reply