20 July

Make FireFox, Chrome, Lynx resolve IPv6 pages in OpenBSD

So far it defaults to IPv4

Finally got native IPv6 at home. Setting it up with ifconfig $IF inet6 autoconf is a breeze, but Firefox just ignored it. Actually, whenever there was the choice of reaching a site by IPv4, it preferred that. As did Chrome, as did Lynx.

As soon as I figured out that it's not just Firefox, the finger started to point at DNS. Turns out the solution is found in resolv.conf(5). At the time of writing, the DNS resolver "prefers" IPv4 addresses. The solution can be had as simple as:

echo 'family inet6 inet4' >> /etc/resolv.conf.tail

To give the priority to IPv6 (aka inet6 in ifconfig speak). I found testmyipv6 a good place to start for a solution, while test-ipv6.com gives a more comprehensive test (but requires JavaScript). The one thing that opened my eyes was the IPv6-only site test in test-ipv6, as soon as I noticed that this one works, things became more clear.

Posted by betabug at 17:22 | Comments (0) | Trackbacks (0)
16 November

Touchpad Synaptic Settings for Thinkpad L440

Probably the same for X240, T440, ... other 40 series Thinkpads

Got myself a cheapish Lenovo Thinkpad L440 as a replacement/spare laptop (while my X220 is hopefully being fixed), running OpenBSD ofcows. Problem with this machine's hardware: There are no real buttons for the TrackPoint, instead it uses the top of the Touchpad (you press it down) and some software to determine where you clicked.

On the X220 I had the Touchpad disabled in the Bios, and used exclusively the TrackPoint. Works great. On the L440, you can't disable the Touchpad in the Bios. Instead in OpenBSD you have to use the synaptics(4) driver, with some synclient(1) commands to set things up. Basically you disable the Touchpad (aka Trackpad) for mouse movement. You keep its functionality for clicking, and you define some areas where the middle and right button clicks are. This works fine, but the feel of the dedicated buttons was much, much better.

In any case, here are the settings that I'm using in my .xinitrc::

# disable touchpad, except for clicking
synclient TouchpadOff=1
# set up fake buttons for the trackpoint
synclient ClickPad=1

synclient MiddleButtonAreaLeft=2636
synclient MiddleButtonAreaRight=3442
synclient MiddleButtonAreaTop=0
synclient MiddleButtonAreaBottom=3306

synclient RightButtonAreaLeft=3443
synclient RightButtonAreaRight=0
synclient RightButtonAreaTop=0
synclient RightButtonAreaBottom=3306

Posted by betabug at 17:57 | Comments (1) | Trackbacks (0)
17 April

Getting the current session name from tmux

Are you talking to me?

Had the little mystery of how to get the name of the current session in tmux into a shell script. Why? Because that script should talk to the same pane/window/session again later. Hacking and searching around a bit, this is what I came up with:

SESSION=`tmux list-panes -F '#{session_name}'`

Funny enough it uses the list-panes command, which by default lists only the panes of the current window and session. Then, using the -F format string, we can tell it to give us the session name only.

Later I can use this in the script like this:

tmux select-window -t$SESSION:window_name

... and there shouldn't be any mistakes as to which session I'm talking to.

Posted by betabug at 21:00 | Comments (1) | Trackbacks (0)
14 April

openbsd ipsec.conf roadwarrior puzzlestone

Took me a while to notice...

When setting up the IPSec NAT on my "roadwarrior" laptop, I was baffled for quite some time with the question: How do I set up the src address, without having to edit ipsec.conf whenever I am on a different network in a different RFC1918 private natted address range? One day I would be on and the next on

# this can't be it!! wtf?
# ike dynamic from iwn0 to any
# ike dynamic from iwn0 to any
ike dynamic from iwn0 to any

Add up DHCP on all those networks and this really can't be it.

Turns out the information / solution actually is in the man page (yay for OpenBSD man pages):

Addresses can be specified in CIDR notation (matching netblocks), as
symbolic host names, interface names, or interface group names.

So basically what you can do is to start your ipsec.conf setup with your interface name as something like:

ike dynamic esp from iwn0 to any

Which means that the ipsec tunnel will get set up on whatever address that interface gets assigned. And you could even create an interface group "vpn" to cover both your wifi and ethernet interfaces. Neat.

The next thing to find out for me is how I can do from iwn0 to any but not to my local subnet... but I guess I'll figure that out too some day.

BTW: having OpenBSD IPSec on both sides of my VPN made the setup really easy.

Posted by betabug at 17:55 | Comments (0) | Trackbacks (0)