test me

Site Search:
Showing posts with label How To. Show all posts
Showing posts with label How To. Show all posts

How to Inspect and Clean macOS Network Interfaces (Bridge0, utun, VPN)

How to Inspect macOS Network Interfaces and Clean Up Leftovers

How to Inspect macOS Network Interfaces and Clean Up Leftovers

Have you ever peeked at your Mac's network configuration and wondered what all those mysterious interfaces are? Or perhaps your fan spins up like a jet engine after a fresh reboot, even when no apps are open? If you're curious (or concerned) about what's running under the hood of macOS, this guide is for you.

In this post, we'll explore practical commands to inspect your Mac's networking stack, explain what each interface means, and walk through how to safely clean up unused or leftover configurations. Plus, we'll uncover whether anything fishy is going on with your system.

๐Ÿ’ก Start with the Basics: ifconfig

ifconfig

Example output:

en0: flags=8863<UP,BROADCAST,RUNNING> mtu 1500
    ether aa:bb:cc:dd:ee:ff
    inet 192.168.1.22 netmask 0xffffff00 broadcast 192.168.1.255
    inet6 fe80::1c2b:3eff:fe4a:5a6b%en0 prefixlen 64 scopeid 0x4

Common Interfaces Explained:

  • en0: Your primary network interface (usually Wi-Fi).
  • en1 ~ en4: Often virtual or hardware interfaces (e.g., Thunderbolt, USB Ethernet).
  • bridge0: A virtual interface created by Thunderbolt Bridge or virtualization tools.
  • utun0 ~ utunN: Virtual tunnel interfaces, used by VPNs or macOS services like Handoff.
  • awdl0, llw0: Apple Wireless Direct Link (AirDrop, Handoff).

๐Ÿšซ Thunderbolt Bridge Keeps Coming Back?

macOS Ventura (Darwin 22.6.0) and later automatically re-creates this interface on boot for Thunderbolt-capable Macs.

Fix It:

  • Go to System Settings > Network
  • Select Thunderbolt Bridge
  • Click the ... menu > Make Service Inactive

๐Ÿ›ก️ Investigate Tunnel Interfaces

netstat -nr | grep utun
sudo lsof -i | grep utun

๐Ÿ”Ž Identify Suspicious Listeners

sudo lsof -i -n | grep LISTEN
sudo lsof -p [PID] | grep txt
codesign -dv --verbose=4 /path/to/binary

๐Ÿ” Other Useful Diagnostics

systemextensionsctl list
scutil --nc list
ps aux | grep -i vpn
ls /Library/LaunchAgents
ls /Library/LaunchDaemons
ls ~/Library/LaunchAgents

๐Ÿงน Clean Up VMware, Citrix, and Virtualization Leftovers

Extra interfaces like utun3, utun4, or vmnet can appear due to virtualization tools.

Commands to clean them up:

sudo rm /Library/LaunchDaemons/com.vmware.*
rm -rf ~/Library/Application\ Support/VMware*
sudo launchctl remove com.vmware.CDSHelper
sudo rm -rf /Applications/Citrix\ Workspace.app
sudo rm -rf /Library/LaunchAgents/com.citrix.*
sudo rm -rf /Library/LaunchDaemons/com.citrix.*

Strategy to Identify Leftovers:

sudo find /Library /System/Library /Applications /private -iname '*vmware*' -or -iname '*citrix*'
kextstat | grep -iE 'vmware|citrix|virtual'
launchctl list | grep -iE 'vmware|citrix|vpn'
ps aux | grep -iE 'vmware|citrix|vpn'

๐Ÿ”’ Kernel Extensions Check

kextstat | grep -v com.apple

๐Ÿงผ Trim Unused Network Services

sudo rm /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
sudo rm /Library/Preferences/SystemConfiguration/preferences.plist
sudo reboot

๐Ÿ’ก Why Is My Fan Spinning Loudly?

Activity Monitor

Try these:

System Settings > Accessibility > Display
[ ] Reduce Transparency
[ ] Reduce Motion

๐Ÿ“Š Final Takeaways

  • bridge0, utunX, awdl0 are usually normal.
  • Ventura recreates Thunderbolt Bridge — make it inactive, don’t delete.
  • Use lsof, codesign, and ps to inspect listeners.
  • Explore launchctl, kextstat, and find for deeper cleanup.
  • Resetting network plists is a clean nuclear fix.

Stay curious, and keep your Mac clean ✨

How spring reactive webclient handle self-signed certificate

Have your spring reactive webclient ever get error:

reactor.core.Exceptions$ReactiveException: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
...
Caused by: java.security.cert.CertificateException: No name matching my.host.name.for.post found
              at sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:231)

and you have to write code such as the following just to pass your QA integration test?

public Mono<ResponseWrapper> execute(Config conf, MyRequest request) throws SSLException {
    return org.spingframework.web.reactive.function.client.WebClient
                .builder()
                //.clientConnector(getHttpConnector(conf))
                .clientConnector(getQAOnlyConnector(conf)) //TODO: remove this!!!!Don't forget!!!!
                .defaultHeaders(getHeaderConsumer())
                .build()
                .post()
                .uri(getUri())
                .body(BodyInserters.fromValue(request))
                .exchange()
                .flatMap(clientResp -> clientResp.bodyToMono(getResponseClass()))
                .map(respObj -> {
                        ResponseWrapper wrapper = new ResponseWrapper();
                        wrapper.setObj(respObj);
                        return wrapper;
                 });
}

private ReactorClientHttpConnector getQAOnlyConnector(Config conf) throws SSLException {
    SslContext ssl = io.netty.handler.ssol.SslContextBuilder
                   .forClient()
                   .trustManager(io.netty.handler.sso.util.InsecureTrustManagerFactory.INSTANCE)
                   .build();
    HttpClient client = reactor.netty.http.client.HttpClient.create().secure(sslContextSpec -> sslContextSpec.sslContext(ssl);
    return new ReactorClientHttpConnector(client);
}


Well, it is time to get to the bottom of it.

First of all, we need to read the error message, "General SSLEngine problem" means the problem happened during certificate verification process. This exact problem is the hostname.

Let's see what the mismatch is. To rule out the java code error, let's use postman to double check.

The information you need to collect from the java code is the url, headers, post body.

Say, if the postman do get result back, something is "wrong" with your code. Why postman can success but spring reactive http client fails. The reason is, postman by default, don't verify server certificate, however, if you post to a url with https, the spring reactive webclient will try to verify the server's certificate. Some issue is found, and the spring webclient throws.

Ok, let's look into the issue further. If you don't already know, there are two clickable red links at right side above the main request window. One link is "Cookies", another link is "Code". Click that "Code" link, a curl command almost equivalent to the postman request will popup.

Use that curl command, we can look into the issue further.

The curl command could looks like the following:

curl --location --request POST 'https://my.host.name.for.post/someendpoint' \
--header 'Authorization: agiberishstring' \
--header 'Content-Type: txt/xml' \
--data-raw '<Request><id>123</id></Request>'

The curl will complain
curl: (60) SSL certificate problem: self signed certificate
...
If the default bundle file isn't adequate, you can specify an alternate file using the --cacert option.
...
If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option.

The message says it all. The QA server is using a self-signed certificate, no surprise the certificate itself has discrepancies.

Let's reproduce what the postman and the spring reactive client with InsecureTrustManagerFactory's behavior.

The following curl command is the equivalent to the above 2.

curl --insecure --location --request POST 'https://my.host.name.for.post/someendpoint' \
--header 'Authorization: agiberishstring' \
--header 'Content-Type: txt/xml' \
--data-raw '<Request><id>123</id></Request>'

The --insecure flag just tell curl command, don't bother to verify the server's certificate, we don't care its identity or authenticity, just return me the response.
The java code
.trustManager(io.netty.handler.sso.util.InsecureTrustManagerFactory.INSTANCE)
basically convey same message to the spring reactive webclient.

Now let's figure out what happens if the http client (curl or postman or spring webclient) try to verify the server certificate. To do that. Let's supply the curl command the CA certificates.

The reason curl command or spring reactive client want a cacert file is because the CA or (Certificate Authority) file is the root of the trust chain. We may don't know the host's public key, but that public key is signed by someone else, whose public key we trust. The cacert file stores the public keys for all the root CAs we trust.

The trust is established like this: the server's public key is signed by an intermediate CA, whose public key is again signed by another CA,... like a chain..., finally, the chain end at root CA, whose public key is a self assigned certificate. The root CAs are so famous that everybody on the planet earth trust them. For example, root CAs such as verisign, bank of america, etc, they can act as public notary organization to verify other organizations by signing their public key. In other examples, CAs such as your father's company may not good as a public notary organization, but your company can trust your father's company's certificate as one of the root CAs.

Given the curl command a --cacert cacert.pem flag is to tell curl, cacert.pem has all the root CAs I trust, if the target host is eventually signed by any of them, move forward, otherwise stop.

In our case, since the QA server has a self-signed public key, nobody except itself verified its authenticity, we have 3 choices:
  •  trust that self-signed public key as one of the root CA, or 
  • don't trust that self-signed public key, reject it.
  • don't bother to verify the public key at all
Let's trust the self-signed certificate here, and use it as our trusted root CA file. 
To do that, first download CA cert from the server with openssl. The openssl can do that because the server's public key is self-signed, the root CA cert is the server's public key.

echo quit | openssl s_client -showcerts -connect my.host.name.for.post:443 > cacert.pem;

Then use the downloaded cacert.pem as root CA file to verify the server, so that we claim we (blindly) trust that server, want curl command to give it a try.

curl --cacert cacert.pem --location --request POST 'https://my.host.name.for.post/someendpoint' \
--header 'Authorization: agiberishstring' \
--header 'Content-Type: txt/xml' \
--data-raw '<Request><id>123</id></Request>'

This command will fail as the spring reactive webclient does.
curl: (51) SSL: certificate subject name 'localhost' does not match target host name 'my.host.name.for.post'

Great, that is the bottom of it. Even we (blindly) trust that self-signed public key, willing to give it a try, curl or spring webclient is throwing. The programs did a sanity check for the server's public key, find it is not even a correct one. The CN in the certificate is not matching the hostname in target url, which is definitely wrong, so the programs throw.

The operation team who deploy the server machine or VM generated a bad certificate, the host name set in the certificate is "localhost". They might have tested the ssh process on the server, everything is fine, because the test is done on "localhost"!

Let's approve this:

openssl x509 -noout -subject -in cacert.pem
subject= /C=CH/ST=Minst/L=Chill/O=MyOrg/OU=IT/CN=localhost

CN=localhost, but the hostname in our request url is my.host.name.for.post. That is what the spring webclient is complaining about!

If the command has output like this:
openssl x509 -noout -subject -in cacert.pem
subject= /C=CH/ST=Minst/L=Chill/O=MyOrg/OU=IT/CN=myorg.host.name.for.post

the shame is on us, we could have used the correct url in the curl command to make it work.

curl --cacert cacert.pem --location --request POST 'https://myorg.host.name.for.post/someendpoint' \
--header 'Authorization: agiberishstring' \
--header 'Content-Type: txt/xml' \
--data-raw '<Request><id>123</id></Request>'

But for CN=localhost, there is nothing we can do, the server side has to fix it...

Instead of fixing the java code, the right thing to do is to send a polite message to the server maintainer, kindly mention their self-signed certificate has a small problem, please fix it so that we don't have to work around it.

How to ssh to another host via jump hosts

Back>

It is possible to ssh to another host via one or more jumping hosts in the middle, so that the client can act as if the connection were direct.
The main method is to use an ssh connection to forward the ssh protocol through one or more jump hosts using the ProxyJump, to an ssh server running on the target destination host. This method requires the jumpservers enable port forwarding.

ssh -J jumpserver:22 targetserver

In openssh version 7.2 and earlier, passing through jump hosts need the ProxyCommand option to be used either as a run time parameter or as part of ~/.ssh/config.

For example, in order to jump through host jumpserver to host targetserver, we need the following ssh command:

ssh -o ProxyCommand="ssh -W %h:%p jumpserver" targetserver

In this command, the authentication will happen twice, first on the jumpserver, then on the targetserver. So you need to have user/password for both jumpserver and targetserver.

Alternatively, we can put the ProxyCommand as part of ~/.ssh/config

Here is an example ~/.ssh/config

#=================
#~/.ssh/config
#=================
ServerAliveInterval 120

#don't apply any command to ssh localhost
Host localhost
    HostName localhost
    ProxyCommand none

#don't apply any command when ssh to any hostname start with jumpserver
Host jumpserver*
    HostName jumpserver
    ProxyCommand none

#apply proxy jump and ssh connection reuse when ssh to any other hosts
Host *
    ControlMaster auto
    #will create files such as ~/.ssh/master-youruid@targetserver:22 on client host
    ControlPath ~/.ssh/master-%r@%h:%p
    ControlPersist 20m
    ProxyCommand ssh -qA -W %h:%p jumpserver

With the above ~/.ssh/config file, you should be able to ssh into many target server by jumping through jumpserver.

You can forget about the jumpserver and type the normal command:
ssh targetserver

Then you need to enter credential for the jumpserve and targetserver once, then the jumpserver essentially becomes "invisible" in the later ssh connections.

As an extra bonus, the Control* configurations in the ~/.ssh/config prevent you to reentering the credentials again and again after the first time. After your first authenticate with the jumpserver and target host (maybe with 2 factor authentication process), you don't need to re-enter the credentials for reconnecting to the same target servers, unless you closed the ssh connection and didn't reconnect within 20 minutes.

The established connection is persisted in the files specified by the ControlPath for 20 minutes. For the target server, once you opened one ssh network connection, opening more ssh communication sessions with the same server has little resource overhead, you don't need any credential for these extra ssh sessions. The reason is, these new sessions didn't open new ssh connection to the jumpserver nor targetserver, they just have to reuse the existing tcp connection to send extra signals to the network socket using multiplexing. It reduces the load on the jumpserver and target server, also has faster response time.

How to use unix commands to troubleshoot network connection problems

Back>

In the era of internet of things, the skills of trouble-shooting network connectivity became more and more import. Due to its small footage and reliability, linux system are the most popular operation systems on numerous web application servers, docker images, AWS virtual machines, GCP pods, etc.

For example, you got some (pagerduty) alert about the the connection timeout exceptions on one of your web servers, the exception shows the target url http://xyznetwork.blogspot.com/2017/08/xyznetwork-how-to_5.html is not reachable.

DNS lookup

The trouble-shooting start at hostname lookup. You need to know if your dns server is able to solve the hostname part of the url to ip address.

The following command:

nslookup xyznetwork.blogspot.com

will reply you with an ip address or complain that "server can't find xyznetwork.blogspot.com: NXDOMAIN".

nslookup also allows reverse lookup ip address for hostname. As you may already guessed
nslookup 172.217.12.129 won't resolve to xyznetwork.blogspot.com, too many blog urls map to the same ip address, so the ip address won't map to any particular blog url.


dig xyznetwork.blogspot.com

will give you more information about he dns lookup process, including the technical details of the response from the dns servers.

with the trace flag, the dig will reveal the trace log of dns lookup process, including which dns servers were requested and which one of them has the authoritative answer about the ip address.

dig +trace xyznetwork.blogspot.com

dig's flag system also makes it a good scripting command.
For example, the most common dns queries are

  1. A (the IP address), 
  2. TXT (text annotations), 
  3. MX (mail exchanges), 
  4. NS nameservers.
by default, dig performs A query, the following commands will issue other types of queries and the +noall +answer control which part of the information to print to stdout.


dig xyznetwork.blogspot.com MX +noall + answer

=============================================
demo>dig xyznetwork.blogspot.com NS +noall +answer

; <<>> DiG 9.10.6 <<>> xyznetwork.blogspot.com NS +noall +answer
;; global options: +cmd
xyznetwork.blogspot.com. 23 IN CNAME blogspot.l.googleusercontent.com.
demo>dig xyznetwork.blogspot.com MX +noall +answer

; <<>> DiG 9.10.6 <<>> xyznetwork.blogspot.com MX +noall +answer
;; global options: +cmd

xyznetwork.blogspot.com. 2943 IN CNAME blogspot.l.googleusercontent.com.
=============================================

If your DNS servers has no problem of solving the hostname, the next check is to check the ip's reachability.

Routing to the target ip

The simple command ping is the first command we should issue.

ping 172.217.12.129
If the ping replies returned are fast and stable, we at least know the routing from the source ip to the target ip is ok and we don't have firewall dropping the network packets between source ip and target ip.

If the ping didn't go through, there are many possibilities. There is no routing to the ip, firewall is blocking us, the target ip disabled the ping reply, the gateway don't allow ping command to go through, etc. Just mention a few.

As a special note, you can ping the broadcast address to figure out the first hop of the routing process.

ping 255.255.255.255

When ping the broadcast address 255.255.255.255, all the discoverable hosts in your LAN will reply its ip address. One of them could be the network gateway, which is usually your router, one of them is the host you issue the ping command. The rest of them are the other hosts. If you don't want a host to be discovered by its neighbors, you can block the broadcast on the network gateway or configure the host to ignore ping traffic in its firewall.

To know more about the routing, use traceroute command
traceroute 172.217.12.129

The traceroute command will display the route taken by packets across an IP network from your host to the target ip. The ip address the packet traversal will be displayed sequentially. It also shows you how systems are connected to each other, letting you see how your ISP connects to the Internet as well as how the target system is connected. Many routers block traceroute command, making the target system topology invisible to users.

If the ping and traceroute shows there is no route to the target ip, we still can not get conclusion by the results of these 2 commands, since some network nodes might be blocking ICMP port.

However, since our web application previously can connect to the target url, we know for sure that, when everything is working, the http port 80 of the target host must open.

Check port availability

nc -zv xyznetwork.blogspot.com 80

To check if a port is open on a particular host, we can use netcat, the advantage the above command over "telnet xyznetwork.blogspot.com 80" are,

  • telnet command might be disabled, 
  • the nc print the result then exit, so we can scripting it for multiple hosts and ports.
For https connections, the port is 443
issue the following command to check the port https protocol needs:
nc -zv xyznetwork.blogspot.com 443

use openssl we can check the public key of the host server, make sure the target host is what we think it is:
openssl s_client -connect xyznetwork.blogspot.com:443
this command also tested the ssl handshaking process is working between your host and the target host.


At this point, if your dns servers can solve the hostname to target ip address, there is working route from host to the target ip, the port for http or https are open, we have to check application layer.

Check http protocol is working

curl http://xyznetwork.blogspot.com/2017/08/xyznetwork-how-to_5.html

curl https://xyznetwork.blogspot.com/2017/08/xyznetwork-how-to_5.html

Try use curl to issue the http GET/POST command to the target url, if the http webserver application hosted on the target server ip is working, we should get the html code wrapped in http response. In the above example, since the target url is a webpage, GET command is all we need to get the http response back from the webserver.

The curl command displays the plain text html code, that the web browser such as google chrome, firefox used to generate the colorful webpage.

If the curl command can not communicate with the target web server with correct http command (default is GET), headers, protocol, url string, request parameter,  request body etc, then it is time to escalate the issue to the network operation center of your organization.

Your network operation center might reply. Hey, we recently applied new firewall rules, your access to the outside url must go through proxy server, here is the proxy server dev.fancycorpproxy.com, the proxy port is 8080.

curl -x 'dev.fancycorpproxy.com:8080' http://xyznetwork.blogspot.com/2017/08/xyznetwork-how-to_5.html

Then you should try with curl command with proxy, if response come back from xyznetwork.blogspot.com, that could explain the connectivity issue. If the proxy server gives you something like 403 forbidden, please contact fancycorp IT administrator at email blabla, they need to add a new firewall rule or a new proxy ACL.

If your network operation center don't have explanation,  In this case it is google.com...probably you won't get to this problem and probably the other side already known about the issue.

Check your own application

Assuming the application logged the connection timeout is a java application, we need to inspect the network connectivity of the process reporting the issue.

netstat -nulpt | grep java

The netstat command will list all the listening port for a process with java in the name. You can figure out if there are established connections to the target server, if the debug port is opening, or someone is currently connecting to the process via a local connection, which indicates the existence of a reverse proxy setup on the host etc.

If you are worrying about rouge host in your network, a tell-tell check is to use arp -a, this list gives away all the hosts you recently connected to. Do the ips you are connecting have the correct MAC address it suppose to be?

demo>arp -a
openrg.home (192.168.1.1) at f6:4f:5a:4:7b:f2 on en1 ifscope [ethernet]
? (224.0.0.251) at 1:0:5e:0:0:fb on en1 ifscope permanent [ethernet]
? (239.255.255.250) at 1:0:5e:7f:ff:fa on en1 ifscope permanent [ethernet]

In the above example, all the 3 entries are normal:


  • 192.168.1.1 is the gateway. 
  • 224.0.0.251 is the address for the multicast DNS (mDNS) protocol. The mDNS protocol resolves hostnames to IP addresses within small networks that do not include a local name server. It is a zero-configuration service, using essentially the same programming interfaces, packet formats and operating semantics as the unicast Domain Name System (DNS). 
  • 239.255.255.250 This address is used for UPnP (Universal Plug and Play)/SSDP (Simple Service Discovery Protocol) by various vendors to advertise the capabilities of (or discover) devices on a VLAN. MAC OS, Microsoft Windows, IOS and other operating systems and applications use this protocol. Client devices can use this protocol to advertise its capabilities to other devices.


How to bridge you external url to internal url

Back>

Often times, your external url will look like:
http://greatfun.itworld.com/tutorial/xyznetwork
http://mobile.itworld.com/tutorial/xyznetwork
http://affiliate.itworld.com/tutorial/xyznetwork
http://greatfun.itworld.com/tutorial/xyzcode
http://greatfun.itworld.com/tutorial/cyberjedizen

However internally, you may have server farms with urls like:
http://ohio.internal.prod.kl2217.org/tier1/kwddy/xyznetwork
http://ri.internal.prod.kl2217.org/tier1/kwddy/xyznetwork
http://ohio.internal.prod.kl2217.org/tier1/dqml0/xyzcode
http://ri.internal.prod.kl2217.org/seti/tier1/dqml2/xyzcode
http://us.internal.prod.secure.cloud.com/mmi/cyberjedizen

The question is, how to translate external urls into internal urls so that your clients have simple urls to remember but your internal IT can have name conventions and network details for server farms.

You may think, well, that's easy. A proxy such as apache mod_proxy can easily translate
http://greatfun.itworld.com/tutorial/xyznetwork
to 
http://ohio.internal.prod.kl2217.org/tier1/kwddy/xyznetwork

However, the issue is not that simple if we assume there are lots of requests issued towards those external urls.

First of all, you have to load balance the traffic, distributed them to groups of hosts inside server pools. 

Secondly, the DNS server have to translate the external requests' url to your load-balancer's VIPs fast.

Thirdly, the traffic won't be stable during a day, there could be spikes of requests, for example when there are friendly/unfriendly bots requests arriving your site.

Now think about the issue again.

DNS servers


At least, you need an external DNS for solving the external urls. Your external DNS servers should be the Authoritative-Only DNS Server. They won't response to recursive queries issued by caching DNS name servers, it won't cache because it only dedicated to solve your domain names, as a result it is optimized to respond to the queries for your external urls as fast as possible.

You'd better to have an internal DNS for solving the internal urls. Mixing external and internal DNS's servers won't be good.

While the external dns servers only concern about  the external urls, the internal dns servers need to do more. They contains the authoritative information that the public DNS provides, as well as additional information about internal hosts and services. It might also act as caching dns servers for its internal clients. From a security standpoint, that the public server has no records of the private counterpart is desirable. In case your public DNS servers are compromised, your internal dns zone files won't be exposed to public.

Load Balancers


There are a few types of load balancing:

  • round robin
  • weighted round robin
  • round robin + uptime monitoring

The load balancing decisions can happen at many levels: DNS level, site level, server level and VM level.

load-balancing
load-balancing



DNS level LB

Start from the external DNS, for the queries to the same external url, http://greatfun.itworld.com/tutorial/xyznetwork
the DNS can reply many IPs. The replied ip is one of the VIPs of the load-balancer's server farm. For example, VIPs managed by a F5 BIG IP load-balancer's LTM (local traffic manager). Sometimes, the DNS server and load balancer is the same unit, for example F5 BIG IP have GTM (global traffic manager) for DNS level load-balancing as well as LTM (local traffic manager) for server level load-balancing.

It is a common pitfall to use DNS level load-balancing to switch traffic between sites. The switch won't happen immediately, but happened gradually instead. That is because your clients might cache the DNS response for a period of time. So even though your DNS stops publishing one site's VIP, the traffic can still go to those unpublished VIPs for a while, until your clients' cached dns records expire. Generally browsers don't cache dns records, but web clients could cache the dns records as long as they are configured.

Site level LB

Your F5 BIG IP load-balancer software can provide site level load-balancing. It groups hosts/VMs into Servers, then group servers into cells. A cell could be a site, a functional department, a tier. The BIG IP load-balancer then make load-balance decision at cell level: such as evenly distribute the load between ohio site cell and ri site cell, or switch off ri site cell for maintain, or add pilot cell for testing new release.


Server level LB

You load-balancer should distributes client requests to multiple servers instead of to the specified destination IP address only.

For example, the DNS server returns one of the VIPs of the F5 BIG IP load balancer for the client request. A virtual server is a traffic-management object on the BIG-IP system that is represented by a VIP (virtual IP) address and a service, such as 192.168.20.10:80.

When you create a virtual server, you specify the load balancing pools that you want to use as the destination for any traffic coming from that virtual server. You also configure its general properties, such as iRules.

A load balancing pool is a logical set of devices, such as web servers, that you group together to receive and process traffic. A pool member is a logical object that represents a physical node (server). A node usually have one IP, but may have multiple hosts sharing the IP. An individual pool member can belong to one or multiple pools, depending on how you want to manage your network traffic. The specific pool member to which Local Traffic Manager chooses to send the request is determined by the load balancing method that you have assigned to that pool. The default load balancing method is Round Robin, which evenly distribute requests across the servers in the pool. Advanced load balancing method needs the help of iRule. F5 Big IP LTM is capable of inspecting url, applying iRules to the path (for example looking for certain pattern match) then routing the requests to different server pools.


  1. when HTTP_REQUEST {
  2.     if { [HTTP::uri] ends_with “xyznetwork” } {
  3.     pool xyznetwork_Pool
  4. } 
  5.     if { [HTTP::uri] ends_with “xyzcode” } {
  6.         pool xyzcode_Pool
  7.     }
  8.     if { [HTTP::uri] ends_with “cyberjedizen” } {
  9.         pool cyberjedizen_Pool
  10.     }
  11.     if { [HTTP::uri] ends_with “kl2217” } {
  12.         pool kl2217_Pool
  13.     }
  14. }

Don't get confused about the word "route", we are actually talking about load balancing based on url, instead of IP layer routing based on IP and subnet mask.

VM level LB

Please notice your physical hosts might have hypervisor running on them. The hypervisor might have multiple VMs hosted in it. Depending on the Hypervisor's configuration, the hardware resources are shared among the VMs. Resources such as cpu cycle, memory, disk space, network bandwidth are all configurable. Load balancing can happen at this level as well. For example, the hypervisor might decide to distribute more loads to the VM with more vCPUs, but distribute less loads to the VM with less vCPUs.

Proxy Servers

There are many reason for using proxy servers. For example, your web application needs to access endpoints located in the public cloud. The requests to those endpoints generally go through the proxy servers for better security. You can put your proxy servers behind the F5 server, then put the proxy servers inside the DMZ. Those proxy servers are heavily guarded, network administrators can apply blacklist as well as whitelist for certain IPs there, these proxy servers can have the certificate installed and inspected, they can have firewall, IDS/IPS running there as well.

Another reason for having proxy servers is to have them act as some sort of reverse DNS servers, for example,
map http://greatfun.itworld.com/tutorial/xyznetwork
to 
http://ohio.internal.prod.kl2217.org/tier1/kwddy/xyznetwork

This url then get response from internal DNS server, which solve the hostname to the VIPs of internal F5 load-balancer.