I have a lot of devices connected to my home network, and like most modern computers, they automatically keep their system clocks correct by use of the Network Time Protocol (ntp), to connect, over the internet, to a very accurate central time server.

Many of the devices on my network phoned home to pre-set servers operated by their manufacturers – Ubuntu machines phoned Canonical servers, Macs and iOS devices phoned Apple, Windows phoned Microsoft. Since, in this post Snowden era we live in, we know for a fact that if something can be used to track you it will, and since I’ve been working to make my network as non-leaky as possible, by stopping all but authorised outgoing network connections, this seemed like something I should change.

My home server itself provides NTP, so there was no need for any other clients to talk to NTP servers elsewhere on the internet. Great, although it presents us with a number of problems:

  1. There are a lot of devices, and I’m lazy, so I don’t want to go around reconfiguring each device.
  2. While some devices allow you to easily change the timeserver, there are a bunch that don’t.
  3. I also want devices to be able to continue syncing themselves when connected to other networks.
  4. It would be nice if visitors to my network were afforded the same protection!

Remapping using Shorewall

Thankfully, I have shorewall running on a Linux box between my network and the wider internet, and also thankfully, NTP is fairly identifiable as a protocol, as it operates over UDP port 123.

So, using DNAT, I was able to remap any request to an outgoing NTP server on UDP port 123 from the network to my local server, using this line towards the end of my /etc/shorewall/rules file.

This has the effect of redirecting all NTP requests from the network, transparently, to my server, regardless of what servers the client believes it is talking to.

To verify, we can use the tool ntpdate -d to connect to a time server on a bogus, but still technically valid, IP address, e.g. 1.2.3.4 (the -d puts it in debug mode, so we won’t reset any clocks). The bogus IP will be transparently remapped, and we should get a lock.

Before remapping…

After remapping…

So, we can see that all network requests for ntp are now mapped to the local server on the quiet. A handy technique, and one I think I’ll start applying to some other protocols (I wonder if anyone has managed to reverse engineer icloud yet?).

LinkedIn-Logo-02

Known supports syndication to a number of silos (twitter, facebook etc), but since I also have some contacts on LinkedIn, I thought it would be handy to syndicate to them as well. So, I wrote a quick plugin to do just that…

Once installed and activated, you will need to get a LinkedIn application ID and secret key from the developer site (instructions in the plugin’s admin page). After you have entered these in the admin panel, users will have the option of authenticating their account and syndicating posts to LinkedIn.

The plugin currently supports status updates (although, in a rather limited way owing to LinkedIn’s API), article posts and images.

Give it a try!

» Visit the project on Github...

Following on from my last post about saving Facebook tagged photos to ownCloud, here’s a plugin that addresses my Flickr favourites rule.

This plugin, when set up on IFTTT, will use exactly the same mechanism to save any public photos I tag as a favourite on Flickr to my owncloud folder.

Here’s my flickrfaves.php