IPv6 Static Address on Ubuntu

27 04 2012
So – I have blogged about how to enable IPv6 on your firewall & setup your tunnel, and how to manually add addresses to an ubuntu server, but what about the server you are sticking on the end of the tunnel permanently – you want it up every reboot.
I have an Ubuntu box sitting on 2001:470:489e::100. This hosts http://public6.blackundertone.com & also my mail host mail.blackundertone.com
Most modern distro’s will have IPv6 enabled out of the box & it will do its best to grab an address. I didnt want autoconfiguration to hand any old address to it (even with SLAAC using the MAC address) to this host – so I could properly setup inbound & outbound FW rules.
You can turn it off by entering the following in /etc/sysctl.conf & reboot
– Disable the autoconf / SLAAC capability for all interfaces

net.ipv6.conf.eth0.autoconf=0

– Ignore the RA messages from your router

net.ipv6.conf.eth0.accept_ra=0

If you just want to test it out – or dont want to reboot your machine

sudo sysctl -w net.ipv6.conf.eth0.autoconf=0
sudo sysctl -w net.ipv6.conf.eth0.accept_ra=0

–BEFORE with autoconfigured Global IPv6 address–
eth0      Link encap:Ethernet  HWaddr 00:50:56:a1:70:d1
          inet addr:10.0.1.100  Bcast:10.0.1.255  Mask:255.255.255.0
          inet6 addr: 2001:470:489e:0:250:56ff:fea1:70d1/64 Scope:Global
          inet6 addr: fe80::250:56ff:fea1:70d1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:56 errors:0 dropped:12 overruns:0 frame:0
          TX packets:47 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:6219 (6.2 KB)  TX bytes:7140 (7.1 KB)
–AFTER only link-local address remains–
eth0      Link encap:Ethernet  HWaddr 00:50:56:a1:70:d1
          inet addr:10.0.1.100  Bcast:10.0.1.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fea1:70d1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:254 errors:0 dropped:12 overruns:0 frame:0
          TX packets:237 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:24646 (24.6 KB)  TX bytes:33280 (33.2 KB)
Now – its simply another couple of lines in your /etc/network/interfaces file & a quick network restart
iface eth0 inet6 static
        address 2001:470:489e::100
        netmask 64
        gateway 2001:470:489e::1
and your shiny new STATIC ASSIGNED IPv6 address is active
eth0      Link encap:Ethernet  HWaddr 00:50:56:a1:70:d1
          inet addr:10.0.1.100  Bcast:10.0.1.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fea1:70d1/64 Scope:Link
          inet6 addr: 2001:470:489e::100/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:806 errors:0 dropped:116 overruns:0 frame:0
          TX packets:716 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:71814 (71.8 KB)  TX bytes:110482 (110.4 KB)
Apache & Postfix should already listen on any IPv6 addresses – so simply restart the services.




macbook4,1 – ubuntu & wireless woes (fixed)

17 01 2011

I have a newish (couple of years) macbook 4,1

Model Name:    MacBook
Model Identifier:    MacBook4,1
Processor Name:    Intel Core 2 Duo
Processor Speed:    2.4 GHz
Number Of Processors:    1
Total Number Of Cores:    2
L2 Cache:    3 MB
Memory:    4 GB
Bus Speed:    800 MHz

Recently I decided I had had enough of OSX and threw Ubuntu 10.10 on it – all has been reasonably smooth sailing (minus the dying HDD, the repartitioning & GRUB woes …)

I pulled the Airport Extreme out of the cupboard the other day (I had been tethering with my Android HTC Desire while we were building a house) – and lo & behold I had dramas connecting to it. Wireless N WPA2/TKIP.

Anyway, a bit of googling time later, I found a great couple of lines to fix the issue. Wireless has been rock solid (so far) since making this change. Changing the ifupdown to managed & adding config for ifup & ifdown did the trick.

sudo gedit /etc/NetworkManage/nm-system-settings.conf

[ifupdown]
managed=true
#managed=false

[ifup]
managed=true

[ifdown]
managed=true

Reboot & wireless is golden again.