Redundancy network linux router keepalive,conntrackd & etc. pt1.

I have two identical Centos7 latest relase machines.One is named rotuer1 and other one is router2.
I will use VRRP protocol for router redundancy.In my test bench im not gonna use any layer 2/3 switches.

Specification :

MB: A2SDi-8C-HLN4F
1x Intel(R) Atom(TM) CPU C3758
1x *8gig memory
2х HUS722T1TALA604
4x internal network interfaces.

1.Network connectivity.
Routers are connected with crossover ethernet cable.In my case in eno3 interface.

router1 eno3 network interface config file

TYPE=”Ethernet”
BOOTPROTO=”static”
NAME=”eno3″
DEVICE=”eno3″
ONBOOT=”yes”
IPADDR=”10.10.10.10″
PREFIX=”24″

router2 eno3 network interface config file

TYPE=”Ethernet”
BOOTPROTO=”static”
NAME=”eno3″
DEVICE=”eno3″
ONBOOT=”yes”
IPADDR=”10.10.10.20″
PREFIX=”24″

Make sure to have ping form router1 <-> rotuer2 and telnet in 22 port for ssh.

Network card configuration in Centos

At the usual directory in centos7 we fill find configuration files for network interfaces.
/etc/sysconfig/network-scripts/
ifcfg-* files should not have any configuration for network addresses.
Example:

For vlan interface:

DEVICE=eno2.22
ONBOOT=yes
VLAN=yes
TYPE=”Ethernet”

And for non vlan interface:

NAME=eno2
DEVICE=eno2
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static

Be sure all network interfaces are set with option ONBOOT=yes or keepalived will not start.

2.Pkgs
yum install keepalived conntrackd openvpn quagga

Keepalived high-availability is achieved by VRRP protocol. VRRP is a fundamental brick for router failover. In addition, Keepalived implements a set of hooks to the VRRP finite state machine providing low-level and high-speed protocol interactions.

Using following configuration in /etc/keepalive/keepalived.conf for master router1

global_defs {
notification_email {
dimo@d1m0.com #who get notifications .
pich@d1m0.com
}
notification_email_from dimo@dm10.com
smtp_server 192.168.3.7 # mail server to send mails
smtp_connect_timeout 30 # wait before retry .
router_id firewall #name of our machine
}

vrrp_sync_group router {
group {
router_eno1
router_eno2
router_eno4

}
# this script is in /usr/share/doc/conntrack-tools-1.4.4/doc/sync/. You may want to place it it keepalive config directory. It is used to notify Master and Backup for theirs states.
notify_master “/etc/keepalived/primary-backup.sh primary”
notify_backup “/etc/keepalived/primary-backup.sh backup”
notify_fault “/etc/keepalived/primary-backup.sh fault”
}

vrrp_instance router_eno1 {
state MASTER # OR BACKUP
interface eno3 ### This is important interface.Over this interface router1 and router2 will talk to each others.
dont_track_primary
virtual_router_id 50
priority 100
advert_int 3
authentication {
auth_type PASS
auth_pass 11router #password is limited to 8 characters.
}
virtual_ipaddress {
#/ brd dev scope label

IMPORTANT: vrrp_instance limitations is UP TO 20 IP addresses.If your router have more than 20 ip addresses, set second vrrp_instance.

vrrp_instance router_eno4 {
state MASTER # or BACKUP
interface eno3
dont_track_primary
virtual_router_id 51
priority 100 # backup’s priority shoud be less than master’s
advert_int 3
authentication {
auth_type PASS
auth_pass 11router
}
virtual_ipaddress {
#/ brd dev scope label

Must know Linux commands.Newbies tips. pt1

Listing files (ls)

If you want to see the list of files on your UNIX or Linux system, use the ‘ls‘ command.
It shows the files /directories in your current directory.

null

Suppose, your “Music” folder has following sub-directories and files.
You can use ‘ls -R‘ to shows all the files not only in directories but also subdirectories.

null

ls -al‘ gives detailed information of the files.

null

The command provides information in a columnar format. The columns contain the following information:

1st Column File type and access permissions
2nd Column # of HardLinks to the File
3rd Column Owner and the creator of the file
4th Column Group of the owner
5th Column File size in Bytes
6th Column Date and Time
7th Column Directory or File name

Hidden Files – ls -a
Hidden items in Linux begin with . “period”

Deleting Files
The ‘rm‘ command removes files from the system without confirmation.

Moving and Re-naming files

mv filename new_file_location/or new_file_name

Directory Manipulations
mkdir my_directory

null

Renaming Directory
The ‘mv‘ (move) command can also be used for renaming directories. Use the below-given format:
mv directoryname newdirectoryname

null

x2go Server/Client

——client——–
sudo apt-add-repository ppa:x2go/stable
sudo apt-get update
sudo apt-get install x2goclient

—–server——- *deb*
sudo apt-add-repository ppa:x2go/stable
sudo apt-get update
sudo apt-get install x2goserver x2goserver-xsession
sudo apt-get install x2golxdebindings

x2godbadmin –createdb

systemctl start x2goserver.service