- Basic configuration hints
- Improve your shell experience
- Install tools from Debian repository
- Restart Crashed / Hanging Web GUI
- Setup PPTP VPN Client
- Run Ubiquity UNMS on ProxMox using LXC
- Auto-route traffic for AWS region to a VPN
This script will set up:
- coloured prompt with:
- vyatta configuration edit session info (changed, saved, ...)
- different colours for root / normal user
- command aliases (which probably mostly I use)
- command history with:
- completion search (up/down arrow keys)
- jump between words (left/right arrow keys + option/alt)
Install vhk.sh
to /etc/profile.d
:
curl -L https://gist.githubusercontent.com/pinkeen/3076cd6f5cc5b08d3faacfa2db149a17/raw/vhk.sh -o /etc/profile.d/99-custom.sh
For root profile is not sourced automatically so add:
echo '. /etc/profile' >> /root/.bashrc
See the official docs for verbose info.
set system config-management commit-revisions 10
This allows you later list commits and roll them back.
rollback ? # list commits
rollback {NUM}
Note: I was not able to get it work key auth, only password seems possible.
set system config-management commit-archive location scp://user:[email protected]/Some/Path/To/Backups
Based on official Ubiquity Docs.
Just enable it: 😎
set service dhcp-server use-dnsmasq enable
set service dhcp-server shared-network-name LAN1 subnet 192.168.1.0/24 domain-name ubnt.local
Remove the old system image left from previous update.
As root, but NOT in configuration mode:
delete system image
Warning: This repos (stretch) work only for firmware 2.x
set system package repository stretch components 'main contrib non-free'
set system package repository stretch distribution stretch
set system package repository stretch url http://http.us.debian.org/debian
apt -y install nano ccze htop dnsutils
This will remove package index and the downloaded package files.
rm -rvf /var/lib/apt/lists/ /var/cache/apt/archives/
pkill -9 -f lighttpd
configure
delete service gui
commit
set service gui
commit
Note: PPTP has been cracked and is considered insecure...
set interfaces pptp-client pptpc0
set interfaces pptp-client pptpc0 default-route auto
set interfaces pptp-client pptpc0 server-ip {remote-host}
set interfaces pptp-client pptpc0 description {label}
set interfaces pptp-client pptpc0 user-id {username}
set interfaces pptp-client pptpc0 password {password}
set protocols static interface-route {target-subnet} next-hop-interface pptpc0
set service nat rule 5005 outbound-interface pptpc0
set service nat rule 5005 type masquerade
set service nat rule 5005 description {rule-name}
If you need to restart a misbehaving PPTP connection without changing configuration you might use this trick.
configure
save
delete interfaces pptp-client
commit
load
compare
commit
exit
My use-case: Our AWS SGs allow SSH access only from company network.
Install the route-aws-region-to-interface.sh
script and execute it as task
every 7 days to update routing.
curl -L https://gist.githubusercontent.com/pinkeen/3076cd6f5cc5b08d3faacfa2db149a17/raw/route-aws-region-to-interface.sh -o /config/scripts/route-aws-region-to-interface.sh
chmod +x /config/scripts/route-aws-region-to-interface.sh
set system task-scheduler task RouteAWSREgionEUCentral1ToPPTPC0 executable path /config/scripts/route-aws-region-to-interface.sh
set system task-scheduler task RouteAWSREgionEUCentral1ToPPTPC0 executable arguments 'eu-central-1 pptpc0'
set system task-scheduler task RouteAWSREgionEUCentral1ToPPTPC0 interval 7d
The static routes cannot have a description or be grouped in any way. This introduces tonnes of routes and they cannot easily be removed at once and clutter everything.
It may be more flexible and clean to set them up using something like Policy-Based Routing.
Note: This is not a complete guide, general container configuration steps, etc. are ommited assuming that they are obvious to the skilled reader.
The whole process is painless and takes ~15min.
Based on this post.
Create an LXC container using an image with one of the officially supported distros:
- Ubuntu 16
- Ubuntu 18
- Debian 9
-
Install docker, if on Ubuntu you can use the Official Guide.
-
Install docker service overrides:
mkdir -p /etc/systemd/system/containerd.service.d
echo -e "[Service]\nExecStartPre=\n" > /etc/systemd/system/containerd.service.d/override.conf
systemctl daemon-reload
systemctl start docker
systemctl enable docker
Set up container options needed for running docker:
features: keyctl=1,nesting=1
- Add it via
Options
tab in the web GUI - Edit the file ``/etc/pve/lxc/.conf`
- Use the
pct
CLI tool
Follow the official installation guide.
curl -fsSL https://unms.com/v1/install > /tmp/unms_inst.sh && sudo bash /tmp/unms_inst.sh
See: The UNMS Key and the Device Registration Process.
Or just go to the network address of the running container 🤞
Write down:
- SSH Key auth
- Set up HTTPS certs with LE via ACME.sh
Also: Automate all of this with ansible.