LTE available for iPhone 5

Beginning of January, Swisscom made a “network” update and I had to reboot my iPhone5. I though it was to finally run LTE on it, but after some tests and researches, I found that it was not working. Finally, yesterday Apple provided the iOS 6.1 update (See it’s press release). This update includes also a “Carrier software” update.

I’m now ready with LTE, as you can see:

Screen Shot 2013-01-30 at 7.43.05 AM

You have to activate it on your iPhone, as mentioned on the Swisscom Website and as shown here below. I’ve made some rapid Speed tests near the railway mainstation in Fribourg, and I can reach 7 to 8 Mb/s Download speed, quite nice !

LTE_001 LTE_005

Preferring IPv4 over IPv6 for apt-get

As more and more hosts are moving over to IPv6, you might encounter DNS A records with IPv6 entries. That’s all fine, but sometimes networks or firewall filters are not well configured and you loose connectivity. Sadly, modern GNU/Linux systems prefer IPv6 addresses over IPv4 when being presented with a choice.

As an example, Debian’s or Ubuntu apt-get update over IPv4 and IPv6:

root@mybox:~# host security.debian.org
security.debian.org has address 195.20.242.89
security.debian.org has address 212.211.132.32
security.debian.org has address 212.211.132.250
security.debian.org has IPv6 address 2001:a78:5:1:216:35ff:fe7f:6ceb
security.debian.org has IPv6 address 2001:8d8:580:400:6564:a62:0:2
security.debian.org has IPv6 address 2001:a78:5:0:216:35ff:fe7f:be4f
security.debian.org mail is handled by 10 chopin.debian.org.

We could just add static ipv4 lines in /etc/hosts, but I don’t want to disable IPv6 altogether. So, how do we tell the system to prefer IPv4 addresses over IPv6?
It’s rather simple, actually: we need to have a look at getaddrinfo(3)’s configuration file; /etc/gai.conf.

Locate this line and uncomment it:

#precedence ::ffff:0:0/96  100

IPv4 is preferred now.
This works as that’s the special address range to help in the transition from 4 to 6; every IPv4 address can be written as an IPv6 one using that form.
(See http://en.wikipedia.org/wiki/IPv6#IPv4-mapped_IPv6_addresses for more info on that one.)
Anyways, the format is ::ffff:0:0/96 which means that the ipv4 ip address 192.168.18.234/32 will be written as 0:0:ffff:192.168.18.234/128 and will match that line in gai.conf.

IP Release, Renew, and Flush DNS (OSX)

Sometimes it is usefull to manipulate the IP configuration of your MAC, those commands will allow you to manipulate the local DNS cache and the DHCP address assignement.

DNS cache

To flush the DNS cache, open the Terminal. (Go > Utilities > Terminal, and type in the following command:

dscacheutil -flushcache
DHCP Address

To Release and then renew the IP address on a mac:

sudo ipconfig set en0 BOOTP 
sudo ipconfig set en0 DHCP 

You can alias the two together in your bash profile:

alias renew="sudo ipconfig set en0 BOOTP && sudo ipconfig set en0 DHCP" 

You will find DHCP client lease information in an appropriately named interface file in the /var/db/dhcpclient/leases directory.

Just another weblog