Category Archives: Network

Raspberry Pi 3 error IPTables | Raspberry pi error – iptables v1.4.21: can’t initialize iptables table `nat’: Table does not exist (do you need to insmod?)

Was building a RPi3 machine and got the following error after an update.

Turns out nothing to worry about, just reboot the Pi.

Building a useful .ssh/config file for your SSH connections | setup to configure your .ssh/config file!

Writing a good ssh config file can make your life a whole lot easier especially if your an Linux Admin.

I have written a basic config file below which should be saved in the following location “~/.ssh/config”, when attempting to ssh its the first place SSH looks for instructions by default.

After the config if will go through in detail explain what each line does.

Host: this is like an alias, it will once you attempt to ssh to it, it will resolve using the Hostname field.

Hostname: Look above

Port: The port the ssh server is running on

User: the username you have on the server

Identityfile: This is your SSH private key location

ForwardX11: This is to allow you to see an X GUI session from the remote computer.

Keepalive: the next three are to enable keepalive which will ensure your SSH session stays active even after a period of inactivity. The two subsequent options enable you to configure the frequency of the keepalive packets.

Compression: this enables compression, this is especially useful over slow links. You will need to do more research for the senario which suits your connection and security requirements.

DynamicForward: This enables you to tunnle your connection to the remote host on the specified port. Simply setup your browser on socks5 proxy and point to localhost:port.

LocalForward: This enables you to setup tunneling. Simply specify your local reserved port and your remote IP and port which you want tunneled.

Get an email when your public IP changes | get notified when your public ip changes.

Alot of us have ISPs which change your IP address and you may not want to setup a client with a dynamic IP or want a backup in case the services fails.

So i developed a bash script which checks to see if your public IP has changed. If it has it will log it and email you the new IP.

See below.

 

 

How to determine what your DHCP server is on Linux | how to determine your dhcp server ip address

I encountered a problem yesterday where my IP was not changing, I should have gotten a new lease from the DHCP server.

I needed to find which server was giving me my leases, I didn’t know where this information was stored.

Anyway, its here!

It should give you information like this, look around because different flavors of Linux will store the lease in a different location.

 

Visibility when your IP changes and is updated by no-ip | email notification when ip changes home adsl nbn bash script

My new internet connection with NBN changes the IP on a regular basis, but I wanted visibility as to how often.

So I’ve written a bash script which records your IP and date, once it changes it records your new IP and sends you an email to notify you of the new change.

This is completed by querying your no-ip dns record.

Usage

 

Cron Entry. (runs every hour)

 

 

How to mount NFS in a Docker Ubuntu container | mounting nfs shares in docker containers

I had problems mounting NFS shares in my docker container, error would appear with permissions denied. This is the fix which worked for me.

Inside the container execute the following.

on the host execute the following to mount the share.

 

Solaris setup a NFS client and server | making a NFS client server environment in solaris

A quick howto for setting up NFS on a Solaris server.

This is relatively easy process, sometimes can be problematic due to firewall rules and services running on the system

Lets enable and start the services.

This will create the create and share it to the world, for this exercise I didnt specify source IP’s. You can do that later once you have everything working.

To confirm the share is now active

Ok now jumping on the client side, lets mount the share.

Lets see the mount

Done! Enjoy!

Installing and configuring MediaWiki on Raspberry Pi 1 | Setup mediawiki on a raspberry pi 1

MediaWiki is the software used by Wikipedia run, its a fantastic way to document share.

I would recommend installing DNSMasq to allow as to use fully qualified domain names. See here.

Setting up Mediawiki is a pretty simply task, does not really require a high level of experience. Lets dig in, install software.

Once completed we start setting up the housing for MediaWiki, the following will also download the software from MediaWiki’s site and unzip it.

Then we’ll need to setup the database and user permissions.

Now we’ll begin the Mediawiki installation, easy part. Navigate to the following URL and start the point and click install.

Once connected you’ll see this.

Click on the “Set up the wiki” link, follow the instructions and enter all the information it requires. Take note, youll need the database,username and password we input earlier. Once it has finished it will let you download the LocalSettings.php file to your computer. You’ll need to upload it to the /var/www/html/wiki directory.

Lets create the DNS entries.

Insert the following line

Now restart DNSMasq

We also need to setup the virtual host in apache

Insert the following line

Restart apache.

Make sure your connected to the AP while your setting up, otherwise the setup will use the LAN IP to setup the config file.

Enjoy!

How to setup hostapd and dnsmasq on a Raspberry Pi 1 | setup wifi access point on a raspberry pi 1 with hostapd and dnsmasq

I decided to setup Hostapd and DNSMasq on my Raspberry Pi 1 as part of a bigger project. This makes an awesome project to setup a router. See below.

This will install the applications.

Lets block DHCPd by editing

Add this line to the bottom.

Lets setup Hostapd

Enable the hostapd.conf config.

Ensure the following live is present.

Paste the following into the configuration file, ensure you change the sections which relate to you. Pay attention to ssid and wpa password.

Lets setup DNSMasq.

Put the following into the config file.

Now we enable IP forwarding on a system level

Uncomment the following line

Setup the IPtables NAT rules

Lets save the IPTables rules permanently.

Lets ensure they run on reboot

and ensure the following is present before the “exit 0”.

Reboot and your done!

 

 

 

Powerbank endurance test for Raspberry Pi 3. | testing how long a raspberry pi can be powered via a powerpank

Iv like to test and know how much uptime can be achieved by different powerbank.

I purchased this powerbank case on ebay and then purchased the 18650 3.7v batteries separately.

I have built two powerbank with identical cases but different batteries. 

  • Powerbank – $5.35
  • Batteries 18650 9600mha – $24.80
  • Batteries 18650 6000mha – $22.49

The results?

  • Batteries 18650 9600mha – 23 Hours
  • Batteries 18650 6000mha – 18 Hours

It should also be noted that the Raspberry Pi is online via wifi during the whole test while getting pinged every minute.