Jump to content

This is the support site for Andrews & Arnold Ltd, a UK Internet provider. Information on these pages is generally for our customers but may be useful to others, enjoy!

Router:Linux: Difference between revisions

2,539 bytes added ,  22 January 2013
Incorporated text from AA-Asterisk wiki
(Incorporated text from AA-Asterisk wiki)
== The Basics ==
 
You can use a Linux box in place of a PPPoE-capable router. Why would you want to do this?
 
* You're already running a Linux box, and you don't see any point in powering a router as well
* You want fine control over packets
* You have a PPPoE router but it doesn't do everything you want
 
== Debian/squeeze ==
 
This is what RogerBW is using. It'll probably be much the same on other Linuxen. The basic recipe came from [http://www.aa-asterisk.org.uk/index.php/Connecting_to_AAISP_using_PPPoE].
 
You will have two ethernet interfaces - one for your internal network (let's assume that's eth1), one for connection to the BT modem (eth0). You will be running PPPoE over the external interface, creating a new interface that actually passes packets.
 
=== Setup ===
 
* Install ppp, pppoe and iproute.
 
* Edit /etc/ppp/peers/aaisp to include:
 
<pre>
user mylogin@a.1 <----- your AAISP login
plugin rp-pppoe.so
eth0 <----- The ethernet interface to run PPPoE on
noipdefault
defaultroute
#usepeerdns <----- uncomment this if you want resolv.conf to be set up automatically
hide-password
lcp-echo-interval 1 <---- this is how often the LCP echo packets get sent to AAISP, in seconds.
lcp-echo-failure 10 <---- this is how many LCP echo failures before the ppp daemon quits
connect /bin/true
noauth
persist
maxfail 0 <---- redial forever until your modem regains sync else default is 10x or N times if you enter N
#holdoff 120 <---- this will cause pppd to dial once every 2 mins else default is 0 sec
mtu 1492
noaccomp
default-asyncmap
+ipv6
ipv6cp-use-ipaddr
</pre>
 
* Edit /etc/ppp/chap-secrets to include this line, consisting of three tab-separated words. The first entry is your AAISP router login, the second is an asterisk, and the third is your AAISP router password. For example:
 
<pre>
mylogin@a.1 * pa$$w0rd
</pre>
 
* Create /etc/ppp/ipv6-up.d/0000defaultroute. In it place the following shell script:
 
<pre>
#!/bin/bash
/sbin/ip -6 route add default dev $1
</pre>
 
* chmod it 755.
 
=== Testing ===
 
Run as root: pppoe -A
 
This should show something like this:
 
<pre>Access-Concentrator: BT_ADSL
Got a cookie: 6e c5 4a dd 1e c0 d6 b6 fe b4 4b 23 38 8f 63 58
AC-Ethernet-Address: 00:90:1a:40:f2:9f
--------------------------------------------------
</pre>
 
To start your PPPoE session just type
<pre>pon aaisp</pre>
and to stop it running
<pre>poff aaisp</pre>
 
You can check connectivity with a cron job, and add a stanza to /etc/network/interfaces to connect at boot.
 
== PPP ==
 
4

edits