Skip to content

Commit

Permalink
Merge pull request #11 from bechampion/split
Browse files Browse the repository at this point in the history
NOJ - split file - change config file location
  • Loading branch information
gr211 authored Jun 27, 2024
2 parents 959d0f2 + f2099e0 commit c6303ba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ Download and install `gohip` from the [releases page](https://github.com/bechamp

# Usage

Create a file in your home directory called `.splitvpn` with the following content:
Create file `/etc/vpnc/splitvpn` with the following content:

MAIN_DEV="enp0s31f6" # Your main network interface
GW="192.168.1.254" # Your gateway

You can determine those values with

ip -json r get 1.1.1.1 | jq '.[]| "DEV=\"\(.dev)\" \nGW=\"\(.gateway)\""' -r
ip -json r get 1.1.1.1 | jq '.[]| "MAIN_DEV=\"\(.dev)\" \nGW=\"\(.gateway)\""' -r

Then start the vpn client with

sudo -E gpclient connect --hip --csd-wrapper /usr/bin/gohip vpn.endpoint.com
sudo -E gpclient connect --hip --csd-wrapper /usr/bin/gohip vpn.endpoint.com
10 changes: 6 additions & 4 deletions build-aux/scripts/split.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

set -e

if [[ ! -f $HOME/.splitvpn ]]; then
echo "$HOME/.splitvpn does exist. Please create it with the following content:"
CONFIG_FILE=/etc/vpnc/splitvpn

if [[ ! -f $CONFIG_FILE ]]; then
echo "$CONFIG_FILE does exist. Please create it with the following content:"
cat << EOF
# beginning
Expand All @@ -12,13 +14,13 @@ GW="192.168.1.254" # Your gateway
# end
You can determine those values with
ip -json r get 1.1.1.1 | jq '.[]| "DEV=\"\(.dev)\" \nGW=\"\(.gateway)\""' -r
ip -json r get 1.1.1.1 | jq '.[]| "MAIN_DEV=\"\(.dev)\" \nGW=\"\(.gateway)\""' -r
EOF
exit 1
fi

. ${HOME}/.splitvpn
. $CONFIG_FILE

DISNEY_NET="10/8"
VPN_DEV="tun0"
Expand Down

0 comments on commit c6303ba

Please sign in to comment.