From charlesreid1

 
(198 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Setup=
==Step by Step Articles==


==Aptitude update==
All the setup involved for bespin, a Ubuntu 18.04 desktop server.


During installation, we allow setup to join the wifi network. On first boot, the network manager will be running and will be connected to the same wifi network. We will disable network manager eventually, but first get some software.
* [[Ubuntu/Bespin/Initial Setup]] - initial setup of the Ubuntu machine


<pre>
* [[Ubuntu/Bespin/Gnome Setup]] - setting up gnome on the Ubuntu machine
sudo apt-get update
sudo apt-get -y install vim gnome-tweak-tool net-tools
</pre>


Set caps lock as a control key.
* [[Ubuntu/Bespin/Ansible]] - setting up and running an Ansible role for the machine


==Configure WPA Supplicant==
* [[Ubuntu/Bespin/PIA]] - set up a [[PIA]] VPN tunnel using [[OpenVPN]]


We want to configure wifi manually, and disable the network manager. This requires some preparation to manually join a wifi network with wpa supplicant.
* [[Ubuntu/Bespin/DNS]] - removing the built-in DNS server on Ubuntu and replacing it with dnsmasq


First set your wpa supplicant to join a wifi network.
* [[Ubuntu/Bespin/PiHole]] - run an instance of PiHole, the DNS sinkhole, in a Docker container; install it between dnsmasq and the VPN tunnel, so all DNS queries will pass through the PiHole


<code>/etc/wpa_supplicant/wpa_supplicant.conf</code>
* [[Ubuntu/Bespin/Iptables]] - Update the iptables rules to allow better protection of the server and be less permissive


<pre>
* [[Ubuntu/Bespin/TIL]] - the summary of "today I learned" things that I learned while setting up Bespin
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1


network={
==Related Articles==
    ssid="yournetworkhere"
    proto=RSN
    key_mgmt=WPA-PSK
    pairwise=CCMP TKIP
    group=CCMP TKIP
    psk="yourpskhere"
}
</pre>


Next add the 2 usb wifi devices to network interfaces file. The following etc network interfaces file assumes that wlan0 will be joining an existing wifi network, and wlan1 will be in manual mode so it can be used as an AP.
* [[Ubuntu/OpenVPN Server]] - set up an OpenVPN server on a Ubuntu machine (not running on bespin)


<code>/etc/network/interfaces</code>
==Old Irrelevant Articles==


<pre>
Articles that are no longer relevant to bespin but that may have useful information for some future project.
allow-hotplug wlan0
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface wlan0 inet dhcp


allow-hotplug wlan1
* <s>[[Ubuntu/Bespin/Second AP Tunnel]]</s> - this ended in failure, twice. short version: you can't have multiple simultaneous PIA tunnels in OpenVPN without significant extra configuration, so no need to go this above and beyond.
iface wlan1 inet static
    address 192.168.10.1
    netmask 255.255.255.0
    gateway 192.168.10.1
</pre>


except actually the iface names were dependent on the mac addresses of the wifi cards.
* <s>[[Ubuntu/Bespin/Wifi Repeater]]</s> - using bespin to run hostapd and make a wifi repeater


==WPA Supplicant Startup Service==
* <s>[[Ubuntu/Bespin/Old/Wifi AP Setup]]</s>  set up a wireless AP to create/host a wifi hotspot on the machine


Copy a wpa supplicant service template:
* <s>[[Ubuntu/Bespin/Old/AP PIA Tunnel]]</s> - route traffic from a wireless AP to a PIA VPN tunnel


<pre>
* <s>[[Ubuntu/Bespin/Old/Iptables]]</s> - old iptables rules for things that aren't actually running on Bespin
sudo cp /lib/systemd/system/wpa_supplicant.service /etc/systemd/system/wpa_supplicant.service
</pre>


Edit the file
<pre>
sudo vim /etc/systemd/system/wpa_supplicant.service
</pre>
Change this line from this:
<pre>
ExecStart=/sbin/wpa_supplicant -u -s -O /run/wpa_supplicant
</pre>
to this:
<pre>
ExecStart=/sbin/wpa_supplicant -u -s -c /etc/wpa_supplicant/wpa_supplicant.conf -i wlan0
</pre>
Also, remove the following line if it is present:
<pre>
Alias=dbus-fi.w1.wpa_supplicant1.service # DELETE ME!
</pre>
Now enable this service to start on boot:
<pre>
sudo systemctl enable wpa_supplicant.service
</pre>
==Dhclient Startup Service==
Create a dhclient startup service:
<code>/etc/systemd/system/dhclient.service</code>
<pre>
[Unit]
Description= DHCP Client
Before=network.target
[Service]
Type=simple
ExecStart=/sbin/dhclient wlan0 -v
ExecStop=/sbin/dhclient wlan0 -r
[Install]
WantedBy=multi-user.target
</pre>
Enable the dhclient startup service to start on boot:
<pre>
sudo systemctl enable dhclient.service
</pre>
==Disable Network Manager==
Next step is to disable the network manager.
<pre>
sudo systemctl disable network-manager
sudo systemctl stop network-manager
</pre>
Don't uninstall it, because that will uninstall a bunch of other important gnome packages and you'll be left with a stupid broken ubuntu.
==Tweaking Gnome==
Now tweak it:
* Tweak tools
* Set up like a mac
* plank and startup service
* albert and startup service




Line 140: Line 42:
[[Category:Ubuntu]]
[[Category:Ubuntu]]
[[Category:Linux]]
[[Category:Linux]]
[[Category:Unix]]
[[Category:Machine]]
[[Category:Machine]]
[[Category:Bespin]]

Latest revision as of 05:38, 19 August 2020

Step by Step Articles

All the setup involved for bespin, a Ubuntu 18.04 desktop server.

  • Ubuntu/Bespin/DNS - removing the built-in DNS server on Ubuntu and replacing it with dnsmasq
  • Ubuntu/Bespin/PiHole - run an instance of PiHole, the DNS sinkhole, in a Docker container; install it between dnsmasq and the VPN tunnel, so all DNS queries will pass through the PiHole
  • Ubuntu/Bespin/Iptables - Update the iptables rules to allow better protection of the server and be less permissive
  • Ubuntu/Bespin/TIL - the summary of "today I learned" things that I learned while setting up Bespin

Related Articles

Old Irrelevant Articles

Articles that are no longer relevant to bespin but that may have useful information for some future project.

  • Ubuntu/Bespin/Second AP Tunnel - this ended in failure, twice. short version: you can't have multiple simultaneous PIA tunnels in OpenVPN without significant extra configuration, so no need to go this above and beyond.