Thursday, May 26, 2016

Proxmox add second harddrive

Simplified steps to add a second hard drive to a Debian server running Proxmox.
Firstly physically install the Hard Drive in the server chassis.
Startup the server and run the following from commandline to find the device name for the disk:
  1. fdisk -l
This should return something similar to this:
  1. Disk /dev/sda: 21.4 GB, 21474836480 bytes
  2. 255 heads, 63 sectors/track, 2610 cylinders
  3. Units = cylinders of 16065 * 512 = 8225280 bytes
  4. Device Boot Start End Blocks Id System
  5. /dev/sda1 * 1 2517 20217771 83 Linux
  6. /dev/sda2 2518 2610 747022+ 5 Extended
  7. /dev/sda5 2518 2610 746991 82 Linux swap / Solaris
  8. Disk /dev/sdb: 32.2 GB, 32212254720 bytes
  9. 255 heads, 63 sectors/track, 3916 cylinders
  10. Units = cylinders of 16065 * 512 = 8225280 bytes
  11. Disk /dev/sdb doesn't contain a valid partition table
If it is the first new disk you have added it will more than likely be /dev/sdb as the device name.
Now we partition the disk:
  1. cfdisk /dev/sdb
Select the following options:
  • New > Primary > Enter (use the size in MB already specified)
  • Write
  • Quit
Now we format the disk to the ext3 filesystem:
  1. mkfs.ext3 /dev/sdb1
Mount the drive to a new folder:
  1. mkdir /mnt/backups
  2. mount -t ext3 /dev/sdb1 /mnt/backups
Lastly we add the disk to /etc/fstab so it auto-mounts when we reboot the machine:
  1. /dev/sdb1 /mnt/backups ext3 defaults,errors=remount-ro 0 1
That’s your drive mounted and ready to be added as backup storage in Proxmox.
To test: reboot the machine and confirm that the drive is still mounted.

Thursday, April 21, 2016

change linux as router

change the following 0 to 1

echo 1 > /proc/sys/net/ipv4/ip_forward

Tuesday, December 15, 2015

Trunking Elastix to Yeastar

Elastix server is at 76.79.56.227, and the customer’s PBX is at 10.1.132.7.  Connectivity between sites is managed via SmartRouter L2TP VPN connections.  On the customer side, there is a route saying 76.79.56.227 lives on the VPN, not across the public internet.  This allows full intercommunication between servers without any NAT, which is imperative.
That all said, here are my settings — On the Yeastar MyPBX side:

MyPBX Trunk

And then the Elastix side:
Elastix Trunk

Note this is all being done without any username or password.  This is because EACH SIDE trusts the IP address of the other.  This technique could not be used securely with a dynamic IP address on either side.
Now that the trunk is there, I need to set up routing.  I’m going to have each side have a prefix to route calls to extensions on the other side.  In my case, users of the Elastix public server can dial 132 + any 3-digit extension on the MyPBX.  Putting the “132” in the “prefix” box instructs Elastix to strip the 132 off the number before sending it to the trunk.  This makes MyPBX just see an extension number when it rings in, which is exactly what I want.

Elastix Route


And, this wasn’t really necessary, but I figured I’d let the users of the MyPBX system call users off the public server while I was at it.  In this case, I’m going to have them dial 555 + any four digit extension for users off the Elastix server:
MyPBX Route