2024-07-04, 02:13 PM
(This post was last modified: 2024-07-04, 02:15 PM by mildlyjelly. Edited 1 time in total.)
(2024-07-04, 05:30 AM)meltham Wrote: Thank you both for your assistance and explanations. I have managed to get around this using a reverse proxy on another device in the network, just like the way mildlyjelly suggested.
mildlyjelly - how have you managed to create a custom firewall rule to override the VPN's rule? I am also running on Linux, and would be interested in seeing what you did there, as Jellyfin isn't the only thing I intend to host from the same device.
Thanks again.
The specifics will depend on how your VPN works and what distribution you are using. My VPN creates a new network device called "ext0" and creates firewall rules to restrict all traffic through other interfaces. It also creates an IP route to send all non local network traffic to "ext0".
On ubuntu, you can see your network interfaces using the command:
Code:
ip a
I use iptables to control the firewall, but there are other tools that might be easier to use such as UFW (Uncomplicated Firewall).
You can use this command to see your firewall rules:
Code:
iptables -vnL
In my case, my input chain policy gets set to DROP all traffic, and rules are created to allow traffic to local machines and through "ext0".
I am able to add new rules in front of the existing ones (they are checked from top to bottom) to accept port 8096 traffic from anywhere using a command similar to this one:
Code:
iptables -I INPUT 1 -i eth0 -p tcp --dport 8096 -j ACCEPT
Similarly, I need to add a rule to allow traffic in output chain using a command like this:
Code:
iptables -I OUTPUT 1 -o eth0 -p tcp --sport 8096 -j ACCEPT
Depending on what you want to do and how your VPN configures the ip routes, you may need to add new rules here too. These are handled by the kernel and the only thing they do is decide which network interface to send traffic to.
You can see your ip routes using this command:
Code:
ip route show
In my case, I needed to add an IP route like this to route local traffic to eth0 instead of ext0, like this:
Code:
ip route add 192.168.1.0/24 via 192.168.1.1 dev eth0 onlink table 0
https://www.digitalocean.com/community/t...wall-works
https://www.digitalocean.com/community/t...d-commands
https://www.baeldung.com/linux/route-tra...-interface