Setup ppp0 for spacebridge only

Hi Everyone,
I was happy to see some updates to the nova and sdk since last time I used them. I have a nova setup as a backup SSH connection to a monitoring system. I use spacebridge to connect via the cellular network in the case the ethernet is down. The system runs Ubuntu 18. I was able to get everything working - so that was great. The issue I have now is it seems that ALL traffic is being routed over the ppp0 connection after hologram network connect.

I wanted to bring this up because it could result in very high data usage. I am also wondering if anyone has any advice on configuring the ppp connection to only be used for incoming ssh connections tunneled over spacebridge.

Thanks,
Tyler

Hi @Tyler_C,

The gist is that the default route (via ppp0) should be able to be deleted and replaced with a different default route; but, for completion’s sake, can you post the output of ip route (you can mask the ppp0 NIC’s IP address for privacy if you want)?

Best,
PFW

Hi Pat!
Sure - that’s along the lines of what I figured. I wanted to make sure I am using the SDK correctly and there is not a built in way to connect for spacebridge only. Here it is.

tycon@zm:~$ ip route
default via 10.64.64.64 dev ppp0  proto static
default via 192.168.1.1 dev eno1  proto static  metric 100
10.64.64.64 dev ppp0  proto kernel  scope link  src 10.x.x.x
10.176.0.0/16 via 10.64.64.64 dev ppp0  proto static
10.254.0.0/16 via 10.64.64.64 dev ppp0  proto static
169.254.0.0/16 dev eno1  scope link  metric 1000
192.168.1.0/24 dev eno1  proto kernel  scope link  src 192.168.1.5  metric 100

What would be the procedure here - use the sdk to connect, then delete the route and replace it?

Try the hologram spacebridge command. I think this one only sets up the bare minimum routes needed for spacebridge messages to work

Yes - perfect. I thought maybe that command was depricated as I didn’t see it here: https://support.hologram.io/hc/en-us/articles/360035212654-Spacebridge-for-beginners

I should have tried that first. Thanks Reuben.

Unfortunately I am still running into this issue Spacebridge CPU usage
with the hologram spacebridge command.


I was able to determine the high cpu is realated to something in this method hologram-python/CustomCloud.py at 582c8dca01dc333d03956868adbf53702900d9f3 · hologram-io/hologram-python · GitHub
I have the M1 nova - maybe I need to upgrade the firmware?

Wanted to share a quick script to connect to spacebridge when an internet outage occurs. I just added the script to cron to run once a minute. Not perfect but it works for this use case.

wget -q --spider http://google.com

if [ $? -eq 0 ]; then
	pgrep -fl "/usr/bin/python3 /usr/local/bin/hologram spacebridge"
	if [ $? -eq 0 ];
	then
	  echo `date` "Internet up - Stopping Spacebridge processes..."
	  pkill -f "/usr/bin/python3 /usr/local/bin/hologram spacebridge"
	  /usr/bin/python3 /usr/local/bin/hologram network disconnect
	fi
else
	PSN=`netstat -peanut | grep ":4010 " | wc -l`
	IP='10.171.23.70'
	
	if ping -c1 $IP 1>/dev/null 2>/dev/null
	then
		exit 0
	else
		echo `date` "Internet down - Starting Spacebridge..."
		/usr/bin/python3 /usr/local/bin/hologram spacebridge & disown
	fi
	
fi