Category Archives: Blog

IPv6 LAN Network Address Translation (NAT) on OPNSENSE

Legacy IPv4 network space is exhausted, and new internet service providers like T-mobile 5G home internet run an IPv6 only network.

Sometimes you can’t use the IPv6 addresses due to your ISP not being mature enough to provide IPv6 prefix delegation in combination with the lack of advanced features on the T-mobile 5G home router like ‘bridge mode’ you may be stuck with a double NAT situation.

In 2021, I would say that implementing IPv6 on your network is almost mandatory. Major service providers like Netflix, Google, Cloudflare and others operate dual-stack networks.

I’ll admit that my home network running OPNsense firewall has had IPv6 disabled to avoid complexities since only 30% of the internet uses IPv6 today. However, I decided that its time to try to fix this since I wanted all my devices on my network to be able to pass IPv6 readiness tests like http://ipv6-test.com and http://test-ipv6.com.

Internet Service Provider (ISP) addresses

Router: Nokia 5G Fastmile (T-mobile home internet)
Provides all direct-connected devices with a NAT IPv4 addresses in the range of 192.168.12.0/24.

IPv6 addresses are from the public unicast T-mobile segment assigned to your router, however T-mobile IPv6 network does heavy inbound packet filtering. You won’t be able to ping or access your public unicast IPv6 addresses from anywhere (sucks right?) 

To configure a dual-stack local area network in OPNSENSE, assume you have a ‘fresh install’ which already has IPv6 enabled on the system.

  1. Configure your WAN interface to obtain DHCPv6 addresses.
  2. Configure your LAN interface to Static IPv6
    1. assign static IPv6 of fdde:5453:540e:ff12::1
  3. Configure your LAN DHCPv6 service to this range
    1. range start: fdde:5453:540e:ff12::2
    2. range end: fdde:5453:540e:ff12:ffff:ffff:ffff:ffff
  4. Configure Firewall > NAT > Outbound
    1. set to ‘hybrid’
    2. Add manual rule
      1. interface WAN
      2. Version IPv6
      3. protocol any
      4. source LAN
      5. destination any
      6. translation target WAN address
  5. Configure Services > Router Advertisement LAN
    1. From ‘disabled’ to ‘Assisted’
  6. Save all settings and ensure all services are restarted.

Your clients on LAN should now get a local IPv6 address from DHCPv6, the outbound NAT rule should allow you to pass the IPv6 tests and communicate with IPv6 internet hosts via the single IPv6 WAN address that the T-mobile home router gives out.

I’m hoping that T-mobile becomes a more mature ISP in the future, while speeds are great there are several shortcomings to relying on 5G Home internet service for home use. These problems don’t exist in Comcast and AT&T Fiber:
– IPv6 Prefix Delegation (PD) so you can subnet all your networks.
– Packet filtering that you can’t disable or manage yourself. On AT&T fiber and comcast you can host your own remotely accessible VPN server. Not on T-mobile so beware if that’s your use case.

Proxmox share volume via NFS

The following command will allow host 192.168.1.10 to have write access and mount this volume remotely, all while identifying changes as ‘root’ – this is helpful for a container data store when you have docker running on a VM in proxmox but want to piggyback from the resilient ZFS storage in proxmox.

 

 

 

 

zfs set sharenfs="[email protected]" gdata/containers

Install TunSafe VPN on Proxmox LXC container

I’m experimenting with TunSafe which is a fork of wireguard that includes traffic obfuscation built-in. Traffic obfuscation is useful to hide VPN traffic from ISP’s network throttling which is done when network packet inspection identifies a tunnel protocol.

You will need a privileged container in proxmox.

Add this to container configuration file

lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file


Without this setting on the configuration file of the container tunsafe will not start. Error similar to:
~# systemctl status tunsafe.service
● tunsafe.service - TunSafe service
   Loaded: loaded (/etc/systemd/system/tunsafe.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2021-01-24 19:22:59 UTC; 26s ago
  Process: 6949 ExecStart=/opt/tunsafe/tunsafe start -d /opt/tunsafe/TunSafe.conf (code=exited, status=1/FAILURE)
 Main PID: 6949 (code=exited, status=1/FAILURE)

Jan 24 19:22:59 tunsafe-gw systemd[1]: Starting TunSafe service...
Jan 24 19:22:59 tunsafe-gw tunsafe[6949]: Loading file: /opt/tunsafe/TunSafe.conf
Jan 24 19:22:59 tunsafe-gw tunsafe[6949]: Started TCP listening socket on port 443
Jan 24 19:22:59 tunsafe-gw tunsafe[6949]: Error opening tun device
Jan 24 19:22:59 tunsafe-gw systemd[1]: tunsafe.service: Main process exited, code=exited, status=1/FAILURE
Jan 24 19:22:59 tunsafe-gw systemd[1]: tunsafe.service: Failed with result 'exit-code'.
Jan 24 19:22:59 tunsafe-gw systemd[1]: Failed to start TunSafe service.

Speed up ZFS on linux resilvering times

You can speed up resilvering times on ZFS (on linux) by temporarily changing the following settings:

echo 0 > /sys/module/zfs/parameters/zfs_resilver_delay
echo 512 > /sys/module/zfs/parameters/zfs_top_maxinflight
echo 5000 > /sys/module/zfs/parameters/zfs_resilver_min_time_ms

To reset back to defaults, do:

echo 2 > /sys/module/zfs/parameters/zfs_resilver_delay
echo 32 > /sys/module/zfs/parameters/zfs_top_maxinflight
echo 3000 > /sys/module/zfs/parameters/zfs_resilver_min_time_ms

A reboot of the system should also reset these defaults.

MariaDB disable automatic root authentication

If you are like me, you wouldn’t want anyone with console access to your server to be able to have root credentials to the database engine if they own your server. The use of “mysql -u root” should not by default grant you root on the database server.

Well apparently in MariaDB 10.1.xx I found out this was the case, because of something they call “plugin” feature of “unix_socket” which is the default.

If you are seeing this on your system and want to confirm that’s why, use the following query in the mysql shell:

MariaDB [(none)]> select Host,User, Password,plugin from mysql.user;
+-----------+------+-------------------------------------------+-------------+
| Host      | User | Password                                  | plugin      |
+-----------+------+-------------------------------------------+-------------+
| localhost | root | *DEEF4D7D88CD046ECA02A80393B7780A63E7E789 | unix_socket |
+-----------+------+-------------------------------------------+-------------+

So to fix this, reset or update your root password first then execute this inside the mysql shell:

UPDATE mysql.user SET plugin = '' WHERE user = 'root' AND host = 'localhost';

Homelab 2017 refresh

My faithful Lenovo TS440 home server has reached its peak potential as I have maxed out the 32gb memory limit of the Intel E3 v3 architecture.

My needs for more CPU power and memory is driven by the idea of hyperconvergence. Which means I use a single machine to be my router/firewall, VPN gateway, network storage as well as virtual machine host.

Those themes have been part of my home network design since 2010 or so, today’s hot technologies are focusing on containers (LXC), Docker, etc. So I need a more powerful server in order to be able to expand my playground into those technologies. The 32gb maximum on my old server is simply not enough when you have 5 different VMs that consume almost all your memory resources (windows 10 VM, OSX one and my FreeNAS one being the top users of 75%+). Continue reading

3 week post-LASIK update

If you are following my LASIK journey, where I drove to Mexico to get it done. This is my 3 week post-op update.

I’ll keep it brief and summarize my experience over the past 3 weeks. If you read my initial post you know that I had moderate Hyperopia (farsightedness) plus astigmatism that I wanted to get corrected.

Continue reading

TeamViewer monitoring and instant push notifications

It has been almost a year since that massive reddit post with people freaking out about their TeamViewer accounts getting hacked [link].

Since then I have always wished team viewer would notify my cellphone every time someone connected or disconnected from my workstation, since I am the only user that connects to it I find the peace of mind extremely valuable and I wouldn’t mind getting some push notifications each time I used TeamViewer.

As TeamViewer themselves don’t have this feature I decided to write my own little program that will  send instant notifications to any phone for anyone connecting to your workstation using TeamViewer. Say hello to go-TValerts!


I have released my code as open source, written instructions on how to install and implement it. Find out more at github.com/TheLinuxGuy/go-tvalerts

I drove to Mexico to get LASIK eye surgery

This is a follow up post about my research for LASIK vision correction. You can read it here.

Why Mexico?

Based on the technology advantages of the AMARIS 1050RS laser system that is widely available in Europe, Latin America, Canada but not in the United States I ended up deciding to get my vision corrected using the latest technology. Continue reading

Xenserver 7.1 a good contender to replace esxi

I have been a big fan and user of vmware ESXi for years, I started playing with it since circa 2008. The bare metal hypervisor and its easy to use GUI on Windows makes virtualization management extremely easy.

However in the past couple of years the free version of esxi has moved to HTML5 web management, and in the latest ESXi version the Windows client (vSphere client) requires you to pay for a license a run a central vcenter server/vm in order to manage via GUI (non-web).

Continue reading