Making Sense of Location Based Services

Arch Linux OpenVPN Server on Raspberry Pi (part 2)

Once yaourt has been configured, download the “netcfg” package by issuing the following commands;

yaourt netcfg

There will be a list of programs that have netcfg as a search string. Choose the netcfg by the appropriate number:

If you are editor savvy then choose to edit the file before it is downloaded to suit your purposes. There will be a prompt to delete the network package (netctl) which is automatically shipped with Arch. Accept the changes.

Setting up the network on for the OpenVPN server

A quick word about subnets –

The setup is a client to site bridge and as a consequence the client is connecting to the servers network. To avoid conflict in connection, the server subnet should be different from the client subnet. To illustrate by example, if the client subnet is of the following configuration 192.168.1.0/24, then the server subnet should be 172.17.173.0/24 to avoid a routing conflict. So if the server subnet is 192.168.1.0/24 then there would be a routing conflict.

The genreral advice is that the server subnet should be of a non-standard subnet with the folowing choice:

10.0.0.0 – 10.255.255.255

172.16.0.0. – 172.31.255.255

192.168.0.0 – 192.168.255.255

The network configuration can be easily be changed in the network configuration for the wireless router.

If using linux, information of the network configuration can easily be found using the following commands via CLI;

iwconfig

ifconfig

ip route

Setting up a static IP Address

This setup uses the “netcfg” framework to manage the network connections, which include the following;

A VPN tap adapter

A Bridge adapter

Ethernet which is already handled by the bridge adapter.

As mentioned previously, the Arch setup is a CLI affair. Use Nano (editor) to open a new file called bridge. To do this change into the directory and create the file entitled bridge via the following commands;

cd /etc/network.d

nano bridge

Then type the following exactly apart for your own network values;

INTERFACE=”br0”

CONNECTION=”bridge”

DESCRIPTION=”VPN Bridge Connection”

BRIDGE INTERFACES=”eth0”

IP=’static’

ADDR=’192.168.1.0′

NETMASK=’24’

GATEWAY=’192.168.1.254′

DNS=’192.168.1.254′

the file is saved by CTRL + O and then exit out of the editor (CTRL+X). The VPN Adapter is added at a later stage.

The next step is to configure which profile netcfg will load by editing the following file;

/etc/conf.d/netcfg

and configuring the networks as follows:

NETWORKS=(bridge)

Save and exit nano. The next step is to disable DHCP and enable the ethernet static IP address by the following commands:

systemctl disable dhcpd@eth0.service

systemctl enable netcfg.service

Reboot the Pi to enable the changes.

part 3 to follow

Latest Posts

  • RFID, Raspberry Pi & LBS
    The experimentation with Raspberry Pi goes on. RFID is the next stage in effective Indoor Location Based Services and to understand this the following is a small project that brings RFID to the Raspberry Pi. A brief history of the...
    Read more
  • Hacking Location Based Services & IoT with the Raspberry Pi
    Introduction There are very exciting topics that influenced me over the past few years namely Location Based Services (LBS), The Internet of Things (IoT) and the humble Raspberry Pi.  But first a brief background – I am not a technical...
    Read more
  • Arch Linux OpenVPN Server on Raspberry Pi (part 2)
    Once yaourt has been configured, download the “netcfg” package by issuing the following commands; yaourt netcfg There will be a list of programs that have netcfg as a search string. Choose the netcfg by the appropriate number: If you are...
    Read more
Linux Format Magazine
LBSZone

Twitter: global_lbs