Author: Aldin Taamneh Page 1 of 3

How to Configure Proxy in CentOS/RHEL/Fedora

What is a Proxy Server

A proxy server is a server that acts as an intermediary for requests from clients seeking resources on the internet or an external network. Think of it as a go-between who makes requests on behalf of the client, ensuring that anyone outside of your network does not know the details of the requesting host.

Verify if proxy is set on the server

This command will show if there is a proxy server configured on the system:

# echo $http_proxy

Setting Proxy for Command line programs

The http_proxy environment variable is used to specify proxy settings to client programs such as curl and wget. Below are the various examples of using proxy for commandline programs:

1. No username and password required:

To configure proxy without username and password:

# export http_proxy=http://SERVER:PORT/

2. Username and password authentication:

To configure the proxy server with username and password authentication:

# export http_proxy=http://USERNAME:PASSWORD@SERVER:PORT/

3. Domain, username and password required:

To configure proxy with username/password authentication along with the Domain name:

# export http_proxy=http://DOMAIN\\USERNAME:PASSWORD@SERVER:PORT/

Special character handling

Literal backslash characters (\) need to be doubled escape them as shown below.

# export http_proxy=http://DOMAIN\\USERNAME:PASSWORD@SERVER:PORT/

When the username or password uses the @ symbol, add a backslash (\) before the @ – for example:

# export http_proxy=http://DOMAIN\\USERN\@ME:PASSWORD@SERVER:PORT

or

# export http_proxy=http://DOMAIN\\USERNAME:P\@SSWORD@SERVER:PORT

Configuring Proxy in CentOS/RHEL 7 permanently (for processes without shell)

Define the environment variables in /etc/environment file if you want to add a permanent proxy in the CentOS/RHEL 7.

# echo "http_proxy=http://proxy.example.com:3128/" > /etc/environment

Note that unlike a shell script in /etc/profile.d described in the next section, the /etc/environment file is NOT a shell script and applies to all processes without a shell.

Configuring proxy for processes with SHELL

For bash and sh users, add the export line given above into a new file called /etc/profile.d/http_proxy.sh file:

# echo "export http_proxy=http://proxy.example.com:3128/" > /etc/profile.d/http_proxy.sh

For csh and tcsh users, use the following command to set the http_proxy variable in a new file called /etc/profile.d/http_proxy.csh file:

# echo "setenv http_proxy http://proxy.example.com:3128/" > /etc/profile.d/http_proxy.csh

The extension of these files determines which shell will read them. The commands are not interchangeable.

Setting proxy for other programs

To configure yum behind proxy, modify the /etc/yum.conf with the following:

# vi /etc/yum.conf
proxy=http://proxy.example.com:3128 
proxy_username=yum-user 
proxy_password=qwerty

ESXi Host TPM attestation alarm

One of the new feature of VMware vSphere 6.7 is the full support for Trusted Platform Module (TPM) 2.0 devices both at host and VM level.

But when you are using a TPM 2.0 device on an ESXi host, the host might fail to pass the attestation phase.

In this case, on your host, you will notice a critical error like this:

The vSphere Client does not provide any other information, neither at task or event level. To troubleshoot the potential causes of this problem you can use this VMware documentation.

SQL Server does not use all assigned CPUs on VM

As Virtual Machines (VMs) are getting more powerful, we have been migrating many SQL Servers into VMs and recently after we did a initial requirement for our Veeam Backup DB server, we started to notice performance issues.  On the VM, only half of the CPUs were 100% while the others were less than 20%. We checked to make sure there we have enough CPUs assigned in total 16 and even tried adjusting to make sure there was no MAXDOP hints on the queries.  Even after checking these, the VM still only used the first 8 CPUs out of the 16 CPUs.

Renaming a vSwitch in VMWare ESXi

At the ESX Console, log in and hit Alt-F1 then type unsupported and hit Enter. You won’t see the word “unsupported” appear as you type it but upon hitting Enter, you’ll be prompted for the root password. Type it in and hit Enter.

You be presented with the ESXi command prompt. The default text editor in ESXi CLI is vi:

Windows 10 is Stealing your Internet Bandwidth

The feature, known as Windows Update Delivery Optimization (WUDO), is initially designed to help users get faster software updates, which is quite a good idea to handle massive internet traffic of up to 40 Terabits per second (TBps).
WUDO works a lot like torrents work. Your computer running Windows 10 is used as part of a peer-to-peer network to deliver software updates faster to others, each person distributing a little bit of the files across multiple computers and helping everyone download updates quickly.
But, this peer-to-peer sharing method offered by Windows 10 is using your precious Internet bandwidth, without hinting you about it, because the feature is enabled by default in Windows 10 Home and Pro edition. WUDO is also enabled in Windows 10 Enterprise and Education, but only for the local network.

SCOM 2016 Management Packs for Windows Server 2016

So, here is the list of updated MP’s for Windows Server 2016, not all seems to be done but Kevin Holman has a nice list with URL’s for those that have been released so far.

Check this site for more info:

https://blogs.technet.microsoft.com/kevinholman/2016/12/19/where-are-the-server-2016-management-packs/

VLAN, Trunk, NIC Teaming, Virtual Switch Configuration in Hyper-v Server

If you checked my posts before and especially LAB scenarios maybe you noticed I didn’t tag VLANs and reason is I didn’t want to complicate things and I know that some people have problem with understanding how it all works in comparison with physical switches and all. This post is meant to help clear that and I hope it will help in better understanding of Hyper-V Virtual Switch.

Network virtualization provides multiple virtual network infrastructures run on the same physical network with or without overlapping IP addresses. Each virtual network infrastructure operates as if they are the only virtual network running on the shared network infrastructure. Hyper-v Network Virtualization also decouples physical network from virtual network.

How to Migrate configured DHCP from Windows Server 2008R2 to Server 2016

Here’s how  you do it:

  • Log on to the old/existing DHCP server.
  • Click Start, click Run, type cmd in the Open box, right-click, and then “Run as Administrator”.
  • On the Action menu, click Backup.
  • Type
    netsh dhcp server export C:\Users\yourusername\Desktop\dhcp.txt all

    and then press ENTER.

  • Install the DHCP role on the new (2016) DHCP server using Server Manager.
  • Copy the exported DHCP text file to the desktop of the new DHCP server.
  • Verify that the DHCP service is installed and started on the new DHCP server.
  • Click Start, click Run, type cmd in the Open box, right-click, and then “Run as Administrator”.
  • Type
    netsh dhcp server import C:\Users\yourusername\Desktop\dhcp.txt all

    and then press ENTER

  • Open DHCP console on the new server.
  • In the console tree, right-click DHCP.
  • Select “Authorize”.

If your old DHCP server is in the same network/subnet as the new DHCP server, you’ll notice that the old DHCP server has been de-authorized automatically. This is to prevent two DHCP servers from handing out conflicting addresses.

Check to make sure that your new DHCP has all of the same settings, options, scopes, and reservations set as the current one. If done correctly, everything should have been brought over.

Easy right 🙂

Nested Virtualized Windows Server 2016 Hyper-V Cluster LAB – Scenario 2

This Scenario will be lot quicker and we will be using PowerShell since Nano Server is without GUI and it will definitely reflect on footprint and size of cluster.

I recommend you read Nano Server – Deployment since I will be using that procedure for creating script that will automate creation of Nano Servers.

In this scenario we will have 3 VMs and first one same as in Scenario 1 will be VM with our Domain Controler, DHCP, DNS and we will need to setup all those services on that VM(detailed info on this procedure). This time we will also need to install Failover Cluster Manager so we can manage Nano servers since they don’t have any GUI. Second and Third will be our Nano Servers that we will create with script below but before we do it we need to mount Windows Server 2016 ISO  and copy NanoServer folder to our C: drive.

Nested Virtualized Windows Server 2016 Hyper-V Cluster LAB – Scenario 1

On Hyper V in Windows 10 we will create 4 VMs as we planned before and after VMs are created we must enable nested virtualization for our future cluster nodes.

Set-VMProcessor -VMName SRV001-A1 -ExposeVirtualizationExtensions $true

After that we need to install Windows Server 2016 and I suggest we use VM template for faster deployment as described in post earlier. Do not forget to enable MAC address spoofing in order for network packets to be routed through two virtual switches, MAC address spoofing must be enabled on the first level of virtual switch.

First VM will be our Domain Controler, DHCP, DNS and we need to setup all those services (detailed info on this procedure). Second VM will be our SAN VM and for this we will use StarWind Virtual SAN. Third and Fourth Server will be our future Hyper V host cluster nodes and for time being they must be joined to domain and given appropriate names and IP addresses.
Network interfaces on cluster nodes will be configured later with PowerShell script since I elected to team all 4 NICs using the minimum bandwidth setting for Management, Cluster, ISCSI, VM, and LiveMigration traffic.  I highly recommend that you take a few moments to watch John Savill’s discussion on this method of teaming: Using NIC Teaming and a virtual switch for Windows Server 2012 host networking

Page 1 of 3

Powered by WordPress & Theme by Anders Norén