# PPPOE on new router



## CrazyFingers (Mar 14, 2012)

Disclaimer: I've spent several days searching for an answer to this, with no luck.

Background: I am currently using a FreeBSD 7.3 box as the ADSL gateway for my home network.  This connects to an ADSL "modem" which is set to bridge mode.  This has worked perfectly for several years, connecting to my ISP on boot and performing PPPOE login, NAT, firewall, etc.

Relevant data for current gateway:

```
FreeBSD 7.3-RELEASE-p7
  Intel Pentium 4 Northwood 2.8GHz
  Abit IS7-E2 motherboard
  External interface: Intel 82558 Pro/100 Ethernet "fxp0"
  Internal interface: 3Com 3c905C-TX Fast Etherlink XL "xl0"
  PPPOE started from /etc/rc.conf:
    ppp_enable="YES"
    ppp_mode="ddial"
    ppp_nat="YES"
    ppp_profile="provider"
```

Current problem: I am trying to set up a new FreeBSD 9.0 box with slightly better hardware to replace this older gateway machine. No matter what settings I change on this new box, I cannot get PPPOE to connect on boot.  

Relevant data for new gateway:

```
FreeBSD 9.0-RELEASE
Intel Pentium 4 Northwood 2.8GHz
Intel D865GLC motherboard
External interface: Intel 82801BA (D865) Pro/100 VE Ethernet (embedded NIC) "fxp0"
Internal interface: Intel(R) PRO/1000 Legacy Network Connection 1.0.3 PCI "em0"
PPPOE started from /etc/rc.conf:
    ppp_enable="YES"
    ppp_mode="ddial"
    ppp_nat="YES"
    ppp_profile="CenturyLink"
```

When the new system boots, *ifconfig* shows that em0 is up with the configured internal IP, and fxp0 is up, but unconfigured.  Once the system has booted, I can log in as root and give:
`ppp -ddial CenturyLink`
which brings up tun0 (on fxp0) and performs network gateway functions correctly.  Obviously a gateway that does not bring up the PPPOE connection without manually entering the command is of limited value.  I have exhausted my knowledge and all the Google/FreeBSD forum resources I can find on this issue.  The primary differences I see between the working gateway and the non-working one are:

The old system is running FreeBSD 7.3 p7, the new system is running FreeBSD 9.0
The old system has two discrete PCI cards for interfaces, the new system uses the embedded motherboard NIC for its external interface.

I see no errors in dmesg.today or ppp.log on the new system that indicate problems initializing the PPPOE interface on boot. My last thought is to disable the integrated motherboard NIC on the new system and install a second discrete PCI NIC to use as the external interface, although I don't understand why the embedded motherboard NIC would be an issue.

Any assistance or suggestions with this issue would be greatly appreciated.


----------



## SirDice (Mar 14, 2012)

Here's mine:

```
#IPv4
ifconfig_rl0="DHCP"
ifconfig_rl1="inet 192.168.2.1  netmask 255.255.255.0"
gateway_enable="YES"

# PPP
ppp_enable="YES"
ppp_mode="ddial"
ppp_profile="xs4all"
ppp_nat="NO"
```

Never needed anything more than that. At the very least make sure your fxp0 is marked up.


----------



## CrazyFingers (Mar 14, 2012)

Thanks SirDice.

On the new gateway, fxp0 is up after it boots, it just doesn't bring up the tun0 PPPOE connection until I log in as root and give the console command.  What gets me is that setting up a FreeBSD box as a PPPOE gateway is usually such a simple process, at least it always has been on my 5.x, 6.x, and 7.x gateways.  Why this new 9.0 box is not connecting automatically on boot is puzzling me.


----------



## SirDice (Mar 14, 2012)

Ah, I just noticed my gateway is still running 8.x. There have been some changes in the rc(8) scripts. It's possible some of the variables changed between 8.x and 9.0.

Try setting rc_debug in /etc/rc.conf. That should produce more output during startup. Perhaps that'll give us a clue.


----------



## CrazyFingers (Mar 14, 2012)

Another option I was considering was to install 8.2-RELEASE-p6 on this new gateway.  Since the old 7.3 box is still working fine, there's no urgency on this new box, and I can re-install or re-configure whatever I need to get it functioning.  Of course, I'd like to get 9.0 working.
I'll try your rc_debug suggestion and see if that provides some better insight.


----------



## CrazyFingers (Mar 19, 2012)

As it often turns out, this was my mistake, or actually two of them.
First, the initial PPPOE connection problems were because I foolishly changed root's shell to bash.  This prevented ppp from reading or executing /etc/ppp/ppp.cfg until after login.
Once I changed root's shell back to sh, the PPPOE connection launched correctly on boot.  
The second issue was routing failed to work correctly after the PPPOE connection initially loaded, requiring a PPPOE disconnect/reconnect.  This was apparently related to having 
	
	



```
defaultrouter="10.0.0.250"
```
 explicitly declared in /etc/rc.conf.  Once I commented that line, the PPPOE connection loaded on boot and routed correctly with no further user interaction.

Long story short, I should not have changed root's shell or had a default router declared on this new FreeBSD 9.0-Release-p0 box.  In my feeble defense, neither of these issues caused any problems on the old 7.3-Release-p7 box, but everything is working perfectly now.


----------

