Azmawee 127.0.0.1

"Mauiwagen. Das Server." – pub 4096R/712DAA69

MPD5 – FreeBSD singlelink or multilink PPP daemon

What is mpd5 ? here is the description/info of mpd5 taken from pkg-descr file in freebsd port tree (/usr/ports/net/mpd5).

 

— file start–

Mpd is a netgraph(4) based implementation of the multi-link PPP

protocol for FreeBSD. It is designed to be both fast and flexible.

It handles configuration and negotiation in user land, while routing

all data packets strictly in the kernel. It supports several of

the numerous PPP sub-protocols and extensions, such as:

 

Multi-link PPP capability

PAP, CHAP, MS-CHAP and EAP authentication

PPP compression and encryption

IPCP and IPV6CP parameter negotiation

 

Mpd have support for many link types:

 

Serial port modem

Point-to-Point Tunnelling Protocol (PPTP)

Layer Two Tunnelling Protocol (L2TP)

PPP over Ethernet (PPPoE)

PPP over TCP

PPP over UDP

PPP over specified netgraph(4) node

 

Mpd also includes many additional features:

 

IPv4 and IPv6 support

RADIUS authentication and accounting

NetFlow traffic accounting

Network address translation (NAT)

Dial-on-demand with idle timeout

Multiple active connections running simultaneously

Dynamic demand based link management (also known as “rubber bandwidth”)

Powerful chat scripting language for asynchronous serial ports

Pre-tested chat scripts for several common modems and ISDN TAs

Clean device-type independent design

Comprehensive logging

Telnet and HTTP control interfaces.

— file end —

 

Basically mpd5 is another ppp dialer for FreeBSD and it have much more features then the default FreeBSD ppp.

 

Ok let’s get on and roll out… this time you wont need your 32GB china brand mp3/mp4 player, I tell you why later :p

 

First of all, install the mpd5 from the ports tree or from pkg_add, mind you all, we will still need to use the default freebsd ppp to connect to the internet for this step :p

 

cd /usr/ports/net/mpd5

make clean install

 

or from pkg_add command.

 

pkg_add -r mpd5

 

While waiting, it’s time for a good comic books reading, or just read some online manga at mangareader dot net, put away your 32GB china brand mp3/mp4 player, it’s not healthy for you, same goes for manga reading.. but… what the heck.. I’m very curious to find what happen to Luffy, Ichigo, Naruto, Ashigori-kun and others. :P

 

OK next, to setup and configure the mpd5, head to this directory,

 

cd /usr/local/etc/mpd5

 

and create mpd.conf

 

touch mpd.conf

 

This is a sample of mpd.conf that I used.

 

# — file start —

# MaUi^ : mauix (5th Oct 2010) http://staff.MyBSD.org.my/maui (staff.MyBSD.org.my/maui)

Config file for mpd5, mpd.conf

# This file should be in put /usr/local/etc/mpd5

# IMPORTANT! every line IN A LABEL (label:) should start with a space!!

# word “#” infront of the line tells mpd5 not to read that line

# to start dialing, start mpd5 rc script, sh /usr/local/etc/rc.d/mpd5 start

 

startup:

 # configure users for console and web login

 set user username password

 # configure the console (any if ip/port)

 set console self 127.0.0.1 5005

 set console open

 # configure the web server (any if ip/port)

 set web self 192.168.1.254 5006

 set web open

 

default:

 load mypppoe

 

mypppoe:

 create bundle static B1

 set iface route default

 set iface enable nat

 set iface enable tcpmssfix

 set iface up-script /usr/local/etc/mpd5/ip-up.sh

 set iface down-script /usr/local/etc/mpd5/ip-down.sh

 set ipcp ranges 0.0.0.0/0 0.0.0.0/0

 set ipcp disable vjcomp

 set bundle enable compression

 set ccp yes deflate mppc

 set mppc yes compress

 set mppc no e40 e56

 set mppc yes e128

 set mppc yes stateless

 set mppc disable policy

 create link static L1 pppoe

 set link action bundle B1

 set auth authname “celakalu@streamyx”

 set auth password “dogfather”

 set link max-redial 0

 set link mtu 1492

 set link mru 1492

 set link keep-alive 10 60

 set link disable acfcomp

 set link disable protocomp

 set pppoe iface xl0

 set pppoe service “”

 log +echo

 open

 

# — file end–

 

You can use the above setting or fetch the file from http://azmawee.pbworks.com/f/mpd.mauix.conf.txt and rename it to mpd.conf, if you have a task or script to perform on every connection up or connection down, you can configure it under “set iface up-script” and  “set iface down-script” in mpd.conf file.

 

fetch  http://azmawee.pbworks.com/f/mpd.mauix.conf.txt

 

You will need to edit your username and password for web/console and for ISP auth, and put the correct pppoe iface nic name. Try around which are the best setting for you with the enable or disable vjcomp, acfcomp, protocomp, compression, deflate, and mppc options.

 

Finally you can test the config by dialing it manually, disconnected the internet from default ppp first, and just run mpd5 command from prompt. It should be working if you see something like this:

 

Oct 6 15:02:45 server mpd: [B1] IPCP: LayerUp

Oct 6 15:02:45 server mpd: [B1] 115.134.68.197 -> 219.93.218.177

Oct 6 15:02:45 server mpd: [B1] IFACE: Up event

 

It’s getting external ip and connected to the internet, now exit the testing. The “mpd5 -b” command will start mpd5 in background process, but it would be better to start mpd5 by it’s rc script, as it will create a proper pid file. You need to edit /etc/rc.conf before you can use the script.

 

Put these 2 lines in your /etc/rc.conf file

 

mpd_enable=”YES”

mpd_flags=”-b”

 

Start the mpd5 from the rc script.

 

sh /usr/local/etc/rc.d/mpd5 start

 

ng0 interface will be created for internet connection., so if you have firewalls or redirection rules, you might want to edit the connection interface in your rules. The default mpd5 rc script will be started on every startup of the server, if you don’t want this, just set mpd_enable=”NO” in your /etc/rc.conf or chmod 644 to the script file and it will not run on startup anymore.

 

mpd5 also logging the logs to system log and it also have console and web interface for you to check the details of the connection. From the sample config above, I set mine to use http://192.168.1.254:5006 (192.168.1.254:5006) for the web interface.

 

Thats’s all, and maybe if mangareader dot net down again, I will post the config for the multilink ppp connection, say 2 or 3 broadband connection on the sametime? :)

 

Now back to manga business…. – mauix. :D

, , , , , , , , , , , , , , , , , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Azmawee 127.0.0.1
MaUi^ - pub 4096R/712DAA69
Fingerprint 8BF7 D0AF CA45 5313 A3BF ACFB B90B 66C7 712D AA69
Website Security Test
0110010101100001011100110111010001100101011100100010000001100101011001110110011100100000011011100110111100101110001000000011000000110110