• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support General Questions Cannot connect externally when server is connected to a VPN

     
    • 0 Vote(s) - 0 Average

    Cannot connect externally when server is connected to a VPN

    mildlyjelly
    Offline

    Junior Member

    Posts: 31
    Threads: 2
    Joined: 2024 Jun
    Reputation: 4
    #5
    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
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    Messages In This Thread
    Cannot connect externally when server is connected to a VPN - by meltham - 2024-07-02, 09:09 PM
    RE: Cannot connect externally when server is connected to a VPN - by TheDreadPirate - 2024-07-02, 09:17 PM
    RE: Cannot connect externally when server is connected to a VPN - by mildlyjelly - 2024-07-02, 11:03 PM
    RE: Cannot connect externally when server is connected to a VPN - by meltham - 2024-07-04, 05:30 AM
    RE: Cannot connect externally when server is connected to a VPN - by mildlyjelly - 2024-07-04, 02:13 PM
    RE: Cannot connect externally when server is connected to a VPN - by meltham - 2024-07-05, 08:42 PM
    RE: Cannot connect externally when server is connected to a VPN - by mildlyjelly - 2024-07-10, 05:56 PM

    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode