Build a pppoe Simulation Environment

Source: Internet
Author: User
Tags stop script

During this time, it was quite painful for me to test the OTT box pppoe by myself, either by testing on another person's location or by using the pppoe device, I think it would be nice to build a pppoe real dial-up Internet environment! However, the pppoe service software cannot be found in the terminal win7, And the pppoe environment built by XP on the public machine cannot be verified without dual NICs. Finally, we will build an environment on our laptop (win7) Dual-nic (Wireless and wired) machine for the experiment (smart you can also use any dual-nic machine ).

I will give you a brief introduction.

Build main tools: virtualbox, unbuntu12.04ios

Build main software: RP-ppoe, iptables

 

Reference:

Http://blog.chinaunix.net/uid-9525959-id-4008338.html

Http://fp-moon.iteye.com/blog/1756466

Http://askubuntu.com/questions/161551/how-to-start-stop-iptables-in-ubuntu-12-04

Https://help.ubuntu.com/community/IptablesHowTo

 

1.1 Virtual Machine Construction

 



After the virtualbox virtual machine is installed, follow the prompts to install ubuntu12.04 64bits. Because our machine only needs to verify pppoe to the lowest extent, try to make sure that the hard disk is small enough, and mine is 8 GB.

 

The most important step for a VM is to configure the nic and network mode!

 

1.2 Software Configuration

RP-pppoe Link: Https://github.com/sammaple/?pppoe-3.11download usage (rp-pppoe-3.6 version is too low, there will be problems, it is recommended to use the latest version)

Steps:

1. sudo apt-Get installppp

2. Decompress RP-pppoe

3, sudo chown-rroot: Root/XX/rp-pppoe-3.11-master/

4. sudo apt-Get installlibc6-dev

5, sudo/XX/rp-pppoe-3.11-master/go (configure, make, make install one-stop script)

 

PS:It is best to comment out the last sentence of the Go script. This is the configuration of the client.

Comment out the sentence # Sh ../scripts/pppoe-Setup

 

6. After the installation is complete, you can run whereispppoe-server to check whether the installation is successful. /Usr/sbin/pppoe-Server

7. Configure the pap-secrets and pppoe-server-options files.

 

Paste the pap-secrets content directly:

Jhy *(The first jhy is the user name used for dialing, and the second jhy is the dialing password)

 

Directly paste the pppoe-server-options content:

# PPP options for the pppoe Server

# LIC: GPL

Require-pap

# Login

Lcp-echo-interval10

Lcp-echo-failure2

MS-DNS xx. xx

# This DNS is subject to your actual network


8. Start the pppoeserver service.

 

Sudopppoe-server-I eth1-l 192.168.5.1-r 192.168.5.5-N 10

 

The pppoe address information is as follows:

-I eth1 specifies the NIC interface on which the pppoe server listens for connection requests (the eth1 we set in the VM is a wired Nic );
-L 192.168.5.1: Specify 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) (this address can be any one );
-R 192.168.5.5: the IP address assigned to the client by the pppoe server from 192.168.5.5;
-N 10 specifies the maximum number of clients that can connect to the pppoe server (the default value is 64, and the maximum value is 65534 );

 

 

9. Client pppoe dialing

Connect the box terminal to the wired network port of the notebook, and enter the user name and password corresponding to Step 1 to complete dialing.

 

1.3 dial-up Internet sharing

Define port forwarding rules using iptabes in virtual machines

 

Pppoe data discarded on eth1

Iptables-A input-I eth1-s 192.168.5.0/24-J Drop

 

Forward data on pppoe to an eth0 wireless network card that can be connected to the Internet:
Iptables-T Nat-A postrouting-s192.168.5.0/24-O eth0-J Masquerade

 

Iptables-saveSave routing rules

 

Modprobeip_tablesRestart the iptables service (note that Ubuntu does not register iptables as a service, so serviceiptables restart stop and other commands cannot be used)

 

Enable IP ForwardingEcho "1">/proc/sys/NET/IPv4/ip_forward

 

Conclusion 1.4

Easy to get rid of baggage


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.