Pppoe server configuration in Linux

Source: Internet
Author: User
Finally, I understood the principles of using pppoe + NAT as an Internet server.

RP-pppoe settings
:

CheckRppppoeInstalled (RedflagInstalled)

Rpm - QA | Grep - I " Pppoe "


/Etc/PPP/PAP-secretsThe configuration is as follows::

# Client Server secret IP Address
" USR "   *   " 123 "   *

/etc/PPP/chap-secrets Configuration and Pap-secrets same

/Etc/PPP/Pppoe-Server-OptionsThe configuration is as follows::

# Auth # comment out the three lines and use any account to log on
# Require-pap
# Require-Chap
Login
LCP - Echo - Interval 30
LCP - Echo - Failure 4
MS - DNS 202.118 . 224.101

Then run:

Modprobe pppoe
Pppoe - Server - I eth1 - N 200   - L 192.168 . 0.1   - R 192.168 . 0.100   - R - U

Iptables settings:

OpenIPForwarding and Nat Functions

Echo 1   >   / Proc / Sys / Net / IPv4 / Ip_forward
Iptables - T Nat - F
Iptables - T Nat - L
Iptables - T Nat - A postrouting - O eth0 - J SNAT -- To 219.217 . 235.73
# Iptables-T Nat-A postrouting-O eth0-j snat-s 192.168.0.0/24 -- To 219.217.235.73

Pppoe-server-IEth1-R-u

UseXPThe connection is ready.

Note:

In order to prevent users in the LAN from setting the same IP address as eth1, so as to indirectly access the Internet, the IPaddress of eth1 must be set to null!
I guess
When you use NAT to access the Internet, after the customer sets the IP address and gateway to eth1, the connection sent to the server will be identified by iptables and routed in the past.
After pppoe is configured, if the customer does not establish a pppoe connection,

The datagram sent to the server is ignored, and iptables cannot recognize it.
After the connection is established,Iptables can recognize it.
The specific implementation is to be studied.

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.