Trying to configure an ADSL modem/router as modem only to use with a Linux router (and indeed many wireless routers) in NZ can be problematic owing to the lack of PPPoE support from NZ telcos. Here are a few pointers about how to do it.
Telecom NZ uses PPPoA encapsluation for its DSL, along with all the other ISPs who use telecoms network. It is said however that Telstra Clear NZ uses PPPoE, although I haven't tried it. If so you should be able to use full transparent bridging and the half bridge issue goes away.
PPPoA is the encapsulation type used by modems in this situation, and when this is the case, you cannot use PPPoE from the router to the modem, as you would with full bridging.
Why would you want to do this anyway:?
To get an idea of the confusion this issue causes:
Take overseas howtos with a large grain of salt. (ZakWilcox?: the UK situation is almost identical!)
What to do then? You are left with a motley collection of choices, few of which are ideal.
So what is that strange thing? Originally half-bridge was a nickname given to routers that function as proxy ARP hosts, with the same IP on both interfaces. Essentially you get bridge-like functionality (think transparent bridge) but packets are actually routed, not bridged - with all the consequences of such scenario. With modern Linux and BSD systems, you can actually see layer 2 packets in iptables/arptables (Linux) or pf (BSD).
But in our case, half-bridge has the proxy ARP flag set only on the LAN interface, and doesn't assign any IP address, besides local management one on the LAN side. The idea behind this whole trick is to present your first downstream router with the single external IP assigned to you by the ISP, and turn routing modem into half-bridge of sorts.
Your modem gets configured in the following way:
So what happens at your first downstream router? There are a various behaviours:
As you can guess, the renewal time in such scenarios is very short - so the public IP changes can be found relatively quickly. E.g. my DM111P gives lease for 5 minutes, without explicit renewal or rebind times - which are chosen appropriately by my DHCP client (150 and 262 respectively). Both with dhcpcd and dhclient you can supply custom scripts which can act and e.g. send signals to daemons to notify them about ip change. If you have modem giving router address outside the public IP's netmask - fix that as well.
Windows doesn't seem to mind the gateway being in a different subnet, but Linux does.
"... the reason is that the router issues a DHCP lease with a default route outside of the IP/Netmask of the interface. Eg: DHCP issues IP=202.36.240.10/255.255.255.0 and a Gateway address of 202.36.1.1 Windows happily handles this (as you've noted). Linux's routing tables don't off the cuff. The solution is to create a static host route to the gateway, then set it as the default route. eg:
route add -host 202.36.1.1 dev eth0
route add default gw 202.36.1.1 dev eth0
I believe a couple of years ago I posted on this, and provided a patch to "pump" (dhcp client) which did exactly this (there is no harm if the gateway IS on the same subnet).
This effect by the way, not only affects Linux, but also Cisco routers, and Packeteers. Again, the work around (adding a manual host route) works with this equipment, but the cavet is that if the ISP changes their routers IP address (which can, and DOES, happen), then your manual routes fail.
As for the whole thing being a kludge, no kidding. As I understand, pretty much everywhere else in the world, everyone issues at least 2 IP addresses. One for your DSL router, and one for your PC. We had a team from the UK over here for a client, and they were stunned how our ADSL service worked (or rather, didn't).
If someone does find a reputable, current, available in NZ with Telepermit, in stock (and predicted to be for awhile) router that does a PPPoE to PPPoA bridge, then I'd be very interested."
(source www.linux.net.nz/pipermail/nzlug/2008-April/012586.html)
"With linux based routers, the fix is to insert a static route to the "gateway" IP into the route table, then use that gateway IP as the default eg ifconfig eth0 <public IP> netmask 255.255.255.255 route add -host <gateway IP> dev eth0 route add default gw <gateway IP>
Now, the gateway IP can be any IP (except the public IP) for which there is an IP interface on the LAN side of the modem. All you want is for the WAN interface to arp for the "gateway", which will be the mac address of the LAN side of the modem. If you try the above code without the static route, Linux complains that the gateway is not on the <public IP>/32 net - which it isn't - but the static route fixes it. This is my understanding why some routers won't work with half bridge, as when the DHCP client on the router WAN interface gets the parameters from the DHCP server on the LAN side of the modem, the networking code tries to insert the default GW without the static route, and fails. It is this router DHCP behavior that makes half bridge modem setups dodgy.
BTW, with a half bridge and Linux based routers, you don't have to use a DHCP client on the WAN interface, you can set it up manually as above, with the absolute proviso that your public IP is static. The DNS issue can be worked around, at least with speedtouch modems, by setting the modem's config address as the DNS server address for your local net. If you set the "<gateway IP>" to be the config address, eg 10.0.0.138 for speedtouch modems, your LAN side PC's can have their DNS server address set to this value, and will be able to route through the Linux router to the modem."
(source:www.whirlpool.net.au/forum-replies-archive.cfm/806160.html)
So it doesn't really matter which actual IP you use for the static route so long as it's in the same subnet. In my case today:
route add -host 118.90.11.129 dev eth1 #eth1 is the linux routers WAN
route add default gw 118.90.11.129 dev eth1
You might need to manually reconnect the PPP link on the modem at this point to kick it back into life.
After the WAN IP changes it doesn't matter that the gateway is no longer 118.90.11.129, its just to give arp an idea where to start looking.
Also I can still get into the modems web config area from the LAN on the other side of the the Linux router. To do this you need to alter the modem's web page access port to say 81, and access it at {address}:81. Otherwise you wont be able to get into it, because there are too many web servers.
eg: browsing to 192.168.1.254:81 from my workstation at 192.168.0.200, via the Linux router at 192.168.0.1 LAN/(192.168.1.1 WAN) to 192.168.1.254:81
The following ADSL2 modems are reported to have a better-than-average half bridge implementation:
As of Feb 08 firmware this is now reported to work. See http://www.geekzone.co.nz/forums.asp?ForumId=49&TopicId=19132
PCI modems get around the bridge problem altogether by using a PPP interface in the router. However historically PCI DSL modems have had little or no driver support, and reportedly lower performance on bad lines.
The following are older ADSL1 modems that have better-than-average half bridge implementations. At least people have reported success with them. They may get you going for now but not a long term solution with ADSL2.
A better alternative solution is to use PPTP passthrough of a PPPoA connection. This means the router establishes the connection via PPTP using the modem. This means the router receives the public IP, has no MTU problems and is the one responsibile for establishing the PPP connection to your ISP. This is supported by a few modems available in New Zealand - specifically:
My experience with m0n0wall (yes not Linux) is that both of these with PPTP passthrough work well
There is also another good alternative solution:
The Vigor 110 is not currently available in NZ. The DV2700e is, but is a modem/router. Their website states that these products contain a true PPPoE-PPPoA bridge, and customer feedback confirms this to be so. The Draytek 120 is expected to be available here in November 2008. See also Draytek Vigor.
2 pages link to Half bridge with PPPoA: