Set up pppoe server on Ubuntu

Source: Internet
Author: User

 

I. Installing pppoe server software
1) sudo apt-Get install PPP
2) RP-pppoe (non-apt suite)
Http://easylinux.info/uploads/rp-pppoe-3.6.tar.gz wget-C
Sudo tarzxvf rp-pppoe-3.6.tar.gz-C/opt/
Sudo chown-r root: Root/opt/rp-pppoe-3.6/
3) The security software development letter shows:
Sudo apt-Get install libc6-dev
4) generate the required pppoe server program
Sudo/opt/rp-pppoe-3.6/go 2. Configuration:
Sudo gedit/etc/PPP/options is to enable the functions in/etc/PPP/options (remove the previous)
MS-DNS 172.16.100.2 MS-DNS 172.16.100.4 (these two are set for the primary DNS and the secondary DNS)-Pap (this is to disable the PAP authentication method)
+ Chap (CHAP authentication is enabled)
The details are not detailed. add your own sense configuration according to the description of the file. 3. Add User:
Sudo gedit/etc/PPP/chap-secrets is used to edit the user name and password as follows. ############################## Secrets for authentication using chap
# Client server secret IP addresses
Name * "passwd" * ############################## 4. Enable forward: Echo "1" type = "codeph" text = "codeph">/proc/sys/NET/IPv4/ip_forward. Note: This command must be executed as root, and sudo is useless. Otherwise, the system prompts that the permission is insufficient. If forward is not enabled, even if the client obtains the IP address, traffic cannot go out and can only go to the server.

Or change it like this.
Modify the/etc/sysctl. conf file: net. ipv4.ip _ forward = 1. Enable the forwarding function.
Execute the following command to make the configuration take effect immediately
[Root @ localhost root] # sysctl-P

Ubuntu cannot directly use the root account by default. If the root account has not set a password, you only need to use sudo passwd root to set a password for the root account, and then you can log on as the root account. 5. Start pppoe server: sudo pppoe-server-I eth0-l 192.168.5.1-r 192.168.5.5-N 10, obtain the pppoe address information as follows-I eth0 specifies the connection request that the pppoe server listens to on that Nic Interface
-L 192.168.5.1: Specify the IP address of the pppoe server. (Note: This IP address is not the IP address of the network adapter, but the virtual IP address of the pppoe server) (this address can be arbitrary)
-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)
-C: used to specify your pppoe server host name (this parameter is optional)
-S: This option is used to mark a specific server to help the client system self-calibrate the pppoe server. The-s option is often used to ensure that certain customers are always connected to specific servers, especially when multiple pppoe servers exist on your network. The client software of pppoe protocol can be configured to only log on to the pppoe server with "Special Service name. If the server name specified by the client matches the name stated in the-s option service name, it is connected to the server.
-T: timeout (set to 60 seconds)
Sat. Disable the pppoe server killall pppoe-Server 7. Note 1: If the PAP verification method is used, pppoe dialing provided by Windows XP or above cannot be used. The possible cause is that pap uses the plaintext password for verification, while the password stored in Windows is encrypted and cannot be restored. Therefore, Windows cannot provide the plaintext password. 2. for/etc/PPP/pppoe-server-options and/etc/PPP/options, configuration can play a role in any file. Run the following command to test the password passwd in XP: username and password. Get the IP address 192.168.5.6, oh, yeah! 9. But XP cannot access the Internet after connecting to pppoe. It lacks a key step, remember to set filter and postrouting to use iptables rules iptables-A input-I eth0-s 192.168.5.0/24-J dropiptables-T Nat-A postrouting-s 192.168.5.0/24-J SNAT --- source 172.16.108.84ok, test and re-establish pppoe connection. You can access the Internet
Note:
1. When ifconfig is executed, you can see the IPv4 address of eth0. My address is 172.16.108.84.
Note that the pppoe address pool I set is 192.168.5.5 ~ 192.168.5.14
2. Therefore, the iptables-S parameter is 192.168.5.0/24.
Pay attention to the above two points to get the pppoe address and access the internet.
 
10 automatically enable pppoe server upon startup
The above section summarizes all the steps and key points in the configuration process,
1. Write them together to/etc/rc. Local to add the following command to the original file after starting pppoe Server:
Pppoe-server-I eth0-l 192.168.5.1-r 192.168.5.5-N 10

Iptables-A input-I eth0-s 192.168.5.0/24-J dropiptables-T Nat-A postrouting-s 192.168.5.0/24-J SNAT -- to-source 172.16.108.84 restart the system, then, you can see that the pppoe-server is up. Haha

2. Enable the IP forwarding function
Echo "1">/proc/sys/NET/IPv4/ip_forward
Or
Modify/etc/sysctl. conf

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.