Ubuntu/Bespin: Difference between revisions
From charlesreid1
| Line 188: | Line 188: | ||
Test that everything is working as expected by running the ifconfig and iwconfig commands. ifconfig should show an IP address for the wlan0 interface that has the wpa supplicant defined in the network interfaces file. iwconfig should show the name of the wifi network that the wifi card is connected to. | Test that everything is working as expected by running the ifconfig and iwconfig commands. ifconfig should show an IP address for the wlan0 interface that has the wpa supplicant defined in the network interfaces file. iwconfig should show the name of the wifi network that the wifi card is connected to. | ||
If you don't have an IPv4 address, troubleshoot with the following commands: | |||
Check if you can reach the internet: | |||
<pre> | |||
ping google.com | |||
</pre> | |||
Check logs from dhcp service (this gets an IP address from the router and is the most likely culprit): | |||
<pre> | |||
sudo service dhclient status | |||
</pre> | |||
Check logs from wpa supplicant: | |||
<pre> | |||
sudo service wpa_supplicant status | |||
</pre> | |||
==Tweaking Gnome== | ==Tweaking Gnome== | ||
Revision as of 22:09, 3 July 2020
Setup
Aptitude update
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.
sudo apt-get update sudo apt-get -y install vim gnome-tweak-tool net-tools
Set caps lock as a control key.
Allow sudo for user
Create wheel group:
sudo groupadd wheel
Add user to group:
sudo usermod -a -G wheel <your-username-here>
Allow wheel group users passwordless sudo, first use visudo to edit the sudoers file:
EDITOR=vi visudo
Now add this line to the end:
%wheel ALL=(ALL) NOPASSWD: ALL
Install ssh
Install ssh and server:
sudo apt-get install ssh
Start the server:
sudo service ssh start
Configure WPA Supplicant
We want to configure wifi manually, and disable the network manager. This requires some preparation to manually join a wifi network with wpa supplicant.
First set your wpa supplicant to join a wifi network.
/etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="yournetworkhere"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="yourpskhere"
}
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.
/etc/network/interfaces
allow-hotplug wlan0
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface wlan0 inet dhcp
allow-hotplug wlan1
iface wlan1 inet static
address 192.168.10.1
netmask 255.255.255.0
gateway 192.168.10.1
except actually the iface names were dependent on the mac addresses of the wifi cards.
WPA Supplicant Startup Service
Copy a wpa supplicant service template:
sudo cp /lib/systemd/system/wpa_supplicant.service /etc/systemd/system/wpa_supplicant.service
Edit the file
sudo vim /etc/systemd/system/wpa_supplicant.service
Change this line from this:
ExecStart=/sbin/wpa_supplicant -u -s -O /run/wpa_supplicant
to this:
ExecStart=/sbin/wpa_supplicant -u -s -c /etc/wpa_supplicant/wpa_supplicant.conf -i wlan0
Also, remove the following line if it is present:
Alias=dbus-fi.w1.wpa_supplicant1.service # DELETE ME!
Now enable this service to start on boot:
sudo systemctl enable wpa_supplicant.service
Dhclient Startup Service
Create a dhclient startup service:
/etc/systemd/system/dhclient.service
[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
Enable the dhclient startup service to start on boot:
sudo systemctl enable dhclient.service
Requesting Static IP
If you want to request a static IP from the router, add this to the dhclient config file:
/etc/dhcp/dhclient.conf
interface "wlan0" {
send dhcp-requested-address 192.168.0.122;
}
Disable Network Manager
Next step is to disable the network manager.
sudo systemctl disable network-manager sudo systemctl stop network-manager
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.
Now reboot
sudo reboot now
Test Wifi
Test that everything is working as expected by running the ifconfig and iwconfig commands. ifconfig should show an IP address for the wlan0 interface that has the wpa supplicant defined in the network interfaces file. iwconfig should show the name of the wifi network that the wifi card is connected to.
If you don't have an IPv4 address, troubleshoot with the following commands:
Check if you can reach the internet:
ping google.com
Check logs from dhcp service (this gets an IP address from the router and is the most likely culprit):
sudo service dhclient status
Check logs from wpa supplicant:
sudo service wpa_supplicant status
Tweaking Gnome
Now tweak it:
- Tweak tools
- Set up like a mac
- plank and startup service
- albert and startup service