Posty

Site 2 Site tunnel with multiple identical subnets on remote sites - without virtual hosts ( Route Based VPN )

Obraz
The goal: connect to multiple the same subnets on clients side using vpns.

topology:


As you see on the left side are clients with diffirent subnets 10.213.222.0/24 and 10.213.223.0/24, but on the right side all of them have the same 10.240.0.0/24
To make this work we need to route traffic to the specific VPN due to source IP.
So if the source subnet is 10.213.222.0/24 route it into VPN1 and if source subnet is 10.213.223.0/24 route it into VPN2

Address scheme:

- VPN HUB
external eth192 WAN: 172.16.160.254
internal eth224 LAN1: 10.213.222.1/24
internal eth256 LAN2: 10.213.223.1/24

- ClientA
external eth192 WAN: 172.16.160.1
internal eth224 LAN: 10.240.0.1/24

- ClientB
external eth192 WAN: 172.16.160.2
internal eth224 LAN: 10.240.0.1/24

HUB ipsec.conf
nano /etc/ipsec.conf

conn %defult
        ikelifetime=28800s
        lifetime=3600s
        keyingtries=1
        keyexchange=ikev1

conn clientA
        authby=secret
        ike=3des-sha1-modp1024
        esp=3des-sha1
        left=172.16.160.254
        le…

DRBD 8.4 on Debian Jessie

From  www.linbit.com: "The Distributed Replicated Block Device (DRBD) is a software-based, shared-nothing, replicated storage solution mirroring the content of block devices (hard disks, partitions, logical volumes etc.) between hosts.
DRBD mirrors data in real time. Replication occurs continuously while applications modify the data on the device.transparently. Applications need not be aware that the data is stored on multiple hosts.synchronously or asynchronously. With synchronous mirroring, applications are notified of write completions after the writes have been carried out on all hosts. With asynchronous mirroring, applications are notified of write completions when the writes have completed locally, which usually is before they have propagated to the other hosts."
Lets go and prepare two nodes d01 and d02 During linux nodes installation we must setup IP, hostame and domain name.

d01.xxx.local    192.168.50.131
d02.xxx.local    192.168.50.132
Install on both nodes:#apt-get…

iSCSI Target in Ubuntu 16.04LTS with multipath as datastore for VMware

Create disk:

mkdir /iscsi_disks
dd if=/dev/zero of=/iscsi_disks/disk01.img count=0 bs=1 seek=1.8T

configure 2 network interfaces for multipath

nano /etc/network/interfaces

auto ens10f0
iface ens10f0 inet static
        address 10.17.0.10
        netmask 255.255.0.0
        network 10.17.0.0
        broadcast 10.17.255.255
        gateway 10.17.255.254
        dns-nameservers 8.8.8.8

auto ens10f1
iface ens10f1 inet static
        address 10.17.0.20
        netmask 255.255.0.0
        network 10.17.0.0
        broadcast 10.17.255.255
        gateway 10.17.255.254
        dns-nameservers 8.8.8.8

Set the reverse path in loose mode:
nano /etc/sysctl.conf

net.ipv4.conf.default.rp_filter=2
        net.ipv4.conf.all.rp_filter=2

Enable iscsitarget

nano /etc/iscsitarget

ISCSITARGET_ENABLE=true

Define Lun:

nano /etc/iet/ietd.conf

Target iqn.1017-07.spsk2-szczecin.szpital.dl370:disk01
        Lun 0 Path=/iscsi_disks/hp-dl370-disk01.img,Type=fileio
        Alias LUN1

nano /etc/iet/initiators.allow

ALL ALL

nano /etc/iet/target…

PROXMOX & GlusterFS - HA Cluster with shared redundant storage

Obraz
TOPOLOGY:

PREPARATION After installing proxmox on our 3 nodes we need to edit /hosts file on each node and add other nodes names and IP:

in /etc/hosts

10.0.0.1 proxmox01.our.domain.comproxmox01
10.0.0.2 proxmox02.our.domain.comproxmox02
10.0.0.3 proxmox03.our.domain.comproxmox03


Update:
apt-get update

Install NTP Server:
apt-get install ntp

CREATE OUR CLUSTER
on PROXMOX01
pvecm create YOUR-CLUSTER-NAME

Test it:
pvecm status

Add other nodes:

on PROXMOX02
pvecm add IP-ADDRESS-OF-THE-CLUSTER (10.0.0.1)

on PROXMOX03
pvecm add IP-ADDRESS-OF-THE-CLUSTER (10.0.0.1)

Test it:
pvecm status

CONFIGURE GLUSTERFS Now we need to install glusterfs so on each node we do:
apt-get install glusterfs-server
service glusterfs-server start

from PROXMOX01:
gluster peer probe proxmox02

from PROXMOX02:
gluster peer probe proxmox01

from PROXMOX01:
gluster peer probe proxmox03

On each node:
mkdir -p /gluster/brick1

In proxmox web gui:
Datacenter->Storage->Add->Directory 
ID: name it
Directory: /gluster/volume
Content:Disk image

I…

VMware PowerCLI - Mass Migrate all VM'v from one host to another

Script name:    massmigrate.ps1

$SourceHost=$args[0]
$DestinationHost=$args[1]
$VMs = Get-VMHost $SourceHost | Get-VM | select Name
foreach ($VM in $VMs) {Get-VM -Name $VM.Name | Move-VM -Destination $DestinationHost –RunAsync}

Now we just simply run it:

PowerCLI X:> .\massmigrate.ps1 SourceHostIP DestinationHostIP

VMware PowerCLI- list all VM's Mac Addresses

Easy way of listing all mac addresses of VM's in Cluster.

Get-VM | Get-View | foreach { Write-Host $_.Name $_.Config.Hardware.Device.MacAddress }