DragonflyBSD as router with PPPoE external connection

Hi guys,

Recently I've migrated my home router from Arch to DragonflyBSD. I'm gonna explain the steps, which will allow you to make an existing DFBSD install into router, specially using pppoe conn for external wan.

So , lets assume we have an already installed DfBSD box, with bge0 as lan interface, and fxp0 as external, wan net interface. Also we have a pppoe acc, with username/password, and servicename=servicename.

First, we need to setup the internal, lan interface, aka bge0. We put these lines into the /etc/rc.conf file:

ifconfig_bge0="inet 172.16.1.1 netmask 255.255.255.0"

Here I chose the 172.16.1.1 as ip address, but if you need some other subnet, you can easilly change that ;-).

Then for the box to behave as router/no matter what kind of external wan we are using/, we need to add this again in /etc/rc.local file:

gateway_enable="YES"

Now, the pppoe connection. Open /etc/ppp/ppp.conf with your favourite editor, and modify the following to your needs:

default:
    set log Phase tun command
    set ifaddr 10.0.0.1/0 10.0.0.2/0

inet:
    set device PPPoE:fxp0:inet
     set authname username
     set authkey password
    set dial
    set login
    add default HISADDR

Where fxp0 is the name of the external wan port, which we gonna use for the dialing, inet is the actuall servicename , if you have one. If you dont have servicename defined by your ISP, then remove :inet from that line, use only "set device PPPoE:fxp0". Username and password are self explanatory I think ;-) .

Starting everything can be made by hand, using 'ppp -ddial inet', or using that in /etc/rc.conf:

ppp_enable="YES"
ppp_mode="ddial"
ppp_nat="YES"
ppp_profile="inet"

Hope that I helped. Enjoy!

Сподели с приятел: Сподели в Twitter