<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Knowledge Base (Posts about network)</title><link>https://bgstack15.ddns.net/blog/</link><description></description><atom:link href="https://bgstack15.ddns.net/blog/categories/network.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2025 &lt;a href="mailto:bgstack15@gmail.com"&gt;bgstack15&lt;/a&gt; 
&lt;a rel="license" href="https://www.gnu.org/licenses/gpl-3.0.html"&gt;
&lt;img alt="GNU General Public License v3.0"
style="border-width:0; margin-bottom:12px;"
src="https://bgstack15.ddns.net/.images/gplv3-127x51.png"&gt;&lt;/a&gt;</copyright><lastBuildDate>Tue, 29 Jul 2025 18:31:28 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Rocky 9 kvm networked bridge interface</title><link>https://bgstack15.ddns.net/blog/posts/2025/07/26/rocky-9-kvm-networked-bridge-interface/</link><dc:creator>bgstack15</dc:creator><description>&lt;p&gt;Similar to what I did on &lt;a href="https://bgstack15.ddns.net/blog/posts/2018/07/20/instructions-for-setting-up-a-centos-7-system-with-bridged-networking-for-virtual-machines/"&gt;CentOS 7 all those years ago&lt;/a&gt;, I needed to set up a bridge network interface in my current setup on Rocky 9. This design seems to be imperfect, but I guess it will have to do. The problem I have found is that it takes a few minute after boot before it is up, so my nfs server doesn't seem to start. But more on that later.&lt;/p&gt;
&lt;p&gt;The main purpose of a bridged network device is so virtual machines will be on the main network, accessible to all systems.&lt;/p&gt;
&lt;p&gt;After ensuring the basic network card exists, named enp0s25 on my system, use nmcli to make the new device.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;sudo nmcli con add ifname br0 type bridge con-name br0
sudo nmcli con add type bridge-slave ifname enp0s25 master br0
sudo nmcli con modify br0 ipv4.addresses 192.168.1.58/24 ipv4.method manual # this server1 ip address
sudo nmcli con modify br0 ipv4.gateway 192.168.1.254 # default gateway of main network
sudo nmcli con modify br0 ipv4.dns 192.168.1.10,192.168.1.11 # default dns servers
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Configure qemu to allow... whatever this allows. I didn't read it.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;sudo tee -a /etc/qemu-kvm/bridge.conf &amp;lt;&amp;lt;EOF
allow all
EOF
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And then take down enp0s25 and up br0.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;sudo nmcli con down ep0s25 ; sudo nmcli con up br0 ;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Of course the usual warnings apply about doing this remotely. Yes, I did it remotely (the second time, when my config was actually valid).&lt;/p&gt;
&lt;p&gt;It took within 2 minutes to actually bring the network up! So this affects nfs-server on reboot. Still, I will talk about that further down.&lt;/p&gt;
&lt;p&gt;I wrote file &lt;code&gt;bridge.xml&lt;/code&gt;. Its path is irrelevant because you will input it to virsh.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="nt"&gt;&amp;lt;network&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;name&amp;gt;&lt;/span&gt;br0&lt;span class="nt"&gt;&amp;lt;/name&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;forward&lt;/span&gt; &lt;span class="na"&gt;mode=&lt;/span&gt;&lt;span class="s"&gt;"bridge"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;bridge&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"br0"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/network&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And then load this definition to virsh.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;sudo virsh net-define ./bridge.xml
sudo virsh net-start br0
sudo virsh net-autostart br0
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And then restart libvirtd.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;sudo systemctl restart libvirtd
&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;Experiment for nfs-server&lt;/h2&gt;
&lt;p&gt;Because of the delays (only on my hardware?) for the bridge to come up, nfs-server fails to start. And since I serve /var/lib/libvirt/images to the other virtual machine hosts from this server, that is a huge problem! I currently have an experiment in place, and will need to determine over time if this has solved my problem.&lt;/p&gt;
&lt;p&gt;I edited nfs-server:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="n"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;systemctl&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;edit&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;nfs&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Unit&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="k"&gt;After&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;devices&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;virtual&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;br0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;device&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="n"&gt;Requires&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;devices&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;virtual&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;br0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;device&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;&lt;span class="n"&gt;wq&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Let us see over time if this will help the nfs server come up when the whole system/network is ready.&lt;/p&gt;
&lt;h2&gt;Auxiliary and raw notes&lt;/h2&gt;
&lt;p&gt;Reference 1's guide didn't seem to work so well for me. I had to delete all that effort, restore my network card definition entirely, and then try with Reference 2.&lt;/p&gt;
&lt;p&gt;The commands that did not work for me:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;sudo&lt;/span&gt; &lt;span class="nv"&gt;nmcli&lt;/span&gt; &lt;span class="nv"&gt;con&lt;/span&gt; &lt;span class="k"&gt;show&lt;/span&gt;
&lt;span class="nv"&gt;sudo&lt;/span&gt; &lt;span class="nv"&gt;nmcli&lt;/span&gt; &lt;span class="nv"&gt;con&lt;/span&gt; &lt;span class="nv"&gt;delete&lt;/span&gt; &lt;span class="nv"&gt;enp0s25&lt;/span&gt;
&lt;span class="nv"&gt;sudo&lt;/span&gt; &lt;span class="nv"&gt;nmcli&lt;/span&gt; &lt;span class="nv"&gt;con&lt;/span&gt; &lt;span class="nv"&gt;add&lt;/span&gt; &lt;span class="nv"&gt;type&lt;/span&gt; &lt;span class="nv"&gt;bridge&lt;/span&gt; &lt;span class="nv"&gt;autoconnect&lt;/span&gt; &lt;span class="nv"&gt;yes&lt;/span&gt; &lt;span class="nv"&gt;con&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;name&lt;/span&gt; &lt;span class="nv"&gt;br0&lt;/span&gt; &lt;span class="nv"&gt;ifname&lt;/span&gt; &lt;span class="nv"&gt;virbr0&lt;/span&gt;
&lt;span class="nv"&gt;sudo&lt;/span&gt; &lt;span class="nv"&gt;nmcli&lt;/span&gt; &lt;span class="nv"&gt;con&lt;/span&gt; &lt;span class="nv"&gt;modify&lt;/span&gt; &lt;span class="nv"&gt;br0&lt;/span&gt; &lt;span class="nv"&gt;ipv4&lt;/span&gt;.&lt;span class="nv"&gt;addresses&lt;/span&gt; &lt;span class="mi"&gt;192&lt;/span&gt;.&lt;span class="mi"&gt;168&lt;/span&gt;.&lt;span class="mi"&gt;1&lt;/span&gt;.&lt;span class="mi"&gt;58&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;24&lt;/span&gt; &lt;span class="nv"&gt;ipv4&lt;/span&gt;.&lt;span class="nv"&gt;method&lt;/span&gt; &lt;span class="nv"&gt;manual&lt;/span&gt;
&lt;span class="nv"&gt;sudo&lt;/span&gt; &lt;span class="nv"&gt;nmcli&lt;/span&gt; &lt;span class="nv"&gt;con&lt;/span&gt; &lt;span class="nv"&gt;modify&lt;/span&gt; &lt;span class="nv"&gt;br0&lt;/span&gt; &lt;span class="nv"&gt;ipv4&lt;/span&gt;.&lt;span class="nv"&gt;gateway&lt;/span&gt; &lt;span class="mi"&gt;192&lt;/span&gt;.&lt;span class="mi"&gt;168&lt;/span&gt;.&lt;span class="mi"&gt;1&lt;/span&gt;.&lt;span class="mi"&gt;254&lt;/span&gt;
&lt;span class="nv"&gt;sudo&lt;/span&gt; &lt;span class="nv"&gt;nmcli&lt;/span&gt; &lt;span class="nv"&gt;con&lt;/span&gt; &lt;span class="nv"&gt;modify&lt;/span&gt; &lt;span class="nv"&gt;br0&lt;/span&gt; &lt;span class="nv"&gt;ipv4&lt;/span&gt;.&lt;span class="nv"&gt;dns&lt;/span&gt; &lt;span class="mi"&gt;192&lt;/span&gt;.&lt;span class="mi"&gt;168&lt;/span&gt;.&lt;span class="mi"&gt;1&lt;/span&gt;.&lt;span class="mi"&gt;10&lt;/span&gt;,&lt;span class="mi"&gt;192&lt;/span&gt;.&lt;span class="mi"&gt;168&lt;/span&gt;.&lt;span class="mi"&gt;1&lt;/span&gt;.&lt;span class="mi"&gt;11&lt;/span&gt;
&lt;span class="nv"&gt;sudo&lt;/span&gt; &lt;span class="nv"&gt;nmcli&lt;/span&gt; &lt;span class="nv"&gt;con&lt;/span&gt; &lt;span class="nv"&gt;add&lt;/span&gt; &lt;span class="nv"&gt;type&lt;/span&gt; &lt;span class="nv"&gt;bridge&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;slave&lt;/span&gt; &lt;span class="nv"&gt;autoconnect&lt;/span&gt; &lt;span class="nv"&gt;yes&lt;/span&gt; &lt;span class="nv"&gt;con&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;name&lt;/span&gt; &lt;span class="nv"&gt;enp0s25&lt;/span&gt; &lt;span class="nv"&gt;master&lt;/span&gt; &lt;span class="nv"&gt;br0&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I don't feel like learning what I did wrong with that. Reference 2 worked, and I have other problems than comprehending the network card stupidity of RHEL.&lt;/p&gt;
&lt;h2&gt;References&lt;/h2&gt;
&lt;h3&gt;Weblinks&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://bgstack15.ddns.net/blog/outbound/https:/docs.rockylinux.org/guides/virtualization/libvirt-rocky/"&gt;Setting Up libvirt on Rocky Linux - Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://bgstack15.ddns.net/blog/outbound/https:/www.answertopia.com/rocky-linux/creating-a-rocky-linux-kvm-networked-bridge-interface/"&gt;Creating a Rocky Linux 9 KVM Networked Bridge Interface – Answertopia&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Internal files&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;server1a-log.md&lt;/li&gt;
&lt;/ol&gt;</description><category>network</category><category>rocky</category><category>virtual</category><guid>https://bgstack15.ddns.net/blog/posts/2025/07/26/rocky-9-kvm-networked-bridge-interface/</guid><pubDate>Sat, 26 Jul 2025 13:05:00 GMT</pubDate></item><item><title>Blocking outbound dns</title><link>https://bgstack15.ddns.net/blog/posts/2023/02/25/blocking-outbound-dns/</link><dc:creator>bgstack15</dc:creator><description>&lt;p&gt;The overall goal is to have all dns requests possible go to my recursive servers.&lt;/p&gt;
&lt;h3&gt;List of my dns servers&lt;/h3&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;$ dig -t NS ipa.internal.com
&lt;span class="p"&gt;;;&lt;/span&gt; ANSWER SECTION:
ipa.internal.com.   &lt;span class="m"&gt;604800&lt;/span&gt;  IN  NS  dns2.ipa.internal.com.
ipa.internal.com.   &lt;span class="m"&gt;604800&lt;/span&gt;  IN  NS  dns1.ipa.internal.com.
&lt;span class="p"&gt;;;&lt;/span&gt; ADDITIONAL SECTION:
dns1.ipa.internal.com.  &lt;span class="m"&gt;604800&lt;/span&gt;  IN  A   &lt;span class="m"&gt;192&lt;/span&gt;.168.1.50
dns2.ipa.internal.com.  &lt;span class="m"&gt;604800&lt;/span&gt;  IN  A   &lt;span class="m"&gt;192&lt;/span&gt;.168.1.51
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Dns3 host is a freeipa domain replica but does not have dns+dhcp on it as of 2023-02.&lt;/p&gt;
&lt;h2&gt;Experiment 1&lt;/h2&gt;
&lt;p&gt;Just redirect all outbound dns requests to my dns servers. This is done by setting a command on router1.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;DNS="192.168.1.50"
iptables -t nat -I PREROUTING -i br0 -p udp --dport 53 -j DNAT --to "&lt;span class="cp"&gt;${&lt;/span&gt;&lt;span class="n"&gt;DNS&lt;/span&gt;&lt;span class="cp"&gt;}&lt;/span&gt;:53"
iptables -t nat -I PREROUTING -i br0 -p udp -s "&lt;span class="cp"&gt;${&lt;/span&gt;&lt;span class="n"&gt;DNS&lt;/span&gt;&lt;span class="cp"&gt;}&lt;/span&gt;" --dport 53 -j ACCEPT
test -f /jffs/doh-ipv4 &lt;span class="err"&gt;&amp;amp;&amp;amp;&lt;/span&gt; sh /jffs/doh-ipv4
test -f /jffs/doh-ipv6 &lt;span class="err"&gt;&amp;amp;&amp;amp;&lt;/span&gt; sh /jffs/doh-ipv6
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Added this to the "firewall command" of the router, web ui -&amp;gt; tab Administration -&amp;gt; tab Commands.&lt;/p&gt;
&lt;p&gt;I modified dns1 named.conf to include some logging of queries:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="n"&gt;channel&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;queries_log&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/var/named/queries"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;versions&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;yes&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;category&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;yes&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;severity&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;yes&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;severity&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="n"&gt;category&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;queries&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;queries_log&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Inside the logging{} section. &lt;a href="https://kb.isc.org/docs/aa-01526"&gt;Reference 6&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This experiment was successful. On dns1, /var/named/queries shows the queries being submitted.&lt;/p&gt;
&lt;h2&gt;Experiment 2: see if I can get extra, permanent storage with usb drive&lt;/h2&gt;
&lt;p&gt;I grabbed a 128MB USB flash drive (yes, MB). I enabled usb support in the web ui: tab Services -&amp;gt; tab USB -&amp;gt; core USB Support is enabled, mount this partition to /jffs: 581af4db-8dfc-41af-9e8b-f612bd32508c&lt;/p&gt;
&lt;p&gt;I also enabled jffs2 stuff in web ui: tab Administration -&amp;gt; tab Management -&amp;gt; section JFFS2 Support -&amp;gt; Intenal flash storage enabled&lt;/p&gt;
&lt;p&gt;Some commands I ran on router1:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;fdisk -l
# i already had a partition on msdos label, but it was not formatted yet
mkfs.ext4 /dev/sda1
modprobe ext4
mount /dev/sda1 /jffs
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This appears to work persistently after reboots.&lt;/p&gt;
&lt;h2&gt;Experiment 3: manual DoH block functionality&lt;/h2&gt;
&lt;p&gt;I set up the blocking script and run it on the dd-wrt router.
goal: manually copy up the IPv4 (and IPv6?) servers to be blocked, add routing rules to disallow connections to those&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;echo '#!/bin/sh' &amp;gt; ~/doh-ipv4
for ip in $( &lt;span class="nt"&gt;&amp;lt;doh&lt;/span&gt;&lt;span class="err"&gt;-ipv4.txt&lt;/span&gt; &lt;span class="err"&gt;awk&lt;/span&gt; &lt;span class="err"&gt;'{print&lt;/span&gt; &lt;span class="err"&gt;$1}'&lt;/span&gt; &lt;span class="err"&gt;)&lt;/span&gt; &lt;span class="err"&gt;;&lt;/span&gt; &lt;span class="err"&gt;do&lt;/span&gt; &lt;span class="err"&gt;echo&lt;/span&gt; &lt;span class="err"&gt;"iptables&lt;/span&gt; &lt;span class="err"&gt;-I&lt;/span&gt; &lt;span class="err"&gt;FORWARD&lt;/span&gt; &lt;span class="err"&gt;-p&lt;/span&gt; &lt;span class="err"&gt;tcp&lt;/span&gt; &lt;span class="err"&gt;-d&lt;/span&gt; &lt;span class="err"&gt;${ip}&lt;/span&gt; &lt;span class="err"&gt;--dport&lt;/span&gt; &lt;span class="err"&gt;443&lt;/span&gt; &lt;span class="err"&gt;-j&lt;/span&gt; &lt;span class="err"&gt;REJECT&lt;/span&gt; &lt;span class="err"&gt;--reject-with&lt;/span&gt; &lt;span class="err"&gt;tcp-reset"&lt;/span&gt; &lt;span class="err"&gt;;&lt;/span&gt; &lt;span class="err"&gt;done&lt;/span&gt; &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&amp;gt; ~/doh-ipv4
# copy it to router1
&lt;span class="err"&gt;&amp;lt;&lt;/span&gt;~/doh-ipv4 ssh root@router1 'cat &amp;gt; /jffs/doh-ipv4'
ssh root@router1 chmod +x /jffs/doh-ipv4
&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;Experiment 4: ipv6 doh blocking&lt;/h2&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;echo '#!/bin/sh' &amp;gt; ~/doh-ipv6
for ip in $( &lt;span class="nt"&gt;&amp;lt;doh&lt;/span&gt;&lt;span class="err"&gt;-ipv6.txt&lt;/span&gt; &lt;span class="err"&gt;awk&lt;/span&gt; &lt;span class="err"&gt;'{print&lt;/span&gt; &lt;span class="err"&gt;$1}'&lt;/span&gt; &lt;span class="err"&gt;)&lt;/span&gt; &lt;span class="err"&gt;;&lt;/span&gt; &lt;span class="err"&gt;do&lt;/span&gt; &lt;span class="err"&gt;echo&lt;/span&gt; &lt;span class="err"&gt;"ip6tables&lt;/span&gt; &lt;span class="err"&gt;-I&lt;/span&gt; &lt;span class="err"&gt;FORWARD&lt;/span&gt; &lt;span class="err"&gt;-p&lt;/span&gt; &lt;span class="err"&gt;tcp&lt;/span&gt; &lt;span class="err"&gt;-d&lt;/span&gt; &lt;span class="err"&gt;${ip}&lt;/span&gt; &lt;span class="err"&gt;--dport&lt;/span&gt; &lt;span class="err"&gt;443&lt;/span&gt; &lt;span class="err"&gt;-j&lt;/span&gt; &lt;span class="err"&gt;REJECT&lt;/span&gt; &lt;span class="err"&gt;--reject-with&lt;/span&gt; &lt;span class="err"&gt;tcp-reset"&lt;/span&gt; &lt;span class="err"&gt;;&lt;/span&gt; &lt;span class="err"&gt;done&lt;/span&gt; &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&amp;gt; ~/doh-ipv6
# copy it to router1; scp was acting weird so use a stream
&lt;span class="err"&gt;&amp;lt;&lt;/span&gt;~/doh-ipv6 ssh root@router1 'cat &amp;gt; /jffs/doh-ipv6'
ssh root@router1 chmod +x /jffs/doh-ipv6
&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;Improve&lt;/h2&gt;
&lt;p&gt;I still need to set up a cron job script for doing all this automatically. For now, I have to run these steps manually. I suppose the script would pull the latest contents from the doh list git repo, generate the script, upload it, and optionally run it. I have not pondered how to prevent duplicate entries yet.&lt;/p&gt;
&lt;h2&gt;Dependencies&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Upstream doh list at &lt;a href="https://github.com/dibdot/DoH-IP-blocklists"&gt;reference 2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Alternatives&lt;/h2&gt;
&lt;p&gt;Just allow all dns traffic to outside, which loses control of my network.&lt;/p&gt;
&lt;h2&gt;References&lt;/h2&gt;
&lt;h3&gt;Weblinks&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://old.reddit.com/r/pihole/comments/gicwex/making_a_doh_blocklist_for_ddwrt_routers/"&gt;https://old.reddit.com/r/pihole/comments/gicwex/making_a_doh_blocklist_for_ddwrt_routers/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/dibdot/DoH-IP-blocklists"&gt;https://github.com/dibdot/DoH-IP-blocklists&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.dd-wrt.com/wiki/index.php/USB_storage"&gt;https://wiki.dd-wrt.com/wiki/index.php/USB_storage&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.dd-wrt.com/wiki/index.php/JFFS_File_System#Add_USB_Storage"&gt;https://wiki.dd-wrt.com/wiki/index.php/JFFS_File_System#Add_USB_Storage&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;test DoH to specifically cloudflare: &lt;a href="https://cloudflare-dns.com/help"&gt;https://cloudflare-dns.com/help&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kb.isc.org/docs/aa-01526"&gt;https://kb.isc.org/docs/aa-01526&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Internal files&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;file:&gt;&lt;/file:&gt;&lt;/li&gt;
&lt;/ol&gt;</description><category>block</category><category>dns</category><category>experiment</category><category>firewall</category><category>network</category><category>routing</category><guid>https://bgstack15.ddns.net/blog/posts/2023/02/25/blocking-outbound-dns/</guid><pubDate>Sat, 25 Feb 2023 14:26:06 GMT</pubDate></item><item><title>I finally started using autofs for my network mounts!</title><link>https://bgstack15.ddns.net/blog/posts/2022/11/21/i-finally-started-using-autofs/</link><dc:creator>bgstack15</dc:creator><description>&lt;p&gt;In the past, I wrote about my ripped-off &lt;a href="https://bgstack15.ddns.net/blog/posts/2020/10/24/package-for-devuan-myautomount"&gt;myautomount&lt;/a&gt; program which was a bash rewrite of a &lt;a href="https://github.com/project-trident/trident-utilities/blame/master/src-go/automount/main.go"&gt;Go tool from TridentOS&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;One main use of autofs is to automount network locations. I of course have my own nfs server and several mounts that are useful on all my clients. Here is what I set up for myself:&lt;/p&gt;
&lt;p&gt;File &lt;code&gt;/etc/autofs.internal-wireless&lt;/code&gt;.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;fstype&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;nfs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;noatime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;rw&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;nosuid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;rsize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;262144&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;wsize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;262144&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;soft&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;server3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;server3&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;shares&lt;/span&gt;&lt;span class="o"&gt;/&amp;amp;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And file &lt;code&gt;/etc/auto.master.d/internal-wireless.autofs&lt;/code&gt;.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;autofs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;internal&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;wireless&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mh"&gt;5&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I also set the user's xfe bookmarks to include &lt;code&gt;/net/$USERNAME&lt;/code&gt; manually. I don't currently use nfs-mounted home directories, but each user has a primary export on the file server. For future reference, an Xfe bookmark is simply in file &lt;code&gt;~/.config/xfe/xferc&lt;/code&gt;:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="k"&gt;[bookmarks]&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="na"&gt;BOOKMARK1&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/net/${USERNAME}&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Where $USERNAME is of course fully evaluated already, so &lt;code&gt;/mnt/bgstack15&lt;/code&gt;.&lt;/p&gt;</description><category>autofs</category><category>network</category><guid>https://bgstack15.ddns.net/blog/posts/2022/11/21/i-finally-started-using-autofs/</guid><pubDate>Tue, 22 Nov 2022 00:35:55 GMT</pubDate></item><item><title>Use "Remote Printer" driver for cups-shared printer in cups client</title><link>https://bgstack15.ddns.net/blog/posts/2022/11/17/use-remote-printer-driver-for-cups-shared-printer-in-cups-client/</link><dc:creator>bgstack15</dc:creator><description>&lt;p&gt;I use a &lt;a href="https://www.cups.org/"&gt;cups&lt;/a&gt; print server to share a USB-connected printer. One of my new network clients needed the printer set up, and of course my client runs cups too. An existing cups client uses the printer with a "remote printer" driver that works well, and the closest model number in the built-in list after installing the generic, distro-provided package for this brand printed the page incredibly wrong.&lt;/p&gt;
&lt;p&gt;So, I spent time learning how to set up the cups client to use "Remote Printer (grayscale, 2-sided printing)" driver, which presumably then lets the cups server use the correct driver I would have set up at least once on the real print server.&lt;/p&gt;
&lt;p&gt;On the cups client, visit the cups web interface, normally http://localhost:631, and navigate to Administration -&amp;gt; add printer.&lt;/p&gt;
&lt;p&gt;Select ipp printer type, and add your network printer: Mine was ipp://192.168.1.150:631/printers/printername. Add name, etc. Now, on the cups page where you select make and model or PPD file, select "Raw" -&amp;gt; IPP Everywhere. Then select button "Add Printer."&lt;/p&gt;
&lt;h2&gt;References&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://unix.stackexchange.com/questions/490368/cups-share-printer-with-generic-driver/724975#724975"&gt;CUPS: Share printer with generic driver - Unix &amp;amp; Linux Stack Exchange&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</description><category>cups</category><category>network</category><category>printer</category><guid>https://bgstack15.ddns.net/blog/posts/2022/11/17/use-remote-printer-driver-for-cups-shared-printer-in-cups-client/</guid><pubDate>Thu, 17 Nov 2022 14:19:51 GMT</pubDate></item><item><title>Run program without network access</title><link>https://bgstack15.ddns.net/blog/posts/2022/08/05/run-program-without-ntework-access/</link><dc:creator>bgstack15</dc:creator><description>&lt;p&gt;If you want to run a program with a special restriction, such as without network access, you can do that with the &lt;code&gt;unshare(1)&lt;/code&gt; utility.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;unshare -r -n makemkv
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I had noticed that makemkv makes some unwanted network traffic, and I was too lazy to insert my &lt;a href="https://bgstack15.ddns.net/blog/posts/2020/10/04/setting-up-a-transparent-proxy-for-internal-network/"&gt;network proxy&lt;/a&gt; from the past. So a quick Internet search later, and I learned about unshare.&lt;/p&gt;
&lt;p&gt;Unshare -n usually needs -r so the application will run. Read the &lt;a href="https://www.man7.org/linux/man-pages/man1/unshare.1.html"&gt;man page&lt;/a&gt; for details.&lt;/p&gt;</description><category>linux</category><category>network</category><category>sandbox</category><guid>https://bgstack15.ddns.net/blog/posts/2022/08/05/run-program-without-ntework-access/</guid><pubDate>Fri, 05 Aug 2022 13:29:45 GMT</pubDate></item><item><title>Fedora 33 nslookup works but ping does not</title><link>https://bgstack15.ddns.net/blog/posts/2021/05/07/fedora-33-nslookup-works-but-ping-does-not/</link><dc:creator>bgstack15</dc:creator><description>&lt;p&gt;On my shiny new upgraded Fedora 33 desktop, I was unable to connect to my ssh
server vm3.ipa.example.com. Of course my vm environment uses dhcp and I know
I've had some dynamic dns update problems, and I just rebooted my dns servers,
so maybe something was amiss. I logged in to the console of the vm (&lt;code&gt;virsh
console vm3&lt;/code&gt;) and made sure the system had the IP address I expected. Nslookup
works, and shows me the same IP address. So why does ssh show "hostname not
found"? The answer is: &lt;strong&gt;systemd-resolved&lt;/strong&gt; had taken control of
/etc/resolv.conf and made it a symlink to &lt;code&gt;../run/systemd/resolve/resolv.conf&lt;/code&gt;
which obviously is not what I want. So, I unlinked the file, made the real
resolv.conf, and also threw in a bonus:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;sudo&lt;/span&gt; &lt;span class="k"&gt;unlink&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nv"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nv"&gt;resolv&lt;/span&gt;.&lt;span class="nv"&gt;conf&lt;/span&gt;
&lt;span class="nv"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;nameserver 192.168.1.1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nv"&gt;sudo&lt;/span&gt; &lt;span class="nv"&gt;tee&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nv"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nv"&gt;resolv&lt;/span&gt;.&lt;span class="nv"&gt;conf&lt;/span&gt;
&lt;span class="nv"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;nameserver 192.168.1.2&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nv"&gt;sudo&lt;/span&gt; &lt;span class="nv"&gt;tee&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nv"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nv"&gt;resolv&lt;/span&gt;.&lt;span class="nv"&gt;conf&lt;/span&gt;
&lt;span class="nv"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;search ipa.example.com example.com&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nv"&gt;sudo&lt;/span&gt; &lt;span class="nv"&gt;tee&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nv"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nv"&gt;resolv&lt;/span&gt;.&lt;span class="nv"&gt;conf&lt;/span&gt;
&lt;span class="nv"&gt;sudo&lt;/span&gt; &lt;span class="nv"&gt;chattr&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nv"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nv"&gt;resolv&lt;/span&gt;.&lt;span class="nv"&gt;conf&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And then for good measure I disabled and masked systemd-resolved.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo systemctl disable --now systemd-resolved.service
sudo systemctl mask systemd-resolved.service
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Don't let Systemd ruin &lt;em&gt;your&lt;/em&gt; networking!&lt;/p&gt;</description><category>fedora</category><category>network</category><category>ping</category><category>ssh</category><guid>https://bgstack15.ddns.net/blog/posts/2021/05/07/fedora-33-nslookup-works-but-ping-does-not/</guid><pubDate>Fri, 07 May 2021 13:12:26 GMT</pubDate></item><item><title>Some thoughts on connman and wicd</title><link>https://bgstack15.ddns.net/blog/posts/2020/10/16/some-thoughts-on-connman-and-wicd/</link><dc:creator>bgstack15</dc:creator><description>&lt;p&gt;I discussed these thoughts in the Devuan forum[1] but wanted to publish them
on my own site as well. I was a huge fan of
&lt;a href="http://wicd.sourceforge.net/"&gt;wicd&lt;/a&gt;, origin site notwithstanding. It met my
needs and was easily configurable and understandable. But because it's python2
only (with some experimental &lt;a href="https://bugs.launchpad.net/wicd/+bug/1848020"&gt;python3
work&lt;/a&gt;), it was finally dropped
from Devuan Ceres. So I had to find an alternative. There's always the
unpopular Network Manager. So I checked out &lt;a href="https://01.org/connman"&gt;connman&lt;/a&gt;,
which seems to do everything I've asked it to do. It even includes its own gui
and trayicon implementation (connman-gtk), but Devuan also provides a separate
connman-ui trayicon utility but it duplicates the tray icon feature. So far,
to integrate connman into my workflows, I have two major notes.&lt;/p&gt;
&lt;h6&gt;Disable dns caching&lt;/h6&gt;
&lt;p&gt;I want /etc/resolv.conf to be the useful file it's always been, and not just
point to 127.0.1.1 or some ridiculousness. So run the daemon with &lt;strong&gt;-r&lt;/strong&gt; , by
setting file &lt;strong&gt;/etc/default/connman&lt;/strong&gt;.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;DAEMON_OPTS="-r"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It's really nice that you can configure this utility in a traditional manner!
And it was clearly documented in the man page.&lt;/p&gt;
&lt;h6&gt;Add xdg autostart etnry&lt;/h6&gt;
&lt;p&gt;I add file &lt;strong&gt;/etc/xdg/autostart/connman-gtk.desktop&lt;/strong&gt; on all my systems, which
is in the &lt;a href="https://wiki.archlinux.org/index.php/XDG_Autostart"&gt;xdg autostart&lt;/a&gt;
directory. And xdg autostart, is, a
&lt;a href="https://specifications.freedesktop.org/"&gt;fd.o&lt;/a&gt; specification that describes a
common way desktop environments can act in similar ways.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;[Desktop Entry]&lt;/span&gt;
&lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;Application&lt;/span&gt;
&lt;span class="na"&gt;Exec&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;connman-gtk&lt;/span&gt;
&lt;span class="na"&gt;Name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;Connman Settings&lt;/span&gt;
&lt;span class="na"&gt;Categories&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;GTK;GNOME;Settings;X-GNOME-Settings-Panel;X-Unity-Settings-Panel;HardwareSettings&lt;/span&gt;
&lt;span class="na"&gt;Keywords&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;connman;network;settings;wired;wifi;wi-fi;bluetooth;vpn;tethering&lt;/span&gt;
&lt;span class="na"&gt;X-GNOME-Settings-Panel&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;connman-gtk&lt;/span&gt;
&lt;span class="na"&gt;X-Unity-Settings-Panel&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;connman-gtk&lt;/span&gt;
&lt;span class="na"&gt;Icon&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;preferences-system-network&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Of course, this file has no bearing on non-xdg-compliant window managers, so I
also generally add to my user Fluxbox settings (file &lt;strong&gt;~/.fluxbox/startup&lt;/strong&gt; )
the following line.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;/usr/bin/connman-gtk &amp;amp;
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Final thoughts&lt;/h3&gt;
&lt;p&gt;So far I haven't discovered how connman-gtk stores its settings that appear to
be per-user, for the "prefer to load straight to tray icon." Oh dear, now that
I think about it, it's probably a gsettings or dconf or similar. Say it ain't
so!&lt;/p&gt;
&lt;h3&gt;References&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://dev1galaxy.org/viewtopic.php?pid=24641#p24641"&gt;https://dev1galaxy.org/viewtopic.php?pid=24641#p24641&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</description><category>connman</category><category>devuan</category><category>network</category><category>replacement</category><category>wicd</category><category>wireless</category><guid>https://bgstack15.ddns.net/blog/posts/2020/10/16/some-thoughts-on-connman-and-wicd/</guid><pubDate>Fri, 16 Oct 2020 13:14:12 GMT</pubDate></item><item><title>Setting up a transparent proxy for internal network</title><link>https://bgstack15.ddns.net/blog/posts/2020/10/04/setting-up-a-transparent-proxy-for-internal-network/</link><dc:creator>bgstack15</dc:creator><description>&lt;h3&gt;Overview&lt;/h3&gt;
&lt;p&gt;This document explains how to set up a web proxy on the internal network so
that it can act as a configured proxy as well as transparent network proxy,
including both http and https traffic. Exceptions for sites (destinations) as
well as clients can be configured.&lt;/p&gt;
&lt;h3&gt;Architecture&lt;/h3&gt;
&lt;p&gt;A &lt;a href="https://dd-wrt.com/"&gt;dd-wrt&lt;/a&gt; router is the heart of the example network, at
192.168.1.2. Proxy server proxy.ipa.example.com at 192.168.1.82 provides both
transparent proxy and configured proxy behavior.&lt;/p&gt;
&lt;h4&gt;Configuring router for transparent proxy&lt;/h4&gt;
&lt;p&gt;The router is set up with dd-wrt firmware: DD-WRT v3.0-r43055 big (05/05/20)
and contains a firewall start script (&lt;code&gt;nvram get rc_firewall&lt;/code&gt;) which forces
all World Wide Web traffic (tcp ports 80 and 443) to a transparent proxy.&lt;/p&gt;
&lt;table class="codehilitetable"&gt;&lt;tr&gt;&lt;td class="linenos"&gt;&lt;div class="linenodiv"&gt;&lt;pre&gt;&lt;span class="normal"&gt; 1&lt;/span&gt;
&lt;span class="normal"&gt; 2&lt;/span&gt;
&lt;span class="normal"&gt; 3&lt;/span&gt;
&lt;span class="normal"&gt; 4&lt;/span&gt;
&lt;span class="normal"&gt; 5&lt;/span&gt;
&lt;span class="normal"&gt; 6&lt;/span&gt;
&lt;span class="normal"&gt; 7&lt;/span&gt;
&lt;span class="normal"&gt; 8&lt;/span&gt;
&lt;span class="normal"&gt; 9&lt;/span&gt;
&lt;span class="normal"&gt;10&lt;/span&gt;
&lt;span class="normal"&gt;11&lt;/span&gt;
&lt;span class="normal"&gt;12&lt;/span&gt;
&lt;span class="normal"&gt;13&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="ch"&gt;#!/bin/sh&lt;/span&gt;
&lt;span class="nv"&gt;WEB_SERVER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;192&lt;/span&gt;.168.1.14
&lt;span class="nv"&gt;PROXY_IP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;192&lt;/span&gt;.168.1.82
&lt;span class="nv"&gt;OBI_IP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;192&lt;/span&gt;.168.1.27
&lt;span class="nv"&gt;CHROMECAST_IP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;192&lt;/span&gt;.168.1.29
iptables -t mangle -I PREROUTING &lt;span class="m"&gt;2&lt;/span&gt; -p tcp -m multiport --dports &lt;span class="m"&gt;80&lt;/span&gt;,443 -s &lt;span class="nv"&gt;$OBI_IP&lt;/span&gt; -j ACCEPT
iptables -t mangle -I PREROUTING &lt;span class="m"&gt;3&lt;/span&gt; -p tcp -m multiport --dports &lt;span class="m"&gt;80&lt;/span&gt;,443 -s &lt;span class="nv"&gt;$CHROMECAST_IP&lt;/span&gt; -j ACCEPT
iptables -t mangle -I PREROUTING &lt;span class="m"&gt;5&lt;/span&gt; -p tcp -m multiport --dports &lt;span class="m"&gt;80&lt;/span&gt;,443 -s &lt;span class="nv"&gt;$PROXY_IP&lt;/span&gt; -j ACCEPT
iptables -t mangle -I PREROUTING &lt;span class="m"&gt;6&lt;/span&gt; -p tcp -m multiport --dports &lt;span class="m"&gt;80&lt;/span&gt;,443 ! -s &lt;span class="nv"&gt;$PROXY_IP&lt;/span&gt; -j MARK --or &lt;span class="m"&gt;3&lt;/span&gt;
iptables -t mangle -I PREROUTING &lt;span class="m"&gt;7&lt;/span&gt; -p tcp -m multiport --dports &lt;span class="m"&gt;80&lt;/span&gt;,443 -j CONNMARK --save-mark
ip route add &lt;span class="nv"&gt;$WEB_SERVER&lt;/span&gt; via &lt;span class="nv"&gt;$WEB_SERVER&lt;/span&gt; dev br0 table &lt;span class="m"&gt;2&lt;/span&gt;
ip route add default via &lt;span class="nv"&gt;$PROXY_IP&lt;/span&gt; dev br0 table &lt;span class="m"&gt;2&lt;/span&gt;
ip rule add fwmark &lt;span class="m"&gt;3&lt;/span&gt; table &lt;span class="m"&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;The MARK rule performs a logical OR to set just a few binary flags, so it does
not merely "set" all the flags. See &lt;a href="https://wiki.dd-wrt.com/wiki/index.php/Squid_Transparent_Proxy"&gt;Weblink 7&lt;/a&gt;. The web server steps are
there to ensure that incoming web traffic get to the web server. Observe that
&lt;code&gt;CHROMECAST_IP&lt;/code&gt; is granted ACCEPT in the firewall. The Chromecast device is
given a reserved IP address in DHCP which is described later. An attempt was
made to perform logging on the router level, and while this provides IP
addresses, it was not sufficient for the needs of this project. See &lt;a href="https://nlug.ml1.co.uk/2014/01/the-missing-firewall-logs-of-dd-wrt/4528"&gt;weblink
12&lt;/a&gt;.&lt;/p&gt;
&lt;h4&gt;Configuring the proxy server&lt;/h4&gt;
&lt;p&gt;First, configure the firewall. Set contents of file
&lt;code&gt;/etc/firewalld/direct.xml&lt;/code&gt;.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;direct&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;rule&lt;/span&gt; &lt;span class="na"&gt;ipv=&lt;/span&gt;&lt;span class="s"&gt;"ipv4"&lt;/span&gt; &lt;span class="na"&gt;table=&lt;/span&gt;&lt;span class="s"&gt;"nat"&lt;/span&gt; &lt;span class="na"&gt;chain=&lt;/span&gt;&lt;span class="s"&gt;"PREROUTING"&lt;/span&gt; &lt;span class="na"&gt;priority=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;-i eth0 -p tcp --dport 80 -j REDIRECT --to-ports 3130&lt;span class="nt"&gt;&amp;lt;/rule&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;rule&lt;/span&gt; &lt;span class="na"&gt;ipv=&lt;/span&gt;&lt;span class="s"&gt;"ipv4"&lt;/span&gt; &lt;span class="na"&gt;table=&lt;/span&gt;&lt;span class="s"&gt;"nat"&lt;/span&gt; &lt;span class="na"&gt;chain=&lt;/span&gt;&lt;span class="s"&gt;"PREROUTING"&lt;/span&gt; &lt;span class="na"&gt;priority=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;-i eth0 -p tcp --dport 443 -j REDIRECT --to-ports 3129&lt;span class="nt"&gt;&amp;lt;/rule&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/direct&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I was unable to find any other mechanism within firewalld that works for
getting the traffic transparently to squid (i.e., that keeps the client IP
address). See &lt;a href="https://wiki.dd-wrt.com/wiki/index.php/Squid_Transparent_Proxy"&gt;weblink 7&lt;/a&gt;. Also allow a few services and
additional ports.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;firewall&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;cmd&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;permanent&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;https&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;squid&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3129&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tcp&lt;/span&gt;
&lt;span class="n"&gt;firewall&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;cmd&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;permanent&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3130&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tcp&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3129&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tcp&lt;/span&gt;
&lt;span class="n"&gt;firewall&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;cmd&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;reload&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h5&gt;Configuring squid&lt;/h5&gt;
&lt;p&gt;Configure squid itself. Fill file &lt;code&gt;/etc/squid/squid.conf&lt;/code&gt; with contents.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# Research for a log filter includes:&lt;/span&gt;
&lt;span class="c1"&gt;# tail -f /var/log/squid/access.log | grep -iE '200 [0-9]+ GET https?:\/\/[^ ]+'&lt;/span&gt;

&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;localnet&lt;/span&gt; &lt;span class="n"&gt;src&lt;/span&gt; &lt;span class="mf"&gt;10.0&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="c1"&gt;# RFC1918 possible internal network&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;localnet&lt;/span&gt; &lt;span class="n"&gt;src&lt;/span&gt; &lt;span class="mf"&gt;172.16&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;  &lt;span class="c1"&gt;# RFC1918 possible internal network&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;localnet&lt;/span&gt; &lt;span class="n"&gt;src&lt;/span&gt; &lt;span class="mf"&gt;192.168&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt; &lt;span class="c1"&gt;# RFC1918 possible internal network&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;localnet&lt;/span&gt; &lt;span class="n"&gt;src&lt;/span&gt; &lt;span class="n"&gt;fc00&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;       &lt;span class="c1"&gt;# RFC 4193 local private network range&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;localnet&lt;/span&gt; &lt;span class="n"&gt;src&lt;/span&gt; &lt;span class="n"&gt;fe80&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;      &lt;span class="c1"&gt;# RFC 4291 link-local (directly plugged) machines&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;SSL_ports&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="mi"&gt;443&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;Safe_ports&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;      &lt;span class="c1"&gt;# http&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;Safe_ports&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="mi"&gt;21&lt;/span&gt;      &lt;span class="c1"&gt;# ftp&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;Safe_ports&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="mi"&gt;443&lt;/span&gt;     &lt;span class="c1"&gt;# https&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;Safe_ports&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="mi"&gt;70&lt;/span&gt;      &lt;span class="c1"&gt;# gopher&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;Safe_ports&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="mi"&gt;210&lt;/span&gt;     &lt;span class="c1"&gt;# wais&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;Safe_ports&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="mi"&gt;1025&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;65535&lt;/span&gt;  &lt;span class="c1"&gt;# unregistered ports&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;Safe_ports&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="mi"&gt;280&lt;/span&gt;     &lt;span class="c1"&gt;# http-mgmt&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;Safe_ports&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="mi"&gt;488&lt;/span&gt;     &lt;span class="c1"&gt;# gss-http&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;Safe_ports&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="mi"&gt;591&lt;/span&gt;     &lt;span class="c1"&gt;# filemaker&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;Safe_ports&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="mi"&gt;777&lt;/span&gt;     &lt;span class="c1"&gt;# multiling http&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;CONNECT&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="n"&gt;CONNECT&lt;/span&gt;
&lt;span class="n"&gt;http_access&lt;/span&gt; &lt;span class="n"&gt;deny&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;Safe_ports&lt;/span&gt;
&lt;span class="n"&gt;http_access&lt;/span&gt; &lt;span class="n"&gt;deny&lt;/span&gt; &lt;span class="n"&gt;CONNECT&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;SSL_ports&lt;/span&gt;
&lt;span class="n"&gt;http_access&lt;/span&gt; &lt;span class="n"&gt;allow&lt;/span&gt; &lt;span class="n"&gt;localhost&lt;/span&gt; &lt;span class="n"&gt;manager&lt;/span&gt;
&lt;span class="n"&gt;http_access&lt;/span&gt; &lt;span class="n"&gt;deny&lt;/span&gt; &lt;span class="n"&gt;manager&lt;/span&gt;
&lt;span class="n"&gt;http_access&lt;/span&gt; &lt;span class="n"&gt;allow&lt;/span&gt; &lt;span class="n"&gt;localnet&lt;/span&gt;
&lt;span class="n"&gt;http_access&lt;/span&gt; &lt;span class="n"&gt;allow&lt;/span&gt; &lt;span class="n"&gt;localhost&lt;/span&gt;
&lt;span class="n"&gt;http_access&lt;/span&gt; &lt;span class="n"&gt;deny&lt;/span&gt; &lt;span class="n"&gt;all&lt;/span&gt;
&lt;span class="n"&gt;http_port&lt;/span&gt; &lt;span class="mi"&gt;3128&lt;/span&gt; &lt;span class="n"&gt;ssl&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;bump&lt;/span&gt; \
  &lt;span class="n"&gt;cert&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;pki&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tls&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;certs&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;proxy&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ipa&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pem&lt;/span&gt; \
  &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;pki&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tls&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;private&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;proxy&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ipa&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;nopw&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt; \
  &lt;span class="n"&gt;cafile&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;pki&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tls&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;certs&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ca&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;ipa&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;crt&lt;/span&gt; \
  &lt;span class="n"&gt;generate&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;certificates&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;dynamic_cert_mem_cache_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="n"&gt;MB&lt;/span&gt;
&lt;span class="n"&gt;https_port&lt;/span&gt; &lt;span class="mi"&gt;3129&lt;/span&gt; &lt;span class="n"&gt;intercept&lt;/span&gt; &lt;span class="n"&gt;ssl&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;bump&lt;/span&gt; \
  &lt;span class="n"&gt;cert&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;pki&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tls&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;certs&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;proxy&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ipa&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pem&lt;/span&gt; \
  &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;pki&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tls&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;private&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;proxy&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ipa&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;nopw&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt; \
  &lt;span class="n"&gt;cafile&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;pki&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tls&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;certs&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ca&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;ipa&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;crt&lt;/span&gt; \
  &lt;span class="n"&gt;generate&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;certificates&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;dynamic_cert_mem_cache_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="n"&gt;MB&lt;/span&gt;
&lt;span class="n"&gt;http_port&lt;/span&gt; &lt;span class="mi"&gt;3130&lt;/span&gt; &lt;span class="n"&gt;intercept&lt;/span&gt; &lt;span class="n"&gt;ssl&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;bump&lt;/span&gt; \
  &lt;span class="n"&gt;cert&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;pki&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tls&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;certs&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;proxy&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ipa&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pem&lt;/span&gt; \
  &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;pki&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tls&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;private&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;proxy&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ipa&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;nopw&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt; \
  &lt;span class="n"&gt;generate&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;certificates&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;dynamic_cert_mem_cache_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="n"&gt;MB&lt;/span&gt;
&lt;span class="n"&gt;sslcrtd_program&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;usr&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;lib64&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;squid&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ssl_crtd&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;lib&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ssl_db&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;M&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="n"&gt;MB&lt;/span&gt;
&lt;span class="n"&gt;sslproxy_cert_error&lt;/span&gt; &lt;span class="n"&gt;allow&lt;/span&gt; &lt;span class="n"&gt;all&lt;/span&gt;
&lt;span class="n"&gt;sslproxy_flags&lt;/span&gt; &lt;span class="n"&gt;DONT_VERIFY_PEER&lt;/span&gt;

&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;step1&lt;/span&gt; &lt;span class="n"&gt;at_step&lt;/span&gt; &lt;span class="n"&gt;SslBump1&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;SAFE_sites&lt;/span&gt; &lt;span class="n"&gt;ssl&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;server_name&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;telephony&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;goog&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;discord&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gg&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;DIRECT_sites_name&lt;/span&gt; &lt;span class="n"&gt;dstdomain&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;youtube&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;
&lt;span class="c1"&gt;# DIRECT_sites_ip is primarily for youtube; not from nslookup; only from examining squid logs&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;DIRECT_sites_ip&lt;/span&gt; &lt;span class="n"&gt;dst&lt;/span&gt; &lt;span class="mf"&gt;172.217&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;164.74&lt;/span&gt; &lt;span class="mf"&gt;64.233&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;177.106&lt;/span&gt; &lt;span class="mf"&gt;173.194&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;219.95&lt;/span&gt; &lt;span class="mf"&gt;64.233&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;177.99&lt;/span&gt; &lt;span class="mf"&gt;31.13&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;65.1&lt;/span&gt; &lt;span class="mf"&gt;31.13&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;65.36&lt;/span&gt; &lt;span class="mf"&gt;74.125&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;138.95&lt;/span&gt; &lt;span class="mf"&gt;64.233&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;185.139&lt;/span&gt; &lt;span class="mf"&gt;64.233&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;185.91&lt;/span&gt; &lt;span class="mf"&gt;172.217&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;164.78&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;DIRECT_sites&lt;/span&gt; &lt;span class="n"&gt;any&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;DIRECT_sites_name&lt;/span&gt; &lt;span class="n"&gt;DIRECT_sites_ip&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;DIRECT_site_clients&lt;/span&gt; &lt;span class="n"&gt;srcdomain&lt;/span&gt; &lt;span class="n"&gt;tab1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ipa&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;
&lt;span class="n"&gt;acl&lt;/span&gt; &lt;span class="n"&gt;WORK_clients&lt;/span&gt; &lt;span class="n"&gt;srcdomain&lt;/span&gt; &lt;span class="n"&gt;device1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ipa&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;

&lt;span class="n"&gt;always_direct&lt;/span&gt; &lt;span class="n"&gt;allow&lt;/span&gt; &lt;span class="n"&gt;DIRECT_sites&lt;/span&gt; &lt;span class="n"&gt;DIRECT_site_clients&lt;/span&gt;
&lt;span class="n"&gt;ssl_bump&lt;/span&gt; &lt;span class="n"&gt;splice&lt;/span&gt; &lt;span class="n"&gt;DIRECT_sites&lt;/span&gt; &lt;span class="n"&gt;DIRECT_site_clients&lt;/span&gt;
&lt;span class="n"&gt;ssl_bump&lt;/span&gt; &lt;span class="n"&gt;splice&lt;/span&gt; &lt;span class="n"&gt;SAFE_sites&lt;/span&gt;
&lt;span class="n"&gt;ssl_bump&lt;/span&gt; &lt;span class="n"&gt;splice&lt;/span&gt; &lt;span class="n"&gt;WORK_clients&lt;/span&gt;
&lt;span class="n"&gt;ssl_bump&lt;/span&gt; &lt;span class="n"&gt;peek&lt;/span&gt; &lt;span class="n"&gt;step1&lt;/span&gt;
&lt;span class="n"&gt;ssl_bump&lt;/span&gt; &lt;span class="n"&gt;bump&lt;/span&gt; &lt;span class="n"&gt;all&lt;/span&gt; &lt;span class="c1"&gt;# needed for youtube somehow&lt;/span&gt;
&lt;span class="n"&gt;coredump_dir&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;spool&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;squid&lt;/span&gt;
&lt;span class="n"&gt;refresh_pattern&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="n"&gt;ftp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;       &lt;span class="mi"&gt;1440&lt;/span&gt;    &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;10080&lt;/span&gt;
&lt;span class="n"&gt;refresh_pattern&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="n"&gt;gopher&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;    &lt;span class="mi"&gt;1440&lt;/span&gt;    &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;  &lt;span class="mi"&gt;1440&lt;/span&gt;
&lt;span class="n"&gt;refresh_pattern&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;cgi&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;bin&lt;/span&gt;&lt;span class="o"&gt;/|&lt;/span&gt;\&lt;span class="err"&gt;?&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;  &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="n"&gt;refresh_pattern&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;       &lt;span class="mi"&gt;0&lt;/span&gt;   &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;4320&lt;/span&gt;
&lt;span class="n"&gt;strip_query_terms&lt;/span&gt; &lt;span class="n"&gt;off&lt;/span&gt;    &lt;span class="c1"&gt;#This will allow checking which youtube URLs were visited by user&lt;/span&gt;

&lt;span class="n"&gt;visible_hostname&lt;/span&gt; &lt;span class="n"&gt;proxy&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ipa&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;
&lt;span class="n"&gt;logformat&lt;/span&gt; &lt;span class="n"&gt;squid&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="n"&gt;ts&lt;/span&gt;&lt;span class="o"&gt;.%&lt;/span&gt;&lt;span class="mi"&gt;03&lt;/span&gt;&lt;span class="n"&gt;tu&lt;/span&gt; &lt;span class="o"&gt;%&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;A&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="mi"&gt;03&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;Hs&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="n"&gt;rm&lt;/span&gt; &lt;span class="o"&gt;%&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;ru&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;un&lt;/span&gt; &lt;span class="o"&gt;%&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="n"&gt;mt&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The order of these entries matters. Additionally, the Chromecast materials may
be out of date, but Youtube it still important. An important consideration is
to keep the work computer's vpn uninterrupted. Several comments in this file
demonstrate which lines are important to that end. The certificate used here
is described in a few steps. The cafile used is the root CA cert for the
entire FreeIPA infrastructure in the example network. Without this
configuration, it is possible that clients who trust the root CA would still
not trust the web traffic because squid would have an incomplete cert chain.&lt;/p&gt;
&lt;h5&gt;Initializing squid&lt;/h5&gt;
&lt;p&gt;The dynamic ssl certificate database needs to be initialized outside of squid
itself. This only needs to be run once.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;usr&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;lib64&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;squid&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ssl_crtd&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;lib&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ssl_db&lt;/span&gt;
&lt;span class="n"&gt;chown&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="n"&gt;squid&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;lib&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ssl_db&lt;/span&gt;
&lt;span class="n"&gt;restorecon&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Rv&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;lib&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ssl_db&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Without this step, squid could fail to start, or it could fail with an error
about crashing too rapidly after so long. See &lt;a href="https://serverfault.com/questions/624879/ssl-crtd-helpers-are-crashing-too-rapidly-in-squid"&gt;weblink
3&lt;/a&gt;.&lt;/p&gt;
&lt;h5&gt;Getting a valid ssl certificate for squid&lt;/h5&gt;
&lt;p&gt;See post &lt;a href="https://bgstack15.ddns.net/blog/posts/2020/09/30/getting-a-valid-subca-certificate-for-squid-from-freeipa/"&gt;Getting a valid subCA certificate for squid from
FreeIPA&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Operations&lt;/h3&gt;
&lt;p&gt;It is probable that in the future I will want to make changes. A few possible
changes are described below.&lt;/p&gt;
&lt;h4&gt;Disabling transparent proxy at router&lt;/h4&gt;
&lt;p&gt;If the proxy server is offline, then all outbound www traffic will fail. The
best way to disable the transparent proxy setting entirely is to disable the
ip rule on the router. Ssh in to the router or visit the web portal. Run
command:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;ip rule del fwmark 0x3
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;To re-enable, run the one ip rule command from the &lt;strong&gt;rc_firewall&lt;/strong&gt; startup
script.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;ip rule add fwmark 3 table 2
&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;Adding a new exclusion for a client on router&lt;/h4&gt;
&lt;p&gt;To allow a single client unmonitored access to the www, you can add a new rule
to the router. This can be achieved by running a single command, or by
updating the &lt;strong&gt;rc_firewall&lt;/strong&gt; script.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;iptables -t mangle -I PREROUTING 1 -p tcp -m multiport --dports 80,443 -s 192.168.1.300 -j ACCEPT
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Where the IP address here is the target client. To remove a specific rule, run&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;iptables -t mangle -D PREROUTING 1
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;But ensure that the rule it will remove is not the main one that allows
outbound www traffic from the proxy server.&lt;/p&gt;
&lt;h4&gt;Adding new sites and clients in squid&lt;/h4&gt;
&lt;p&gt;To exclude the ssl decryption of a site in squid, add it to the &lt;strong&gt;SAFE_sites&lt;/strong&gt;
entry in squid.conf and restart squid. You can confirm the syntax is valid
without affecting the running daemon by running the following command.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;squid -k parse ; echo $?
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;To exclude a combination of site and client, you can add a site or client to
their respesctive lists uner attributes&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;DIRECT_sites_name&lt;/li&gt;
&lt;li&gt;DIRECT_sites_ip&lt;/li&gt;
&lt;li&gt;DIRECT_site_clients&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Using the proxy by choice&lt;/h4&gt;
&lt;p&gt;If for some reason you want to manually configure a proxy, you can set the
exact following values.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="n"&gt;http_proxy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;proxy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;3128&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="n"&gt;https_proxy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;proxy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;3128&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It is worth noting that squid has to act differently when being used as a
"transparent proxy" so those ports are 3129 (https) and 3130 (http). But port
3128 can be used explicitly for both protocols. Manually choosing to use the
proxy can make troubleshooting easier. For example, mobile devices'
applications rarely use the host proxy settings, but it can be easier to
whitelist requests.&lt;/p&gt;
&lt;h4&gt;Assign a reserved IP address in dhcp&lt;/h4&gt;
&lt;p&gt;The internal network uses ISC dhcpd for assigning IP addresses to clients. To
add a host to have a specific reservation, you have to edit the dhcpd.conf
through the local mechanism dhcpd-control on host &lt;strong&gt;dns1&lt;/strong&gt;.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo dhcpd-control --edit
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will open a cached copy of the &lt;code&gt;dhcpd.conf.combined&lt;/code&gt; which will get
replicated to host dns2 if any changes are made. The changes must be made
between headings:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;ul&gt;
&lt;li&gt;BEGIN POOLS FOR SYNC&lt;/li&gt;
&lt;li&gt;END POOLS FOR SYNC&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Add an entry using the MAC address of the client and the desired reserved IP
address.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;host&lt;/span&gt; &lt;span class="nt"&gt;Obi200&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="err"&gt;hardware&lt;/span&gt; &lt;span class="err"&gt;ethernet&lt;/span&gt; &lt;span class="err"&gt;9&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;fe&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;f3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="err"&gt;fixed-address&lt;/span&gt; &lt;span class="err"&gt;192.168.1.27&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Improvements&lt;/h3&gt;
&lt;p&gt;Need to discover how to get android to think it has Internet access.&lt;/p&gt;
&lt;h2&gt;References&lt;/h2&gt;
&lt;h3&gt;Man pages&lt;/h3&gt;
&lt;p&gt;/usr/share/doc/squid-3.5.20/squid.conf.documented&lt;/p&gt;
&lt;h3&gt;Weblinks&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://silverskysoft.com/open-stack-xwrpr/2015/09/creating-a-subordinate-certificate-authority-in-freeipa/"&gt;http://silverskysoft.com/open-stack-xwrpr/2015/09/creating-a-subordinate-certificate-authority-in-freeipa/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;/li&gt;&lt;li&gt;&lt;a href="https://serverfault.com/questions/624879/ssl-crtd-helpers-are-crashing-too-rapidly-in-squid"&gt;https://serverfault.com/questions/624879/ssl-crtd-helpers-are-crashing-too-rapidly-in-squid&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://netfilter.org/documentation/HOWTO//packet-filtering-HOWTO.txt"&gt;https://netfilter.org/documentation/HOWTO//packet-filtering-HOWTO.txt&lt;/a&gt; General guide for iptables&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.agix.com.au/minimal-transparent-squid-proxy-with-ssl-interception-bumping-on-centos-7/"&gt;https://www.agix.com.au/minimal-transparent-squid-proxy-with-ssl-interception-bumping-on-centos-7/&lt;/a&gt; useful examples about &lt;code&gt;ssl_bump&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.squid-cache.org/Features/SslPeekAndSplice"&gt;https://wiki.squid-cache.org/Features/SslPeekAndSplice&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.dd-wrt.com/wiki/index.php/Squid_Transparent_Proxy"&gt;https://wiki.dd-wrt.com/wiki/index.php/Squid_Transparent_Proxy&lt;/a&gt; "Alternative Solution" to Proxy Server on the LAN Subnet&lt;/li&gt;
&lt;li&gt;&lt;a href="https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1217511#1217511"&gt;https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1217511#1217511&lt;/a&gt; I opened a thread on dd-wrt forum for help, but it turned out to be squid-side firewall problems.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.mitmproxy.org/stable/howto-transparent/"&gt;https://docs.mitmproxy.org/stable/howto-transparent/&lt;/a&gt; minor examples of ip rules&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.silverhawk.net/2016/07/centos-7-squid-and-firewall.html"&gt;http://www.silverhawk.net/2016/07/centos-7-squid-and-firewall.html&lt;/a&gt; Ultimately unused examples for firewalld and squid acls&lt;/li&gt;
&lt;li&gt;&lt;a href="https://elatov.github.io/2019/01/using-squid-to-proxy-ssl-sites/"&gt;https://elatov.github.io/2019/01/using-squid-to-proxy-ssl-sites/&lt;/a&gt; Great initial reference for establishing squid &lt;code&gt;ssl_bump&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nlug.ml1.co.uk/2014/01/the-missing-firewall-logs-of-dd-wrt/4528"&gt;https://nlug.ml1.co.uk/2014/01/the-missing-firewall-logs-of-dd-wrt/4528&lt;/a&gt; A modest attempt to log traffic on the router, without regard to www hosts and requests.&lt;/li&gt;
&lt;/ol&gt;</description><category>network</category><category>proxy</category><category>squid</category><guid>https://bgstack15.ddns.net/blog/posts/2020/10/04/setting-up-a-transparent-proxy-for-internal-network/</guid><pubDate>Sun, 04 Oct 2020 12:49:38 GMT</pubDate></item><item><title>Windows: Map network drives from csv</title><link>https://bgstack15.ddns.net/blog/posts/2019/10/15/windows-map-network-drives-from-csv/</link><dc:creator>bgstack15</dc:creator><description>&lt;p&gt;Even back in my olden days of using a non-free operating system, I was
automating my tasks. The non-persistent sessions at the computer science lab
required that I script my tasks. This is what I came up with for mapping
network drives. You can set a csv file with the following contents:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;driveletter,sharename,username,password,vollabel
SERVER,192.168.1.2
w,vol1\ben,,,W_svol1_ben
x,vol1,,,X_svol1
y,vol2,,,Y_svol2
z,vol5,,,Z_svol5
SERVER,hulk
s,hulk_ben,,,S_hulk_ben
t,smash,,,T_smash
SERVER,dax
u,dax_ben,,,U_dax_ben
v,science,,,V_science
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So it's not a real csv file; it's got headers delineated by "SERVER" and a
server name. The script will operate on the following lines, until the next
"SERVER" line. It will mount the drive letter, from the following CIFS share,
using a username and password or prompting if blank, and a pretty name. It
will only mount those entries, if the SERVER actually is reachable. So it
fails safely if you are on a different network than the requested server at
the time. The script is available on my
&lt;a href="https://gitlab.com/bgstack15/former-gists/blob/master/map.bat/map.bat"&gt;gitlab&lt;/a&gt;. And that &lt;a href="https://gitlab.com/bgstack15/former-gists/blob/master/map.bat/map.csv"&gt;example
csv&lt;/a&gt; is
also there. I eventually scrapped this script when I deployed an Active
Directory domain and I used group policy to define a number of mounts to
define.&lt;/p&gt;</description><category>csv</category><category>map</category><category>network</category><category>windows</category><guid>https://bgstack15.ddns.net/blog/posts/2019/10/15/windows-map-network-drives-from-csv/</guid><pubDate>Tue, 15 Oct 2019 13:22:09 GMT</pubDate></item><item><title>ansible use jump box</title><link>https://bgstack15.ddns.net/blog/posts/2019/08/14/ansible-use-jump-box/</link><dc:creator>bgstack15</dc:creator><description>&lt;p&gt;If you need to connect through an intermediate jump box, or bastion server,
here's how you configure the inventory file:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;[other-lan]&lt;/span&gt;
&lt;span class="na"&gt;c7-prod-app-01 &lt;/span&gt;
&lt;span class="k"&gt;[other-lan:vars]&lt;/span&gt;
&lt;span class="na"&gt;ansible_ssh_common_args&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'-o ProxyCommand="ssh -W %h:%p -q ansible_user@jumpbox.otherlan.example.com"'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If the jump box can resolve the target name as is, you don't need to specify
the IP address. However, you can also force a specific IP address.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;c7-prod-app-01 ansible_host=10.300.15.3
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;References&lt;/h2&gt;
&lt;h3&gt;Weblinks&lt;/h3&gt;
&lt;p&gt;Shamelessly ripped from &lt;a href="https://stackoverflow.com/questions/31408017/ansible-with-a-bastion-host-jump-box/36850087#36850087"&gt;Ansible with a bastion host / jump
box?&lt;/a&gt; [stackoverflow.com]&lt;/p&gt;</description><category>ansible</category><category>network</category><guid>https://bgstack15.ddns.net/blog/posts/2019/08/14/ansible-use-jump-box/</guid><pubDate>Wed, 14 Aug 2019 13:05:16 GMT</pubDate></item></channel></rss>