BT just enabled Infinity in my residential area, so I quickly contacted my ISP to see if they could upgrade me. They said they were still working on their fibre rollout and couldn’t estimate when they might be able to provide a fibre to the cabinet connection. Obviously I dropped them like a shitty stick, and put my order in with BT immediately.
My old connection with Bethere would let me download at about 6Mb and upload at well under 1Mb over ADSL2+. After the BT engineer upgraded my connection, I almost squealed with glee to see it was almost 37Mb downstream and 8.6Mb upstream. That’s a serious upgrade!
The engineer installed a new modem and the BT HomeHub router. Of course I don’t want to use a generic router so I unplugged it and began figuring out how I could plug my trusty Linux Acer Revo 3600 back in. The modem has 2 ethernet ports on the back, but one is masked off. Plugging in to that was the easy part. What I wasn’t sure of was what the modem really was – Was it a real modem or was it like my old BeBox which maintained the connection for me and acted as an invisible bridge?
I spent hours messing around with /etc/network/interfaces and trying various settings. As it turns out it is a real modem and my Revo needed to treat it as a PPPoE device. I eventually got it connected but then found that certain web sites weren’t loading or were partially loading from other machines on my network. That’s a very big indication of an MTU problem.
If you get BT Infinity and decide you want to hook a Linux router up to the modem then do yourself a favour and use pppoeconf. I didn’t know the program existed until I’d already been messing around for hours. It has nice prompts which ask you for your login information, the device, and even tells you that you will likely have an MTU problem and that it can fix it for you! Apparently this is because many PPPoE modems have a maximum MTU of 1460 and there’s another 4 overhead for machines that you’re masquerading on your network. So your max MTU must be clamped at 1454. pppoeconf does this by creating a ppp ip-up script which uses iptables.
iptables -t mangle -o "$PPP_IFACE" --insert FORWARD 1 -p tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1400:65495 -j TCPMSS --clamp-mss-to-pmtu
Unless you have a good reason not to use pppoeconf, save yourself some time and just run it.
That said, I’d already been configuring my system manually and only needed to add the MTU tweak so that’s what I did. Below you’ll find the configuration that I use. Bear in mind my little Revo is running Ubuntu.
/etc/ppp/peers/bt
# Load rp-ppoe.so for kernel mode interface naming compatibility (ie, ppp0, ppp1) plugin rp-pppoe.so eth1 # Every BT Infinity user uses the same login information. Don't use # your personal one - that's just for e-mail. user "bthomehub@btbroadband.com" # The device to which the Infinity modem is connected eth1 #Bind this connection to ppp99 unit 99 # Assumes that your IP address is allocated dynamically by the ISP. noipdefault # Try to get the name server addresses from the ISP. # I have commented this because I run my own full DNS # server locally. Most people will want this enabled. #usepeerdns # Use this connection as the default route. defaultroute replacedefaultroute hide-password # Makes pppd "dial again" when the connection is lost. persist # Do not ask the remote to authenticate. noauth
I added this to the end of /etc/ppp/chap-secrets. BT don’t actually require a password but I’ve read that sometimes PPP connections can fail if they’re not provided so I added one anyway.
"bthomehub@btbroadband.com" * "BT"
/etc/ppp/ip-up.d/0clampmss
#!/bin/sh # Enable MSS clamping (autogenerated by pppoeconf) iptables -t mangle -o "$PPP_IFACE" --insert FORWARD 1 -p tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1400:65495 -j TCPMSS --clamp-mss-to-pmtu
And I added this to my /etc/network/interfaces. The pre-up makes eth1 (the port my modem is connected to) available before PPP dials. The provider line tells it to use the details in the “/etc/ppp/peers/bt” file above. eth1 itself is configured as a manual device so that we don’t have to give it an ip address at this stage.
auto bt iface bt inet ppp pre-up /sbin/ip link set dev eth1 up provider bt iface eth1 inet manual
I faced one more “gotcha”. I had to reconfigure my iptables to allow certain connections through my new ppp99 device rather than eth1. I use webmin for a lot of common administration and it uses iptables-restore and iptables-save and of course when I updated my iptables, it removed the MTU clamping rule. To make sure that didn’t happen again, I configured iptables how I wanted it and then re-added the MTU clamping rule. Then I ran iptables-save.
iptables-save > /etc/iptables.up.rules
That’ll ensure the rule doesn’t get accidentally removed again the next time I’m reconfiguring iptables in webmin.

Posted in
Tags: 
