Setup an Ubuntu VM as SFTP Server for NSX-T backup

In this blog, I will be setting up an Ubuntu Virtual Machine  as a SFTP Server for NSX-T config backups.

  • Set an Ubuntu Server , I used the below release

animeshd@sftp:~$ lsb_release -a

Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic

  • Installed VMware tools on the Ubuntu machine.
  • Install latest updates to the Ubuntu Machine using : sudo apt-get update (assume internet access is there)
  • Next , Install an Openssh Server using : sudo apt install openssh-server

check the status of ssh – running

sftp1

Next, using putty ssh to the server, and take the backup of /etc/ssh/sshd_config file.

In the current example, I took a backup of the file under the tmp directory as /tmp/sshd_backup.

sftp2

As the original file is read only, use chmod 777 against the /etc/ssh/sshd_config file to edit it. Use an editor of your choice on the system, I used Nano editor to the open the file for editing.

  • Edit the ListenIPaddress and add the IP of the local machine.

sftp3

  • Then change X11Forwarding no   (change from ‘yes’), and then add the overriding settings as per the screenshot below.

sftp4

Here’s what each of those directives do:

  • Match User tells the SSH server to apply the following commands only to the user specified.
  • ForceCommand internal-sftp forces the SSH server to run the SFTP server upon login.
  • PasswordAuthentication yes allows password authentication for this user.
  • ChrootDirectory /var/nsxtsftp/ ensures that the user will not be allowed access to anything beyond the /var/nsxtsftp directory.
  • AllowAgentForwarding no, AllowTcpForwarding no. and X11Forwarding no disables port forwarding, tunneling and X11 forwarding for this user.

Restart the ssh service on the machine

  • Now, I have created these directory and user in the on the SFTP Ubuntu machine.

Create a new user

  • sudo adduser –shell /bin/false nsxtbackupuser

Create a new directory

  • sudo mkdir -p /var/nsxtsftp/backups

Change owner and  permission on the new directory

  • sudo chown root:root /var/nsxtsftp
  • sudo chown nsxtbackupuser:nsxtbackupuser /var/nsxtsftp
  • sudo chown 755 /var/nsxtsftp

Once, this is done use the NSX-T UI, under system go ahead and edit and configure backup to the backup server.

sftp5

Then, perform a backup and view the result.

sftp6

Backup files are getting created.

sftp7

 

 

 

 

 

 

 

 

 

 

 

 

Advertisements

NSX-T Part 10: Configure N-S Routing

In the previous part, we have setup the T1 router and connected all the logical switches with its gateway configured on it. In this part after the Edges are deployed, we will be configuring the N-S routing for VMs to reach the external network.

nsxt10-1

We have just the T1 router currently available, now we will start with configuring the T0 router.

nsxt10-2

nsxt10-3

I have deployed it in Active-standy state as I will be using this setup for future deployment of PKS or Kubernetes.

nsxt10-4

Next, I connected the T1 router to T0 router.

nsxt10-5

As seen below, now the T1 router is connected to T0 router.

nsxt10-6

Next is to connect the Edges upstream to the VLAN network. In the previously setup, we had the VLAN-TZ setup and now we are first adding a VLAN backed logical switch for upstream connecting. As the lab is in a nested environment , VLAN 0 does fine 🙂

nsxt10-7

Quick summary of the T0 router below.

nsxt10-8

Next, is to connect the edges upstream with the VLAN logical switch and thus we need to configure the router ports on the T0 router on the below screen.

nsxt10-9

Below is the configuration output from the VYOS router which is being used for both my NSX-V and NSX-T environment.

nsxt10-10

Created a new Router port in the below screen, with the ip address used on the same L2 network

nsxt10-11

Similarly, we configured two router ports as we will be using BGP routing between the VYOS router and edges. We already know that on the standby edge , NSX automatically prepends the AS-Path to make it a less preferred route and thus no changes are required on the upstream router.

nsxt10-12

Below we do the BGP configuration .

nsxt10-13

nsxt10-14nsxt10-15

Similarly, we configure the routing for each edge router port.

nsxt10-16

Next, is to advertise the T1 routes upstream which is the all connected routes.

nsxt10-17

nsxt10-18

Quick recap on the logical networks connected to T1.

nsxt10-19

Next step is to validate the routes on the Active Edge. Firstly, we get the logical router available.

nsxt10-20

Login to the specific T0 SR component (as SR is responsible for routing N-S)

nsxt10-21

Check the routes, and we see that upstream and NSX-V environment routes are learnt through the VYOS router.

nsxt10-22

Below is the neighbor summary of the VYOS router.

nsxt10-23

This completes the NSX-T setup configuration. In future, I am planning to upgrade this setup to NSX-T 2.4.x release , as there are additional features available on the same.

Hope, this 10 part series was helpful.

NSX-T Part9: Configure Edge Cluster

In this part continuing with the edges configuration, we will configure the edge cluster. Before we create a new edge cluster, an edge cluster profile needs to be used.

There is already a default profile which is available.

nsxt9-1

However, I created a new Edge Cluster Profile as I do not want to use the default one.

nsxt9-2

nsxt9-3

Then I created a new Edge cluster and added both the previously created Edges into the newly created edge cluster.

nsxt9-4

nsxt9-5

nsxt9-6

nsxt9-7

Post which we bind the edge cluster profile to the edge-cluster profile.

nsxt9-8

In next part , I will configure the logical routing.

 

NSX-T Part8: Configure Edge nodes

In the previous part , I got two Edge VM nodes deployed. In this part we will configure them to function as an edge node . The first step is to configure an Edge Uplink Profile.

Initially, I configured the Edge using the earlier created Overlay Uplink profile in which  there was an active and a standby uplink , and was getting the below error .

nsxt8-1

I had to quickly change that and only configure with one active uplink, posted this for all your information if you run into this issue.

Create a new Edge-Overlay uplink profile

nsxt8-2.png

Create a new Edge-VLAN uplink profile.

nsxt8-3.png

All the Uplink profiles which are created.

nsxt8-8

Create a new Transport Zone . As we had already created the Overlay Transport zone for configuring the logical switches, we just need to create a new VLAN-Transport zone.

nsxt8-4.png

Configured both the edge-node VMs as a Transport node. Added both the overlay and VLAN transport zone as part of the edge transport zones.

nsxt8-5.png

tswitch1 configured for overlay

nsxt8-6.png

tswitch2 , new switch created for VLAN outbound connectivity to physical wordl.

nsxt8-7.png

Similarly, I configured both the edges as Edge Transport node

nsxt8-9.png

In the next part, I will continue with the Edge-cluster configuration.