DSLpppoe server Construction

Source: Internet
Author: User

DSLpppoe server Construction

I. Main content:

Build your own pppoe server through the LAN, and the DSL router completes pppoe dial-up Internet access through the pppoe server.


Ii. Material preparation:

1. A computer installed with linux (ubuntu is used for testing)

2. a dslam Device

3. a DSL


3. Build Steps

3.1 Topology

The computer has dual-nic, eth0 is connected to DSLAN, and eth1 is connected to the router



3.2 server PPPOE Construction Process
3.2.1Install pppoe service software

1) install ppp
# Apt-get install ppp


2) download rp-ppp

# Wget-c http://www.roaringpenguin.com/files/download/rp-pppoe-3.10.tar.gz

3) decompress rp-ppp

# Sudo tarzxvf rp-pppoe-3.10.tar.gz-C/opt/

4) Change permissions
# Sudo chown-R root: root/opt/rp-pppoe-3.10/


5) install the required dependent libraries:
# Sudo apt-get install libc6-dev

6) generate the required pppoeserver Program
# Sudo/opt/rp-pppoe-3.6/go

In this process, enter the configuration as prompted to generate the configuration information required for the connection service.

User name: the User name for pppoe dialing

EthernetInterface: eth0 (must be the network adapter used to listen to the pppoe client connection request)

In addition, you need to set a dial-up password (not available)

>>> Please enter your PPPoE password:

>>> Please re-enter your PPPoE password:

Others can use the default value.

Note: Note the user name and password, because I don't need to use it in dsl later,


3.2.2. Configuration

1) set verification information
# Vim/etc/ppp/pppoe-server-options
# Use the chap authentication protocol. If the pap authentication protocol is used, this behavior is require-pap

2) download rp-ppp

# Wget-c http://www.roaringpenguin.com/files/download/rp-pppoe-3.10.tar.gz

3) set the authentication method and cancel the previous #

# Vim/etc/ppp/options

+ Chap

4) Add a user (that is, the identity of the user running on the server to connect to the server)
# Vim/etc/ppp/pap-secrets

# Client server secret IP addresses

"Test" * "123456 "*

Note: * indicates any user. the user with the user name test and password 123456 is set above.


3.2.3 start the PPPOE Service
# Pppoe-server-I eth0-L 172.160.1-R 172.160.210-N 20
-I eth0 specifies the NIC interface on which the pppoe server listens for connection requests.
-L 172.160.1 specifies the IP address of the pppoe server. (Note: This IP address is not the IP address of the NIC, but the virtual IP address of the PPPOE server. It has nothing to do with the eth0 address of the NIC. The actual Nic eth0 does not have an IP address)
-R 172.160.210: IP address assigned to the client by the pppoe server, starting from
-N 20: Maximum number of clients that can connect to the pppoe Server

3.2.4 DSL client settings
Go to the DSL network settings page


Enter the user name and password test/123456 we set above, and then save

3.2.5 set filter and postrouting
Here we will use the iptable tool in linux, which can be used to set up firewall and other network management. For detailed usage, refer to the official manual.

// Enable the forwarding function

# Echo "1">/proc/sys/net/ipv4/ip_forward

# Iptables-a input-I eth0-s 172.160.0/24-j DROP

# Iptables-t nat-APOSTROUTING-s 172.160.0/24-j SNAT -- to-source192.168.31.137

The first command above encapsulates all IP packets from the 172.160.x network segment

The second instruction: POSTROUTING refers to source address conversion. To convert your intranet address to a public address, the 172.160.x packet is forwarded to

Note: The 172.160.x network segment is set when the pppoe server is set in 3.2.3, while the ip address of eth1, and eth1 is connected to the public network, in this way, we can connect to the dsl client of eth0 and forward the data to eth1 through iptable processing to implement the pppoe dial-up and Internet access function.

3.2.6. Verification

Go to the DSL router wan status bar and check the pppoe connection status. The dial is successful !!!


Connect a computer to the dsl lan to access the internet !!!


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.