# Help me implement mullvad kill switch with ufw

**URL:** https://discuss.privacyguides.net/t/help-me-implement-mullvad-kill-switch-with-ufw/28768
**Category:** Questions
**Created:** 2025-06-30T20:46:39Z
**Posts:** 5

## Post 1 by @csq — 2025-06-30T20:46:39Z

I am trying to implement kill switch with ufw. Here are the rules:

```
ufw default deny incoming
ufw default deny outgoing

ufw allow in on wg0-mullvad from any to any
ufw allow out on wg0-mullvad from any to any

ufw allow out to <ip> proto udp
ufw allow from <ip> proto udp

ufw enable
```

I also execute `mullvad relay set location ...` to some hostname. \<ip\> is the “out” (endpoint) ip. But when I disconnect, I cant reconnect back to vpn unless I disable ufw. Please help me fix it.

---

## Post 2 by @anon57862721 — 2025-06-30T22:11:23Z

Their supposed pages should answer your question. Please research more.

---

## Post 3 by @csq — 2025-07-01T07:33:04Z

Sorry, I couldn’t find anything related to my question on the net. If you know something, please guide me there

---

## Post 4 by @anonymous364 — 2025-07-01T07:37:34Z

Why are you doing this? Just use the built in lockdown feature: `mullvad lockdown-mode set on`

---

## Post 5 by @csq — 2025-07-01T07:50:35Z

Recently I read an article and it was shown that mullvad leaks on reboot. So I want to have more stable solution
