PPPOE dial-up shared internet access in Linux

Source: Internet
Author: User
Article title: PPPOE dial-up shared internet access in Linux. Linux is a technology channel of the IT lab in China. Including desktop applications, Linux system management, kernel research, embedded systems and open source, and other basic categories 1. Nic configuration.
 
Two NICs, eth0 is a dial-up Nic, IP: 192.168.1.1 (other addresses are also available), eth1 is an intranet Nic, IP: 192.168.0.1. The mask is 255.255.255.0. the LAN network segment is 192.168.0.0.
 
Note: Neither network card can be configured with a gateway.
 
2. PPPoE software upgrade and installation
 
1) Download in http://www.roaringpenguin.com/pppoe/#download
 
2) install rp-pppoe. run as root
 
Rpm? Uvh rp-pppoe-3.5-1.i386.rpm
 
3. modify/etc/sysctl. conf
 
Replace
 
Net. ipv4.ip _ forward = 0
 
Change
 
Net. ipv4.ip _ forward = 1
 
4. remove the ipchains module and select only the iptables method as follows:
 
1) setup
 
2) select system service
 
3) remove ipchains
 
4) select iptables
 
5) restart the machine
 
5. PPPoE client configuration
 
After installing the rp-pppoe-3.5-1.i386.rpm, you can configure the PPPoE client. The process is as follows.
 
#/Usr/sbin/adsl-setup
 
>>> Enter your PPPoE user name: -- Enter the user name of the dial-up account.
>>> Enter the Ethernet interface connected to the ADSL modem For Solaris, this is likely to be something like/dev/hme0. For Linux, it will be ethn, where n is a number. (default eth0): -- enter eth0
>>> Enter the demand value (default no): -- Enter no
>>> Enter the DNS information here: -- Enter 210.52.149.2 (depending on the IP address of the local carrier's DNS server)
>>> Please enter your PPPoE password: -- enter the Netcom user password
>>> Choose a type of firewall (0-2): -- enter 0
>>> Accept these settings and adjust configuration files (y/n )? -- Input y
 
6. start the dial-up connection
 
/Usr/sbin/adsl-start
 
After successful connection, the screen displays Connected.
 
Now, this linux instance can be browsed online.
 
7. IP camouflage
 
To enable other machines in the Lan to share the internet via a Linux server, at least the following command must be executed:
 
Iptables-t nat-a postrouting-o ppp0-j MASQUERADE
 
Then, the PC in the 192.168.0.0 CIDR block (the gateway is 192.168.0.1) can access the Internet through Linux!
 
8. Auto Start
 
To enable automatic dialing on a Linux server, perform the following steps.
 
1) chkconfig -- add adsl
 
2) setup
 
3) Select system services
 
4) select ADSL
 
5) OK to exit
 
6) open/etc/rc. d/rc. local and 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
 
Note: the first four sentences are used to disable ICMP to prevent other users from pinging.
 
9. now everything is OK. A simple dial-up is built. After restarting the machine, we found that all internet shared connections in linux are ready.
 
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.