1# LIC: GPL 2 3$Id$ 4 5This package lets you connect a Linux machine to an ISP that uses PPPoE. 6PPPoE is used by many DSL providers and some wireless providers. 7 8Follow these steps and you should have your PPPoE service up and running. 9 100. Install the rp-pppoe-software 11-------------------------------- 12 13You should have already done this by the time you're reading this. If not, 14go back and read README. 15 161. Set up your Ethernet hardware 17-------------------------------- 18 19First, make sure the Ethernet card you intend to use with the modem is 20visible to the Linux kernel. Just how to do this is beyond the scope 21of this document. However, if the card is the only Ethernet card in 22the system, executing: 23 24 ifconfig eth0 25 26should display something like this: 27 28 eth0 Link encap:Ethernet HWaddr 00:60:67:62:31:D4 29 30plust some more lines. Your HWaddr will be different. As long as you see 31the HWaddr line, your card should be working. 32 33DO NOT assign an IP address to the Ethernet card. DO NOT configure the 34card to come up at boot time. 35 362. Configure various files 37-------------------------- 38 39Several files need editing. The easiest way to do this is to run 40the following command as root: 41 42 pppoe-setup 43 44Answer the questions and you should be all set. If you want to know what 45goes on behind the scenes, continue reading this document. If you don't 46care and your connection works, stop reading. :-) 47 483. Edit pap-secrets 49------------------- 50 51Edit the "pap-secrets" file, inserting your proper user-ID and password. 52Install the file (or copy the relevant lines) to /etc/ppp/pap-secrets. 53Your ISP may use CHAP authentication. In this case, add the line to 54/etc/ppp/chap-secrets. 55 564. Edit /etc/ppp/pppoe.conf 57----------------------------- 58 59The file /etc/ppp/pppoe.conf contains configuration information for the 60DSL connection. You need to edit the following items: 61 62- Change ETH=eth1 to the correct Ethernet device for your modem. 63- Change USER=bxxxnxnx@sympatico.ca to your proper DSL user-ID. 64 65Don't edit any of the other settings unless you're an expert. 66 675. Set up DNS 68------------- 69 70If you are using DNS servers supplied by your ISP, edit the file 71/etc/resolv.conf to contain these lines: 72 73 nameserver ip_addr_of_first_dns_server 74 nameserver ip_addr_of_second_dns_server 75 76For example: 77 78 nameserver 204.101.251.1 79 nameserver 204.101.251.2 80 81 826. Firewall your machine 83------------------------ 84 85MAKE SURE YOU FIREWALL YOUR MACHINE. A sample firewall script is given 86in the shell script "firewall" To install the script: 87 88a) Copy it to /etc/rc.d/init.d/firewall 89b) Type: chkconfig firewall on 90c) Start the firewall: sh /etc/rc.d/init.d/firewall start 91 92(The above procedure works ONLY on Red Hat-like systems.) 93 94You may want to tweak the script somewhat. 95 967. Bring up the connection at boot time 97--------------------------------------- 98 99On a Red Hat system, the installation procedure should have installed 100a script called /etc/rc.d/init.d/pppoe. To bring up the connection 101at boot time, just type this command as root: 102 103 chkconfig --add pppoe 104 105On non-Red-Hat systems, add this line to the end 106of /etc/rc.d/rc.local: 107 108 /usr/sbin/pppoe-start 109 1108. Configure LAN Hosts 111---------------------- 112 113If you have a LAN behind the firewall, you have to lower the TCP 114maximum segment size from the normal 1460 to 1452 (or better, 1412.) 115You have two options: Either set the MTU of all the interfaces on 116other hosts on the LAN to 1452, or use the "-m 1412" option to pppoe. 117The "-m" option for pppoe is far simpler and makes it easier to add 118hosts to the LAN, but consumes some extra CPU time. 119 120If you want to manually configure the LAN hosts, here's how: 121 122In Linux, use: "ifconfig eth0 mtu 1452". For best results, put this 123in an /etc/rc.d/rc.local script. 124 125For Windows, machines, see http://lan.cns.ksu.edu/OS/WIN95/slip95.htm. 126Set the MaxMTU to 1452. 127 1289. Commands to control the PPPoE link 129------------------------------------- 130 131As root, bring up the link by typing: pppoe-start 132As root, bring down the link by typing: pppoe-stop 133 134That's it! 135 136-- 137David F. Skoll <dfs@roaringpenguin.com> | Roaring Penguin Software Inc. 138http://www.roaringpenguin.com | 139 140PROBLEMS! DAVE, IT DOESN'T WORK! 141--------------------------------- 142 143Here are some problems PPPoE users have encountered. 144 145----------------------------------------------------------------------------- 146A) Can't see the Ethernet interface 147 148Well, I can't really help you here. To use these instructions, you must 149have Linux working to the point where it recognizes your Ethernet card. 150If you type "ifconfig ethx" and you get back a HWAddr value, your Ethernet 151card is probably OK. But I really can't help with hardware configuration 152issues. 153 154----------------------------------------------------------------------------- 155B) Connection seems to come up, but I can't browse the web or ping anything 156 157You probably don't have DNS set up. See step 6. 158 159----------------------------------------------------------------------------- 160C) Can't compile PPPoE 161 162Make sure you have "make", the C compiler and all development header 163files installed. I only test rp-pppoe on Linux. It might not work on 164*BSD and probably won't work on any other version of UNIX. 165 166----------------------------------------------------------------------------- 167D) pppd complains about (i) "unknown option pty" or (ii) "pty option precludes 168 specifying device name" 169 170(i) Your pppd is too old. You need at least 2.3.7. 171(ii) Your /etc/ppp/options file is not empty. Empty it! 172 173----------------------------------------------------------------------------- 174E) pppoe dies with the log message "Message too long" 175 176You set the MTU of the Ethernet interface connected to the DSL modem 177to less than 1500. Don't do that. 178 179----------------------------------------------------------------------------- 180F) Internal hosts can't see the Internet 181 182Do you have masquerading set up? I can't help you in great detail, but 183see the IPCHAINS-HOWTO and the IP-Masquerade mini-HOWTO. 184 185----------------------------------------------------------------------------- 186G) Authentication fails 187 188Make sure you have the right secret in /etc/ppp/pap-secrets. Your ISP 189may be using CHAP; it won't hurt to copy the line to /etc/ppp/chap-secrets. 190 191Also, MAKE SURE that /etc/ppp/options is EMPTY. The "pppoe-connect" script 192supplies all required options on the command line; additional options 193in /etc/ppp/options may mess things up. 194 195----------------------------------------------------------------------------- 196H) VPN software does not work 197 198If you are using VPN software on a Windows or Linux machine with another 199Linux machine running PPPoE as the gateway, you MUST NOT use the "-m" option 200to pppoe. This alters IP packets, which will break any VPN which uses IPSec. 201In /etc/ppp/pppoe.conf, set CLAMPMSS to "no". You'll also have to reduce 202the MTU on the hosts behind the gateway to 1452. 203 204----------------------------------------------------------------------------- 205I) I can browse some web sites just fine, but others stall forever. 206 207There is probably a buggy router or firewall between you and the Web server. 208One possible workaround: In /etc/ppp/pppoe.conf, find the line which reads: 209 210 CLAMPMSS=1412 211 212Try lowering the 1412 until it works (go down in steps of 100 or so.) Each 213time you lower the value, you have to restart your connection like this: 214 215 pppoe-stop; pppoe-start 216 217This should work around buggy routers which do not support Path MTU discovery. 218 219----------------------------------------------------------------------------- 220J) Whenever I connect using DSL, my internal LAN no longer sees the gateway 221 222You are more than likely running a 2.0.X Linux kernel. To solve this 223problem, give the Ethernet card connected to the DSL modem a fake IP 224address. For example, if eth0 is your internal LAN card and eth1 goes to 225the DSL modem, do something like this: 226 227 ifconfig eth1 10.0.0.1 netmask 255.255.255.0 228 229(You may have to choose a different IP address; experiment.) 230----------------------------------------------------------------------------- 231K) How can I run a script every time I connect and get a new IP address? 232 233Put the script in /etc/ppp/ip-up. See the pppd(8) man page. 234----------------------------------------------------------------------------- 235L) Nothing works! 236 237You may need to put your Ethernet card in half-duplex, 10Mb/s mode to 238work with the DSL modem. You may have to run a DOS program to do this, 239or pass special parameters to the Linux driver. 240 241Some providers object to attempts to set the MRU or MTU. Try removing 242"mtu 1492 mru 1492" from PPP_STD_OPTIONS in the pppoe-connect script. 243This problem has been seen with an ISP in Hong Kong. 244 245Your DSL provider may be using non-standard PPPoE frames or require 246something special in the Service-Name field. If you have two computers, 247you can try sniffing out these values with the "pppoe-sniff" program. 248Type "man pppoe-sniff" for details. If you don't have two computers, 249you'll have to ask your DSL provider if it uses non-standard PPPoE frames 250or special Service-Name fields. Good luck getting an answer... 251 252If pppoe-sniff indicates that nothing is amiss, make sure the Ethernet 253card associated with the DSL modem does NOT have a valid IP address. 254(NOTE: For 2.0 kernels, you may have to give it a fake IP address 255which is not on your internal subnet. Something like 192.168.42.42 256might work if you are not using 192.168.42.*) 257 258If you are using synchronous PPP on a slow machine, try switching to 259asynchronous PPP. 260 261Make sure no entries in the routing table go through the Ethernet card 262connected to the DSL modem. You might want to add these lines in 263pppoe-connect: 264 265 ifconfig ethx down 266 ifconfig ethx up mtu 1500 267 268which should reset things to sane values. 269