How to Configure DHCP Server in Debian 8

line5

DHCP Server

Switch to root user

su -

Debian 8.2-2018-03-15-13-37-46

(if it is a fresh install update the source.list file to update software through internet)

https://techencyclopedia.wordpress.com/2018/03/18/update-software-packages-in-debian-8/

Install DHCP service

aptitude install isc-dhcp-server

Debian 8.2-2018-03-15-13-38-28

Debian 8.2-2018-03-15-13-39-09

Search for DHCP service

aptitude search isc-dhcp-server

Debian 8.2-2018-03-15-18-50-39

Open and configure dhcpd.conf file

nano /etc/dhcp/dhcpd.conf

Debian 8.2-2018-03-16-13-10-42Debian 8.2-2018-03-16-13-11-04

Make necessary changes

ddns-update-style none;

ignore client-updates;

authoritative;


# state The network 
subnet 192.168.1.0 netmask 255.255.255.0 

{

#State The Default gateway 
option routers 192.168.1.1;

#State the Subnet mask 
option subnet-mask 255.255.255.0;

#State the Broadcast IP address 
option broadcast-address 192.168.1.255;

#State DNS domain name 
option domain-name "teche.com";

#State the DNS server IPs 
option domain-name-servers 192.168.1.10;

#State the range of DHCP IPs 
range 192.168.1.200 192.168.1.220;

#State default lease time
default-lease-time 600;

#State the maximum lease time
max-lease-time 7200;

}

Debian 8.2-2018-03-16-16-31-02.png

Start the DHCP service

service isc-dhcp-server start

OR

systemctl restart isc-dhcp-server

Debian 8.2-2018-03-16-13-24-25

Check the DHCP status

service isc-dhcp-server status

OR

systemctl status isc-dhcp-server

Debian 8.2-2018-03-16-13-25-00

DHCP CLIENT

Change the network configuration to accept DHCP IP address

Debian 8.2 second-2018-03-16-13-58-39

Debian 8.2 second-2018-03-16-13-58-44

 

Advertisements

How to Update Software Packages in Debian 8

line5

In a fresh Debian 8 install you will get an error when you try to install a software package if you don’t update the source list properly

Debian 8.2-2018-03-15-13-37-47.png

 

Go to Terminal

Debian 8.2-2018-03-15-13-37-40

Switch to root user

su -

Debian 8.2-2018-03-15-13-37-46.png

Open the source configuration file

nano /etc/apt/sources.list

Debian 8.2-2018-03-15-13-37-55.png

Change the mirror list in source configuration file in Debian 8

deb http://ftp.debian.org/debian/ wheezy main contrib non-free

deb http://ftp.debian.org/debian/ wheezy-updates main contrib non-free

deb http://security.debian.org/ wheezy/updates main contrib non-free


Primary Debian mirror sites

https://www.debian.org/mirror/list

Debian 8.2-2018-03-15-13-37-56.png

Update the software sources

aptitude update

Debian 8.2-2018-03-15-13-37-57.png

Now you can install/ update software packages in Debian 8 using following commands

To search for a software package in Debian 8

aptitude search packagename

To install a software package in Debian 8

aptitude install packagename

To remove a software package in Debian 8

aptitude purge packagename

To get information of a software package in Debian 8

aptitude show packagename

REFERENCE

https://wiki.debian.org/SourcesList

https://www.debian.org/doc/manuals/debian-faq/ch-pkgtools.en.html

How To Install Debian 8 by Manually Creating LVM Linux Partitions

line5

TECH ENCYCLOPEDIA DEBIAN 8 SERIES

  1. How To Install Debian 8 by Manually Creating LVM Linux Partitions
  2. How to Update Software packages in Debian 8
  3. How to Configure DHCP Server in Debian 8
  4. How to Configure Apache Web Server in Debian 8

What Is Debian Linux Computer Operating System?

more at [https://www.debian.org/intro/about]

Lab Configuration

In this lab scenario 100 Gb hard disk is used to manually create LVM (Logical Volume Manager) Linux partitions namely /swap, / (root), /home, /var, /srv. Standard /boot partition is created separately to keep the boot files and linux kernal as the system cannot boot from LVM partition. Feel free to adjust the sizes of the partitions accordingly to the requirement of your organization.

TUTORIAL

Firstly download Debian 8 at https://www.debian.org/CD/http-ftp/  and create a bootable CD/DVD

Select “Graphical install”

Debian 8-2018-03-08-15-01-29.png

Select appropriate language

In this case English is chosen

Debian 8-2018-03-08-15-02-25.png

Select your location

Debian 8-2018-03-08-15-02-35

Configure the keyboard

Debian 8-2018-03-08-15-02-45

Debian 8-2018-03-08-15-03-04

In this case the network configuration fails because there is no DHCP server

press continue to manually configure the network

Debian 8-2018-03-08-15-07-33

configure network manually

Debian 8-2018-03-08-15-08-30.png

Provide the ip address

192.168.1.10

Debian 8-2018-03-08-15-08-55

Provide the netmask

Debian 8-2018-03-08-15-09-03

provide the gateway address

Debian 8-2018-03-08-15-09-11

Provide the name server address

Debian 8-2018-03-08-15-09-27

Provide the hostname for the system

Debian 8-2018-03-08-15-11-18

Provide the domain name

Debian 8-2018-03-08-15-11-48

Provide the root password

Debian 8-2018-03-08-15-12-32

Provide the name of the new user account

Debian 8-2018-03-08-15-12-44

Provide the username for the new account

Debian 8-2018-03-08-15-12-58

Provide the password for the newly created user account

Debian 8-2018-03-08-15-13-14

Configure the clock

Debian 8-2018-03-08-15-18-15

Partition disks

In this case manual option is selected

Debian 8.2-2018-03-10-23-21-49.png

Debian 8.2-2018-03-10-23-21-59

Debian 8.2-2018-03-10-23-22-28

Firstly Create a Standard boot partition

  • Size of the partiton: 1 GB
  • Type for the new partition: primary
  • Location of the new partition: beginning
  • use as: Ext4 journaling file system
  • Mount point: /boot
  • label: boot
  • bootable flag: on

Debian 8.2-2018-03-10-23-26-55

Debian 8.2-2018-03-10-23-27-00

Debian 8.2-2018-03-10-23-27-08

Debian 8.2-2018-03-10-23-27-13

Debian 8.2-2018-03-10-23-27-18

Debian 8.2-2018-03-10-23-34-08

Debian 8.2-2018-03-10-23-36-31

Configure the logical volume manager

  • Firstly create a LVM physical volume
  • Then create other partitions as LVM logical volumes within the LVM physical volume

Debian 8.2-2018-03-10-23-36-47.png

Create a logical volume group

LVMGroup

Debian 8.2-2018-03-10-23-47-40

Debian 8.2-2018-03-10-23-47-50

Debian 8.2-2018-03-10-23-48-10.png

Debian 8.2-2018-03-10-23-48-20

Debian 8.2-2018-03-10-23-48-29

Debian 8.2-2018-03-10-23-53-58.png

Create Logical volumes for following partitions

  • /swap
  • /       – (root)
  • /home
  • /srv
  • /var

please note that in this tutorial only swap partition creation is shown

Debian 8.2-2018-03-11-00-04-17

Debian 8.2-2018-03-11-00-04-24

Debian 8.2-2018-03-11-00-05-40

Debian 8.2-2018-03-11-00-10-01.png

Swap partition

  • Size of the LVM logical volume partition: 2.5 GB [since the system RAM is 2 GB, 2 GB + 500 mb]
  • use as: swap area

Desired capacity is calculated according to the system RAM. If the system RAM is less than 2 GB it should be multiplied by 2, if the system RAM is more than 2 GB, should add 500 mb to the system RAM.

EX -:
system RAM is 250 mb —> Desired Capacity is 500 mb [250 mb * 2]
system RAM is 3 GB —> Desired Capacity is 3.5 GB [3 GB + 500 mb]

Debian 8.2-2018-03-11-00-16-29

Debian 8.2-2018-03-11-00-17-33

Home partition

  • Size of the LVM logical volume partition: 40 GB
  • use as: Ext4 journaling file system
  • Mount point: /home
  • label: home

Debian 8.2-2018-03-11-00-19-04

Debian 8.2-2018-03-11-00-19-13

Debian 8.2-2018-03-11-00-19-36

Root partition

  • Size of the LVM logical volume partition: 30 GB
  • use as: Ext4 journaling file system
  • Mount point: /
  • label: root

Srv partition

  • Size of the LVM logical volume partition: 15 GB
  • use as: Ext4 journaling file system
  • Mount point: /srv
  • label: srv

Var partition

  • Size of the LVM logical volume partition: 15 GB
  • use as: Ext4 journaling file system
  • Mount point: /var
  • label: var

Debian 8.2-2018-03-11-00-23-05

Debian 8.2-2018-03-11-00-23-14

Configure the package manager

scan additional CD/DVD

Debian 8.2-2018-03-11-00-30-33

configure network mirror

Debian 8.2-2018-03-11-00-30-55

Participate in the package survey

Debian 8.2-2018-03-11-00-43-20

Select and Install predefined collection of software

In this case default is selected

Debian 8.2-2018-03-11-00-44-29.png

Install the GRUB (grand unified boot loader)

Debian 8.2-2018-03-11-01-29-06

Select the path to install GRUB

Debian 8.2-2018-03-11-01-29-13

Finish installation

Select continue to reboot the system

Debian 8.2-2018-03-11-01-29-36

Debian 8.2-2018-03-11-01-50-32

Debian 8.2-2018-03-11-01-50-41

Hopefully you will have an idea on how To Install Debian 8 by Manually Creating LVM Linux Partitions.

How To Install CentOS 7 by manually Creating LVM Linux Partitions

line5

HOW TO INSTALL DEBIAN 8

What Is CentOS?

The CentOS Project is a community-driven free software effort focused on delivering a robust open source ecosystem. CentOS is a Linux distribution (derived from Red Hat Enterprise Linux) that is popular with system admins, dev ops engineers, and home users alike.

Find more at: https://www.centos.org/

Lab Configuration

In this lab scenario 32 Gb hard disk is used to manually create LVM (Logical Volume Manager) Linux partitions namely swap, root, home, var, srv and tmp. standard /boot partition is created separately to keep the boot files and linux kernal as the system cannot boot from LVM partition. Feel free to adjust the sizes of the partitions accordingly to the requirement of your organization.

TUTORIAL

Firstly download CentOS 7 at https://www.centos.org/download/ and create bootble CD/DVD

Select Install CentOS 7

CentOS 64-bit-2017-05-19-05-42-39

CentOS 64-bit-2017-05-19-05-43-09

Choose the language and press continue

Watermark CentOS 64-bit-2017-05-19-05-44-58

Watermark CentOS 64-bit-2017-05-19-05-52-35

Watermark CentOS 64-bit-2017-05-19-05-52-36.png

Date & Time

CentOS 64-bit-2017-05-19-05-52-45

Language Support

CentOS 64-bit-2017-05-19-05-53-48

Keyboard Layout

CentOS 64-bit-2017-05-19-05-54-04

Installation Source

CentOS 64-bit-2017-05-19-05-54-12

Software Selection

In this scenario minimal install is selected

Watermark CentOS 64-bit-2017-05-19-05-54-21.png

Installation destination

In this tutorial LVM Linux partitions are created manually

If you are going to create the root (/) partition as a LVM, be sure to create a standard /boot partition separately to keep the boot files and the Linux kernel because the system cannot boot form LVM partitions.

Watermark CentOS 64-bit-2017-05-19-06-35-25

Create The Standard Partition

Create a Standard Boot Partition

Mount Point: /boot
Desired Capacity: 250mb
Device Type: Standard Partition
File System: ext4
Label: boot

CentOS 64-bit-2017-05-19-09-18-21

CentOS 64-bit-2017-05-24-01-30-56

CentOS 64-bit-2017-05-24-01-32-18

Press Update Settings

CentOS 64-bit-2017-05-24-01-35-03

Create The New LVM PV And Rest of The Partitions

Root  partition

Mount Point: /
Desired Capacity: 5 GB
Device Type: LVM [new LVM PV should be created – NewLVM-PV]
File System: ext4
Label: root

CentOS 64-bit-2017-05-24-10-31-43

Create a new LVM PV – NewLVM-PV

CentOS 64-bit-2017-05-24-10-32-54

CentOS 64-bit-2017-05-24-10-33-41

CentOS 64-bit-2017-05-24-10-34-17

Swap partition

Desired capacity is calculated according to the system RAM. If the system RAM is less than 2 GB it should be multiplied by 2, if the system RAM is more than 2 GB, should add 500 mb to the system RAM.

EX -:
system RAM is 250 mb —> Desired Capacity is 500 mb [250 mb * 2]
system RAM is 3 GB —> Desired Capacity is 3.5 GB [3 GB + 500 mb]

Mount Point: not mounted or labled
Desired Capacity: 2 GB [since the system RAM is 1 GB, 1 GB mulitiplied by 2]
Device Type: LVM [NewLVM-PV]
File System: swap
Label: swap

CentOS 64-bit-2017-05-24-10-34-40

CentOS 64-bit-2017-05-24-10-35-35

Home partition

Mount Point: /home
Desired Capacity: 4 GB
Device Type: LVM [NewLVM-PV]
File System: ext4
Label: home

CentOS 64-bit-2017-05-24-10-35-57

CentOS 64-bit-2017-05-24-10-36-49

Tmp partition (optional)

Mount Point: /tmp
Desired Capacity: 2 GB
Device Type: LVM [NewLVM-PV]
File System: ext4
Label: tmp

CentOS 64-bit-2017-05-24-10-37-19

CentOS 64-bit-2017-05-24-10-38-01

Var partition (optional) on web and mail servers (LVM)

Mount Point: /var
Desired Capacity: 3 GB
Device Type: LVM [NewLVM-PV]
File System: ext4
Label: var

CentOS 64-bit-2017-05-24-10-38-27

CentOS 64-bit-2017-05-24-10-39-02

Srv partition (optional) on FTP servers (LVM)

Mount Point: /srv
Desired Capacity: 3 GB
Device Type: LVM [NewLVM-PV]
File System: ext4
Label: srv

CentOS 64-bit-2017-05-24-10-39-24

After creating required partitions press Done

Watermark CentOS 64-bit-2017-05-24-10-40-03

Select Accept Changes

Watermark CentOS 64-bit-2017-05-24-10-40-53

Press Begin Installation

CentOS 64-bit-2017-05-24-10-40-58

Configure Root account password to complete installation

last 1

last 2

Press Finish Configuration

last 3

Press Reboot

last 4

After The REBOOT

After the reboot, login to the root account using the password given

CentOS 64-bit-2017-05-24-05-46-10

To view the file system table use the command [find more at: https://www.howtogeek.com/howto/38125/htg-explains-what-is-the-linux-fstab-and-how-does-it-work/]

cat /etc/fstab

A file named /etc/fstab lists the devices (typically hard disk partitions) that are to be mounted at boot time.

CentOS 64-bit-2017-05-24-07-28-32

CentOS 64-bit-2017-05-24-07-24-45

To view users

cat /etc/passwd

CentOS 64-bit-2017-05-24-09-11-42

To view created groups

cat /etc/group

CentOS 64-bit-2017-05-24-10-18-59

How to Install NethServer

line5

logo.png

 

What is NethServer?

NethServer is an operating system for Linux enthusiasts, designed for small offices and medium enterprises.

Available Features

Watermark NethServerorg_learn-more - features.pngPrerequisites

  • 64 bit CPU
  • 1 GB RAM
  • 8 GB free disk space

In this tutorial NethServer 6.8 is installed.

Tutorial

Download link

http://www.nethserver.org/getting-started-with-nethserver/

Boot the downloaded ISO image from CD/DVD/USB

Choose NethServer interactive install

Watermark  NethServer-2017-04-17-09-28-22.png

 

NethServer-2017-04-17-09-30-01.png

Choose the correct LAN, MAC address

NethServer-2017-04-17-09-30-41.png

Give an appropriate IP address (EX- 192.168.0.88)

NethServer-2017-04-17-09-31-00.png

Install…

NethServer-2017-04-17-09-31-11.png

Use following credentials

Default username : root
Root password : Nethesis,1234

Nethserver-2017-04-18-00-58-37.png

Nethserver-2017-04-18-01-05-10.png

You can change the root password with following commands in command line or wait and do that in the Server Manager.

passwd root

New password:
Retype new password:

To access NethServer’s Server-manager use the following address in the web browser

https://192.168.0.88:980 (change the ip address accordingly)

Watermark  Windows 7 x64 xxx [17]-2017-04-18-02-14-22.png

Windows 7 x64 xxx [17]-2017-04-18-02-15-24.png

Change the root password

Windows 7 x64 xxx [17]-2017-04-18-02-17-54.png

Change the Hostname and the domain name

Windows 7 x64 xxx [17]-2017-04-18-02-19-23.png

Time Zone

Windows 7 x64 xxx [17]-2017-04-18-02-20-45.png

Change the SSH TCP port number or keep the defaults. Changing is recommended because of security reasons.

Windows 7 x64 xxx [17]-2017-04-18-02-20-54.png

Usage statistics will be sent to nethserver.org by default. Select “No Thanks” if you don’t like the option.

Windows 7 x64 xxx [17]-2017-04-18-02-21-03.png

Apply the changes.

Windows 7 x64 xxx [17]-2017-04-18-02-21-09.png

make sure you update using following command

yum update

Nethserver-2017-04-18-05-00-18.png

Nethserver-2017-04-18-19-09-49.png

How to Install NethServer Web Proxy

line5

Tutorial

Select and Install Web Proxy from administration –> Software Center

Watermark Windows 7 x64 xxx [17]-2017-04-19-09-21-31.png

Select Gateway –> Web Proxy

Windows 7 x64 xxx [17]-2017-04-19-09-55-07.png

Supports Four modes

  • Manual: all clients must be configured manually
  • Authenticated users must enter a user name and password in order to navigate
  • Transparent: all clients are automatically forced to use the proxy for HTTP connections
  • Transparent SSL: all clients are automatically forced to use the proxy for HTTP and HTTPS connections

Windows 7 x64 xxx [17]-2017-04-19-09-56-21.png

Configure cache settings too

Windows 7 x64 xxx [17]-2017-04-19-13-10-07.png

Configure the proxy settings in Client Computers. (Proxy server’s listening port is 3128)

Internet Explorer

Tools –> Internet Options –> Connections –> LAN Settings

Watermark Windows XP Pro client [77]-2017-04-19-09-36-38.png

Firefox

Tools –> Options –> Advanced –> Network –> Settings

Windows XP Pro client [77]-2017-04-19-13-05-06.png

 

If you want you can Install nethserver-lightsquid package to generate web proxy stats.

Reference

http://docs.nethserver.org/en/v7/web_proxy.html

 

How to install pfSense Cluster using CARP

line5

pfsense.jpg

This guide is divided into 4 sections

01 IP address configuration
02 Firewall rule
03 CARP settings
04 Virtual IPs

And also keep in mind that we are using pfSense 2.2.6 version for the tutorial

pfsense cluster 02

01. IP address configuration

Each master and slave device should be equipped with 3 network cards (WAN, LAN and synchronization)

pfSense master

install 3 network cards with appropriate IP configuration

WAN : 192.168.91.149 / 24
LAN : 192.168.4.21 / 24
SYNC : 192.168.10.21 / 24

configure virtual ip addresses for WAN and LAN only on master. These settings will be replicated to the slave [creating virtual IPs will be discussed later in 4th section]

WAN virtual ip : 192.168.91.10 / 24
LAN virtual ip : 192.168.4.10 / 24

pfSense slave

install 3 network cards with appropriate IP configuration

WAN : 192.168.91.150 / 24
LAN : 192.168.4.22 / 24
SYNC : 192.168.10.22 / 24

02. Firewall rule

configure firewall rules on both master and slave (same configuration for both devices)

go to “Firewall” —> “Rules” and select “sync” interface

11.jpg

configure following settings and save

interface : SYNC
protocol : any

22.jpg

03. CARP settings

pfSense slave

go to “Firewall” —> virtual IPs and click CARP settings tab

tick synchronize status
select interface “sync”

carp 00.jpg

pfSense master

go to “Firewall” —> virtual IPs and click CARP settings tab

tick synchronize status
select interface “sync”

and provide

slave machine sync IP address
username and password of slave machine

carp 01.jpg

and don’t forget to tick the following boxes

Synchronize Rules
Synchronize NAT
Synchronize Virtual IPs

carp 02.jpg

carp 03.jpg

04. Virtual IPs

as stated in the early part of the guide we have to create two LAN and WAN virtual IPs.

go to Firewall —> Virtual IPs  and click plus sign

WAN virtual IP

virtual IP 1 wan.jpg

LAN virtual IP

virtual IP 1 LAN.jpg

after creating virtual IPs the system will look like this

virtual IP 1.jpg

Testing

After implementing the cluster, conduct testing to make sure it is working in a event of a failover / disaster.