Jump to content
Not connected, Your IP: 3.146.255.127
Sign in to follow this  
vpnaccountonpc

An iptables Command for Encrypting a Shared Device

Recommended Posts

I wanted to make a post giving a command that I struggled to find for using AirVPN to encrypt a shared device while using a firewall. I'm sharing a gaming console through a laptop so that I can encrypt and firewall the console. On the laptop I'm using Ubuntu 18 and OpenVPN.

The command is:
iptables -t nat -A POSTROUTING -o tun+ -j MASQUERADE

I'm guessing this causes the decrypted packets to return to the console as opposed to the laptop, but I don't really understand how the tun interface works.

Aside from that, make sure the tun interface is being accepted in all tables in both directions. For a bit of extra security, I'm specifying that incoming packets on the tun interface are part of ESTABLISHED or RELATED connections, except in the PREROUTING chain. (I don't remember if I removed connection tracking from PREROUTING because I had to or if it was an accident. Maybe iptables won't recognize those packets as ESTABLISHED or RELATED because they're NATted.)

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image
Sign in to follow this  

×
×
  • Create New...