Feeds:
Posts
Comments

Posts Tagged ‘Kernel’

What is Keepalived ?

Keepalived is a routing software written in C. The main goal of this project is to provide simple and robust facilities for loadbalancing and high-availability to Linux system and Linux based infrastructures. Loadbalancing framework relies on well-known and widely used Linux Virtual Server (IPVS) kernel module providing Layer4 loadbalancing. Keepalived implements a set of checkers to dynamically and adaptively maintain and manage loadbalanced server pool according their health. On the other hand high-availability is achieved by VRRP protocol. VRRP is a fundamental brick for router failover.

Visit here for more details : http://www.keepalived.org/

Pre-requirements

  1. Additional Packages required to build/compile keepalived from sourcesudo apt-get install build-essential libssl-dev keepalived psmisc
  2. Move Installed keepalivedmv /usr/sbin/keepalived /usr/sbin/keepalived.orig
  3. Change keepalived service script:

    vi /etc/init.d/keepalived

    Modify the path: “DAEMON=/usr/sbin/keepalived” to “DAEMON=/usr/local/sbin/keepalived”

  4. Need Additional 1 Virtual IP(VIP) address on top of existing IP

Download Source Code

sudo apt-get install wget

wget wget http://www.keepalived.org/software/keepalived-1.2.13.tar.gz

tar -zxvf keepalived-1.2.13.tar.gz

Build and Install from Source Code

cd keepalived-1.2.13
./configure
make
make install
keepalived -v
Keepalived v1.2.13 (11/30,2016)

Start Keepalived

/etc/init.d/keepalived start

Or

service keepalived start/restart/stop

Error :

Nov 30 15:25:39 node-2 Keepalived[14392]: Starting Keepalived v1.2.13 (11/30,2016)
Nov 30 15:25:39 node-2 Keepalived[14393]: Starting Healthcheck child process, pid=14395
Nov 30 15:25:39 node-2 Keepalived[14393]: Starting VRRP child process, pid=14396
Nov 30 15:25:39 node-2 Keepalived_healthcheckers[14395]: Initializing ipvs 2.6
Nov 30 15:25:39 node-2 Keepalived_vrrp[14396]: Registering Kernel netlink reflector
Nov 30 15:25:39 node-2 Keepalived_vrrp[14396]: Registering Kernel netlink command channel
Nov 30 15:25:39 node-2 Keepalived_vrrp[14396]: Registering gratuitous ARP shared channel
Nov 30 15:25:39 node-2 Keepalived_vrrp[14396]: Opening file ‘/etc/keepalived/keepalived.conf’.
Nov 30 15:25:39 node-2 modprobe: ERROR: ../libkmod/libkmod.c:556 kmod_search_moddep() could not open moddep file ‘/lib/modules/3.19.0-26-generic/modules.dep.bin’
Nov 30 15:25:39 node-2 Keepalived_vrrp[14396]: Configuration is using : 63166 Bytes
Nov 30 15:25:39 node-2 Keepalived_vrrp[14396]: Using LinkWatch kernel netlink reflector…
Nov 30 15:25:39 node-2 Keepalived_vrrp[14396]: VRRP_Instance(V1) Entering BACKUP STATE
Nov 30 15:25:39 node-2 Keepalived_healthcheckers[14395]: IPVS: Can’t initialize ipvs: Protocol not available
Nov 30 15:25:39 node-2 Keepalived[14393]: Healthcheck child process(14395) died: Respawning

Solution:

sudo modprobe ip_vs

service keepalived restart

Further Details will be updated, stay tuned.

 

 

Advertisements

Read Full Post »

What is FitPC2i ?

fit-PC2 is a miniature fanless PC based on Atom CPU. It is extremely small and extremely energy efficient, but still packs the full set of PC features. fit-PC2 is made of an embedded grade motherboard in a die-cast aluminum shell. Here is FitPC2i Spec.

Step0: Install Ubuntu 12.04.5 Linux(32-bit)
Install Ubuntu 12.04-5 Server OS into FitPC2i from here

Step1: AP Mode supported?
Verify your wireless adapter supports Access Point mode. Install “iw” tool to verify the AP mode support. Execute following command to know the same

sudo apt-get -y install iw
iw list | grep -8 “Supported interface modes:”

max scan IEs length: 2257 bytes
Coverage class: 0 (up to 0m)
Supported Ciphers:
* WEP40 (00-0f-ac:1)
* WEP104 (00-0f-ac:5)
* TKIP (00-0f-ac:2)
* CCMP (00-0f-ac:4)
Available Antennas: TX 0 RX 0
Supported interface modes:
* IBSS
* managed
* AP
* AP/VLAN
* WDS
* monitor
* mesh point
software interface modes (can always be added):

If you are able to see “AP” in the supported modes, then your Wi-Fi interface(wlan0) can act as a Access Point using hostapd.

Step2:Install dependency packages
sudo apt-get install -y libnl-3-dev libssl-dev

Step3: Compiling Hostapd-2.3 from source code
wget http://w1.fi/releases/hostapd-2.3.tar.gz
tar zxvf hostapd-2.3.tar.gz
cd hostapd-2.3/hostapd

#copy the default config file like we used to copy the kernel configuration file before build.
cp defconfig .config

#Add this line to “.config” file CONFIG_LIBNL32=y
make
.. .. .. CC ../src/drivers/driver_common.c /usr/bin/ld: cannot find -lnl-genl-3 collect2: ld returned 1 exit status make: *** [hostapd] Error 1

Solution
sudo ln -s /lib/libnl-genl-3.so.200.3.0 /lib/libnl-genl-3.so
#Re-make again to complete the compilation
make

#Its Done!, Activate You Own Wi-Fi AP at your Home/Small Office.

Step4: hostapd.conf <– Your AP configurations

#set general/minimum configuration
interface=wlan0
hw_mode=g
driver=nl80211
utf8_ssid=1
ssid=”தமிழ்”
channel=2

Step5: Run hostapd along with hostapd.conf
sudo ./hostapd -d hostapd.conf

Step6: Connect from your Android mobile or laptop and check it.

We will discuss further with more AP configuration details soon.

Read Full Post »

 

Connman using systemctl

 

If you are dealing with Embedded systems or IVI systems running Tizen or Meego Linux OS.

This guide will help you to assign static IP address manually using Connman. It is nothing but Connection Manager for Etehrnet, Wifi, Bluetooth and Wifi Direct connections.

The following steps were experimented on

Dev Board: Intel x86 platform(i386 )

OS: Tizen + Meego for IVI Systems

Linux Kernel: 3.8.xx

 

1. Go to this directory: This directory contains may pythons scripts.

root@localhost:~> cd /usr/lib/connman/test

 

2. Check the Existing Ethernet Configuration 

root@localhost:/usr/lib/connman/test> ./list-services
[ ethernet_e840f2d1c0c6_cable ]
IPv6.Configuration = { Method=off }
AutoConnect = true
Name = Wired
Nameservers = [ ]
Provider = { }
Favorite = true
Domains.Configuration = [ ]
Timeservers.Configuration = [ ]
State = ready
Proxy = { Method=direct }
Nameservers.Configuration = [ ]
IPv4 = { Netmask=255.255.255.0 Method=dhcp Address=192.168.2.15 }
Timeservers = [ ntp.meego.com ]
IPv6 = { }
Domains = [ ]
Ethernet = { Interface=eth0 MTU=1500 Method=auto Address=E8:40:F2:D1:C0:C6 }
Security = [ ]
Proxy.Configuration = { }
Type = ethernet
Immutable = false
IPv4.Configuration = { Method=dhcp }

 

3. Assign Static IP address, Netmask and Gateway Addresses.

Here you should use the interface name from the above output, for Ethernet you should use  “ethernet_e840f2d1c0c6_cable” like this, for you it may different Ethernet name.

root@localhost:/usr/lib/connman/test>./set-ipv4-method ethernet_e840f2d1c0c6_cable manual 192.168.2.15 255.255.255.0 192.168.2.1
Setting method manual for ethernet_e840f2d1c0c6_cable
New IPv4.Configuration:  {‘Netmask’: dbus.String(u’255.255.255.0′, variant_level=1), ‘Gateway’: dbus.String(u’192.168.2.1′, variant_level=1), ‘Method’: dbus.String(u’manual’, variant_level=1), ‘Address’: dbus.String(u’192.168.2.15′, variant_level=1)}

 

4.Check the New IP Address

root@localhost:/usr/lib/connman/test> ./list-services
[ ethernet_e840f2d1c0c6_cable ]
IPv6.Configuration = { Method=off }
AutoConnect = true
Name = Wired
Nameservers = [ ]
Provider = { }
Favorite = true
Domains.Configuration = [ ]
Timeservers.Configuration = [ ]
State = ready
Proxy = { Method=direct }
Nameservers.Configuration = [ ]
IPv4 = { Netmask=255.255.255.0 Gateway=192.168.2.1 Method=manual Address=192.168.2.15 }
Timeservers = [ 192.168.2.1 ntp.meego.com ]
IPv6 = { }
Domains = [ ]
Ethernet = { Interface=eth0 MTU=1500 Method=auto Address=E8:40:F2:D1:C0:C6 }
Security = [ ]
Proxy.Configuration = { }
Type = ethernet
Immutable = false
IPv4.Configuration = { Netmask=255.255.255.0 Gateway=192.168.2.1 Method=manual Address=192.168.2.15 }

 

5. Assign Name-Servers Address

root@localhost:/usr/lib/connman/test> ./set-nameservers ethernet_e840f2d1c0c6_cable 192.168.2.5 192.168.2.6
Setting name-server to [‘192.168.2.5’, ‘192.168.2.6’]

 

6. Assign Proxy of XXXX Company
root@localhost:/usr/lib/connman/test> ./set-proxy ethernet_e840f2d1c0c6_cable auto url=http://xxx.yyyyy.co.jp/pac/proxy.pac

 

7. Check All the Configuration
root@localhost:/usr/lib/connman/test> ./list-services

Read Full Post »

What is Wi-Fi Direct ?

Wi-Fi Direct nothing but Wi-Fi Peer-to-Peer[P2P] Communication without using wireless AP[Access Point]. Wi-Fi Direct standard Developed by Wi-Fi Alliance group and it act as a “Soft AP” with WPA2-PSK security features.

What are all software required for Wi-Fi P2P operations ??

  1. wi-fi NIC Driver – kernel driver module
  2. cfg80211 –> 80211 configuration
  3. iw – wireless Tool for configuration
  4. libnl – Network Link Library
  5. wpa_supplicant –> Manages P2P operations at user-space
  6. wpa_cli  – client tool to interact with wpa_supplicant in daemon mode.

 

On Android  from ICS – wpa_supplicant V0.8.x supports Wi-Fi Direct.

  • You need to install libnl and openssl libraries for wpa_supplicant

 

On Ubuntu – wpa_supplicant V1.1 supports Wi-Fi Direct.

  • You need to install libnl and openssl libraries for wpa_supplicant

 

Here my continuation posts.

Read Full Post »