# HOWTO Connect your FreeBSD gateway to Telefonica/Moviestar fiber/dsl over pppoe



## blodan (Jun 12, 2013)

So I've spent a few hours to figure this one out, finally I found a blogpost how to get it going with a Cisco router so I bruteforced the configuration over to my FreeBSD gateway 

em0 in this case is the network card I have connected to the Telefonica/Moviestar modem.

The traffic from Telefonica/Moviestar is tagged so we have to create a VLAN interface
`ifconfig vlan0 create`

Assign the vlan0 interface to the network card connected to the modem and listen for traffic tagged with id 6
`ifconfig vlan0 vlan 6 vlandev em0`

Install the PPPoE daemon
`cd /usr/ports/net/mpd5`
`make install clean`

Change the mpd5 config
`nano /usr/local/etc/mpd5/mpd.conf`

Replace the whole config with this:

```
infinity:
  create bundle static B1
  set iface name tun0
  set iface enable tcpmssfix
  set iface route default
  set ipcp ranges 0.0.0.0/0 0.0.0.0/0
  create link static L1 pppoe
  set link action bundle B1
  set auth authname adslppp@telefonicanetpa
  set auth password adslppp
  set link max-redial 0
  set link mtu 1492
  set link mru 1492
  set link keep-alive 10 60
  set pppoe iface vlan0
  set pppoe service ""
  open
default:
  load infinity
```

The authname and password is the same for all Telefonica/Moviestar customers so you would probably not need to change that.

Now start the pppoe daemon
`/usr/local/etc/rc.d/mpd5 onestart`

Give it a few seconds and you should now have received an IP on the tun0 interface if you run ifconfig(8). Other than that, change all your firewall rules etc. to use the tun0 interface instead of the network card and everything else works as normal.

If you want this setup to autostart on boot, insert this into /etc/rc.conf:

```
ifconfig_em0="up"
cloned_interfaces="vlan0"
ifconfig_vlan0="vlan 6 vlandev em0"

mpd_enable="YES"
```


----------



## overmind (Jun 12, 2013)

Your Telefonica modem is configured as a bridge?


----------



## blodan (Jun 13, 2013)

That I don't know, I can't access it.

I received it when they installed the fibre cable to our office and I have no access to the modem itself, only the router they included which *I* managed to get the authname and password from when *I* downloaded a backup of the configuration.


----------



## overmind (Jun 17, 2013)

From what I know Telefonica offers a router with an ADSL modem embeded into i_t_. If you have a PC with dual network cards how do you connect it (hardware) with their ADSL line?

Did you use a USB ADSL Modem? If yes, what type is it?


----------



## blodan (Jul 13, 2013)

Sorry for the late reply.

I set this up in our Spanish office so I donÂ´t have access to the model of the modem, all I know is that it's a white modem that has Movistar on it with a fibre cable connected to it.

Here's a picture of it:


----------

