0

I’m trying to allow my mobile device to connect from everywhere, Wi-Fi or not to an specific port of my Linux server which is running a webmin service.

I’m using iptables to set some rules to which IP addresses can connect to that port for example my house.

I don’t what any other device or IP to connect to my server's webmin service so I drop every other connection with the iptables. Also my house ipadress changes every now and then and this is a problem since I have to update the rule as a result.

However I wish to connect through my phone with mobile data or Wi-Fi.

The MAC address isn't an option since the device will be changing internet connections and this is undetectable through browser.

So the questions is, is there a way to identify an specific device request to let it access or not to my server?

Giacomo1968
  • 3,522
  • 25
  • 38
AmirG
  • 103
  • 3
  • **“The MAC address isn't an option since the device will be changing internet connections and this is undetectable through browser.”** What do browsers have to do with `iptables`? I posted an answer showing how `iptables` and be used to handle MAC address filtering. Pretty cool stuff. – Giacomo1968 Oct 08 '14 at 21:43

2 Answers2

5

You have a few options:

  1. You can use SSH to either set up a tunnel or a SOCKS proxy.
  2. You can set up a VPN service on your router and configure your mobile device to sign into the VPN, giving you access to your private network.
  3. You can set up a reverse proxy and set up authentication through it, using either password or key based authentication.
  4. You can set up port knocking.

Using a SOCKS proxy over SSH is the simplest solution. If you eventually want to have more access to your network (not just HTTP access) then a VPN solution would be a great way to go.

Gene
  • 3,633
  • 19
  • 39
  • 2
    A VPN is the best way to go. Near-native performance, allows all protocols, full access, authentication, etc. – Avery Payne Oct 08 '14 at 22:28
1

This required type of technique is called port knocking:

In computer networking, port knocking is a method of externally opening ports on a firewall by generating a connection attempt on a set of prespecified closed ports. Once a correct sequence of connection attempts is received, the firewall rules are dynamically modified to allow the host which sent the connection attempts to connect over specific port(s).

Giacomo1968
  • 3,522
  • 25
  • 38
mailq
  • 16,882
  • 2
  • 36
  • 66