Linux under PPPoE dial-up share Internet __linux

Source: Internet
Author: User
Tags iptables
1, network card configuration.
Two network cards, eth0 for dial-up network card, ip:192.168.1.1 (other address can also), Eth1 for intranet network card, ip:192.168.0.1. The masks are 255.255.255.0. LAN network segment is 192.168.0.0.
Note: Neither of the two cards can be set up in the gateway.
2, PPPoE software upgrades and installation
1) #download Download in http://www.roaringpenguin.com/pppoe/
2) Install Rp-pppoe. EXECUTE AS Root
RPM–UVH rp-pppoe-3.5-1.i386.rpm
3. Modify/etc/sysctl.conf
Will be one of the
Net.ipv4.ip_forward = 0
To
Net.ipv4.ip_forward = 1
4, remove the IPChains module, only select the Iptables method as follows:
1) Setup
2 Select system Service
3) Removal of IPChains
4) Select Iptables
5) Restart the machine
5. PPPoE Client Configuration
After the rp-pppoe-3.5-1.i386.rpm is installed, the PPPoE client configuration is available next. The process is as follows.
#/usr/sbin/adsl-setup
>>> Enter your PPPoE user name:--here Enter the username for the dial-up account
>>> Enter the Ethernet interface connected to the ADSL modem for Solaris, this are likely to be something like/de V/HME0. For Linux, it'll be ethn and where n is a number. (default eth0):--loss eth0
>>> Enter The demand value (default NO):--No
>>> Enter The DNS information here:--210.52.149.2 (depending on the local operator's DNS server IP)
>>> Please enter your PPPoE password:--transmission netcom User Password
>>> Choose A type of firewall (0-2):--Loss 0
>>> Accept These settings and adjust configuration files (y/n)? --Lose Y
6, start the dial-up connection
/usr/sbin/adsl-start
After a successful connection, the screen displays connected.
At this point the Linux has been able to browse the Internet.
7, IP Camouflage
To enable other machines on the local area network to share the Internet through a Linux server, at least the following commands must be executed:
Iptables-t nat-a postrouting-o Ppp0-j Masquerade
Upon completion, the PC on the 192.168.0.0 network segment (Gateway 192.168.0.1) can be connected to the Internet via Linux.
8, boot from start
To enable the Linux server to dial automatically, perform the following steps.
1) chkconfig--add ADSL
2) Setup
3 Select System Services
4) Select ADSL
5) OK exit
6 Open/etc/rc.d/rc.local, add the following statement at the end of the file
echo "[OK]"
echo "Drop ICMP form Anywhere"
Echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_all
echo "[OK]"
Iptables-t nat-a postrouting-o Ppp0-j Masquerade
Description: The preceding four sentences are used to turn off ICMP and prevent others from pinging.
9, so far, all OK, a simple dial-up built. After restarting the machine, discover that the Linux Internet share connection is all ready, good ...

In order to establish a more secure dial-up connection, please set up a variety of security mechanisms, specifically refer to Csdn.net's Iptables combat Records and Nat HowTo Simplified Chinese version.

Related Article

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.