4 in 1 fast config of DHCP NTP NFS and RSYSLOGD for me

Step 1 –> I need a DHCP server for multiple subnets, here is the config

->To install DHCP packages
sudo apt-get install isc-dhcp-server

->To set which interface will listen DHCP requests
sudo vi /etc/default/isc-dhcp-server

->Here configure INTERFACES=”” section for multiple interface use like this INTERFACES=”eth1 eth2″

->Do some config for subnets , i did not change something about general just added the lines end of the file

sudo vi /etc/dhcp/dhcpd.conf

# vCenter Site A Mng Block
subnet  netmask {
option routers        ;
option subnet-mask    ;
option broadcast-address;
option domain-name-servers;

->To see the dhcp deamon
sudo service isc-dhcp-server start

->To see the process
dhcpd     1705     1  0 11:35 ?        00:00:00 dhcpd -user dhcpd -group dhcpd -f -q -4 -pf /run/dhcp-server/dhcpd.pid -cf /etc/dhcp/dhcpd.conf eth1

->To see the leases
cat /var/lib/dhcp/dhcpd.leases

Thats it !

Step 2 –> I need a Local Time Server because my nodes do not have internet connectivity

-> To install ntp packages

sudo apt-get install ntp

-> Jump in to config , i changed already ubuntu time server with my local
vi /etc/ntp.conf

-> These are for Turkey local NTP provider

# Specify one or more NTP servers.

# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
# more information.
server ntp1.ulakbim.gov.tr
server ntp2.ulakbim.gov.tr

-> These are default don’t touch

# By default, exchange time with everybody, but don’t allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery

->Add you nodes network to query time from you

# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict mask notrust
restrict mask nomodify notrap
restrict mask nomodify notrap

->Start the service

noroot@ubudhcpdns:~$ sudo /etc/init.d/ntp restart
* Stopping NTP server ntpd                                                                                                                                           [ OK ]
* Starting NTP server ntpd

-> Query it
noroot@ubudhcpdns:~$ ntpq -c lpeer
remote           refid      st t when poll reach   delay   offset  jitter
+samur.ulak.net.    2 u  565   64    0    9.141    3.471   0.184
*    2 u   97   64  326    9.018    2.773   1.273
juniperberry.ca .INIT.          16 u    –  512    0    0.000    0.000   0.000

->I used it for local ESX i nodes, check it

[root@vCENTER-sITE-a:~] ntpq -p
remote           refid      st t when poll reach   delay   offset  jitter
*   3 u   51   64  377    0.072    8.987   0.408

Thats it !

Step 3 –> I need a iso store , install nfs and share it

-> To install ntp packages
noroot@ubudhcpdns:~$ sudo apt-get install nfs-kernel-server

-> Configure export , first create the folder start to upload iso files and then export it

sudo vi /etc/exports

/isos  *(ro,sync,no_root_squash)

noroot@ubudhcpdns:/$ sudo /etc/init.d/nfs-kernel-server start
* Exporting directories for NFS kernel daemon…                                                                                            exportfs: /etc/exports [1]: Neither ‘subtree_check’ or ‘no_subtree_check’ specified for export “*:/isos”.
Assuming default behaviour (‘no_subtree_check’).
NOTE: this default has changed since nfs-utils version 1.0.x

[ OK ]
* Starting NFS kernel daemon

Thats it !

Step 4 –> Configure rsyslogd to convert your server central logging

–> First create a folder name “loggs” then change the owner of it

noroot@rabbitmq:/var/log$ sudo chown syslog:adm /logss

Above i used syslog:adm because under /var folder some of folders owner set like that

–> Edit rsyslogd.conf and add/changes realated lines

(myself i activated udp/tcp together)
# provides UDP syslog reception

$ModLoad imudp

$UDPServerRun 514

# provides TCP syslog reception

$ModLoad imtcp

$InputTCPServerRun 514

and add such lines end of the file

# Dynamic Remote Loggin Config

$template FILENAME,”/logss/%fromhost-ip%/syslog.log”


–> Restart rsyslogd and try you get the logs or not !

Some notes :

its possible to use %PROGRAMNAME% tag for file creation

*.* ?FILENAME –> get all type of events not just only “cron.*” or others and ?FILENAME is like a placeholder

then under the path with host ip address logs are will be stored




Posted on 14/09/2015, in Linux and tagged , , . Bookmark the permalink. 1 Comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: