UDM Pro and Comcast

UDM Pro and Comcast

We have Comcast Xfinity cable internet. It is the only internet provider I can get. Because it is cable internet I am served my internet over a coaxial cable to an Arris modem, currently an under performing SBG7400AC2. This was a standard WiFi combo modem/router unit a long while ago. While it still functions it does not currently support the internet speeds we pay for. Nor the amount of wireless devices they have set upon it. The powers that be where I live refuse to upgrade, so they pay for speeds I cannot attain.

Well the router sucks as you would imagine, there is not much control over anything, and the wireless was severely lacking in performance. I have noticed that most household routers can only handle about 20 active clients before you start to really see an issue with speed and packet loss, pages timing out on you.

At work I occasionally deal with networking. I  was able to get my hands on and install and play with some Ubiquiti gear in the past few months. I ended up getting a Ubiquiti Universal Dream Machine Pro and a pair of UniFi Flex 5 port switches for myself to tinker with at my house. The special edition was a tad too expensive but I should have gotten that one in hind sight. The SE version adds all PoE ports (but only two PoE+ ports) and a 2.5GB port WAN1 instead of a 1GB port WAN1. Both have two 10GB SFP+ ports. AND, it seems the SE gets all the damn software updates first! What the fuck Ubiquiti??  I was able to talk the “management” into letting me use my UDM-Pro vs their current crappy Arris stuff and they agreed. So I installed a UDM-Pro and an U6-Lite access point. It was fantastic, the wireless coverage was now covering the entire house and the basement as well as it being capable of handling up to 300 devices. Fanfuckingtastic! The UDM-Pro also was achieving higher speeds (by about 200MB) with the modem in bridge mode rather than it handling the overhead of router as well. This worked great for a while, until I started to notice lots of high latency periods and moments of lack of connection.

View Post

Retrieving my IP address Remotely

Retrieving my IP address Remotely

I posted a few years ago about using Twilio and Node-Red to send/receive SMS messages. Using that flow you gain the ability to text your server and have it read back values. Any values you want, as long as you have them stored as a global some where along the way. If you haven’t already done it toss $20 on an account at Twilio for a year and get to it, its so worth it! Here I am going to add a new reading to my setup.

There are occasions when I need to access my home network when I am, well, not home. Everyone screams use a VPN! Yeah, of course, I have one, and I use it. But my problem is I have a dynamic WAN IP and I am not paying for a static IP. It doesn’t change very often but it always seems to when I need to use it the most. Step in Node-Red and Twilio. With both of those at my disposal I can now send a text message to my home server and have it respond with my WAN IP address. I can then modify my VPN settings on my phone or whatever if needed. Fucking fantastic! I had been using Twilio/NR for sensor readings and alerts but I had never thought about using it to report my IP. Theres a few ways to do this.

Lets grab our IP (the flow)

(This flow grabs the WAN IP via an exec node)

First we use an inject node and set it to fire off once on start, this grabs the IP first thing and makes sure we have some data to work with. Then we move off to an execute node. We are gonna execute some command line code and echo it back, then we’ll save it in a file and as a global. This goes in the exec node:

wget -qO- http://bot.whatismyipaddress.com/ ; echo

This goes out to whatismyipaddress.com and echoes back our IP, simple and very fast. There are a few other sites that can be used also. Ifconfig.io and ipinfo.io both are alternative sites (you just have to change the truncation from 5 to 6 characters to drop the return sign in the following function node).

Alternatively, and preferably we can use an HTTP node instead of an exec node. What? Yeah I just found this out.

(This flow grabs the IP via an HTTP node)

That will get you your WAN IP quickly via an HTTP node formats it then saves it to a file. We have to comment out the substring trimming command if we use the HTTP node over the exec node. Ok no problem. Don’t forget.

After we grab the IP we need to format it and save it as a global for Twilio (and Alexa!).

This will trim the returned output from the website to 6 characters, dropping off anything extra. It also saves our trimmed value as a global. Then we slap on a debug node and a file node to save the IP to a file for later use. You don’t have to save the IP to a file, I just like to in the even the server is restarted/power loss.

Thats it! Once the IP has been picked up and set as a global you are good to go (as long as you followed the other flow for Twilio I posted previously).

 

It figures…

After typing this up and saving the draft I decided to update NPM/nodejs/Node-Red. Upon updating I came across a Node-Red node, node-red-contrib-ip.

A simple install via Palette Manager (which doesn’t work for me) or manually installed via npm install node-red-contrib-ip and you’re good. The node works simply, nothing to configure. Add an inject node to trigger it and it spits out your machines IPv4 and IPv6 address and well as your WAN IP address. Just have to format the data the way you want and boom. I did notice it is slow, painfully slow. It doesn’t need to be lightning quick but it is noticeable compared to the wget option above. Choose your weapon, either method works. Heres the flow for using the IP node.

(This flow grabs the WAN IP via the node red IP node)

After the IP node put a function node and fill it with this code

This drops all the other node info and just gives us the WAN IP. Easy as pie.

 

Lets get notified

So far we check our IP every 12hrs and write it to a file and a global for use. Thats great, we can take it one step further. Want to get a notification when the IP does change? Lets go.

(This flow grabs the IP via an HTTP node and checks if it has been updated, then sends a notification if it has)

  • Inject and repeat every 24hrs at a set time
  • Read the stored IP address by reading the file
  • Get the current IP address and set it as a global
  • Cross check to see if the new IP matches the old IP and save it to a file if it is newer.
  • Format the message payload and send a notification (however you like, pushbullet, email, Twilio etc)

 

Check out this site, its where I got the notifications from https://steve.zazeski.com/get-a-notification-when-your-wan-ip-changes/.