/bin/sh <<'TB_PUBLIC'
date -u
/usr/sbin/sysctl net.inet.tcp.tso
echo 'Corporate connection and queued bytes:'
netstat -an -p tcp | awk '/194[.]186[.]63[.]/ && /ESTABLISHED/ {print}'
echo 'Routes:'
for tb_target in 1.0.0.1 1.1.1.1 172.21.0.1; do
/sbin/route -n get "$tb_target" |
awk '/route to:|gateway:|interface:/ {print}'
done
echo 'Primary DNS resolver, including its actual port:'
/usr/sbin/scutil --dns | awk '
/^resolver #1$/ {tb=1; next}
tb && /^resolver #/ {exit}
tb && /nameserver|port|if_index|flags|reach/ {print}
'
echo 'System proxy enable flags:'
/usr/sbin/scutil --proxy |
awk '/(HTTPEnable|HTTPSEnable|SOCKSEnable|ProxyAutoConfigEnable|ProxyAutoDiscoveryEnable) :/ {print}'
echo 'Corporate DNS resolving a public website:'
dig @172.21.0.1 one.one.one.one A \
+time=4 +tries=1 +notcp +ignore +noall +comments +answer
tb_https() {
/usr/bin/curl -q -4 --http1.1 --noproxy '*' \
--connect-timeout 8 --max-time 12 -sS -o /dev/null \
-w 'ip=%{remote_ip} http=%{http_code} bytes=%{size_download} dns=%{time_namelookup} tcp=%{time_connect} tls=%{time_appconnect} first_byte=%{time_starttransfer} total=%{time_total}\n' \
"$@" 'https://one.one.one.one/'
}
echo 'PUBLIC PAGE: normal DNS'
tb_https
echo 'PUBLIC PAGE: address supplied for this request'
tb_https --resolve one.one.one.one:443:1.0.0.1
echo 'Corporate connection afterward:'
netstat -an -p tcp | awk '/194[.]186[.]63[.]/ && /ESTABLISHED/ {print}'
TB_PUBLIC