Skip to content

Commit

Permalink
Merge pull request #427 from domb84/master
Browse files Browse the repository at this point in the history
- Enable Meshnet routing and local network access
  • Loading branch information
bubuntux authored May 20, 2024
2 parents 6e4ca12 + 58b3cf1 commit e8c677d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ services:
* `CHECK_CONNECTION_INTERVAL` - Time in seconds to check connection and reconnect if need it. (300 by default) For example '- CHECK_CONNECTION_INTERVAL=600'
* `CHECK_CONNECTION_URL` - URL for checking Internet connection. (www.google.com by default) For example '- CHECK_CONNECTION_URL=www.custom.domain'
* `MESHNET` - Enable or Disable.
* `ALLOWLOCAL` - Comma delimited list of Meshnet devices you will allow to access this devices local network. For example 'ALLOWLOCAL=vpn-friction5976.nord,vpn-world2962.nord'
* `ALLOWROUTE` - Comma delimited list of Meshnet devices you will allow to route though this device. For example 'ALLOWROUTE=vpn-friction5976.nord,vpn-world2962.nord'
* `LAN_DISCOVERY` - on or off.


Expand Down
19 changes: 19 additions & 0 deletions rootfs/usr/bin/nord_config
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,25 @@ nordvpn set technology ${TECHNOLOGY:-NordLynx}
[[ -n ${MESHNET} ]] && nordvpn set meshnet ${MESHNET}
[[ -n ${LAN_DISCOVERY} ]] && nordvnp set lan-discovery ${LAN_DISCOVERY}

# Configue local network and routing allow list
if [[ -n ${MESHNET} ]]; then
allowedLocalHosts=${ALLOWROUTE}
if [[ -n ${allowedLocalHosts} ]]; then
IFS=',' read -ra allowed <<< "$allowedLocalHosts"
for host in "${allowed[@]}"; do
nordvpn meshnet peer local allow "${host}"
done
fi

allowedRoutingHosts=${ALLOWROUTE}
if [[ -n ${allowedRoutingHosts} ]]; then
IFS=',' read -ra allowed <<< "$allowedRoutingHosts"
for host in "${allowed[@]}"; do
nordvpn meshnet peer routing allow "${host}"
done
fi
fi

#[[ -n ${KILLSWITCH} ]] && nordvpn set killswitch ${KILLSWITCH} Killswitch is enabled by default using iptables

[[ -n ${PROTOCOL} ]] && nordvpn set protocol ${PROTOCOL}
Expand Down

0 comments on commit e8c677d

Please sign in to comment.