Category Archives: Networking

Topics where I discuss about net configurations.

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 has address has address has address has IPv6 address 2001:a78:5:1:216:35ff:fe7f:6ceb has IPv6 address 2001:8d8:580:400:6564:a62:0:2 has IPv6 address 2001:a78:5:0:216:35ff:fe7f:be4f mail is handled by 10

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 for more info on that one.)
Anyways, the format is ::ffff:0:0/96 which means that the ipv4 ip address will be written as 0:0:ffff: and will match that line in gai.conf.

NAT with iptables on Linux

Just trying to configure NAT on a Linux Backtrack with two ethernet cards (eth1 is inside and eth0 is outside) and I would like to share here the configuration I made:

Activation of the IP Forwarding on the machine

echo 1 > /proc/sys/net/ipv4/ip_forward

Activation of the NAT with itables

iptables -t nat --append POSTROUTING -o eth0 -j MASQUERADE

To display the NAT statistics
You need to install an additional tool to display the current stats

sudo apt-get install netstat-nat

Just type the following command to see live translations:

watch -d netstat-nat -Nn

There is some applications or sites allowing you to test the type of NAT implementation you have, here is an interesting one from the University of München.
And that’s it !