Practice of ADSL dual-network card Internet sharing under RedHat7.2

Source: Internet
Author: User
Article title: ADSL dual-network card Internet sharing practice under RedHat7.2. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

In the previous section, I applied to activate the monthly subscription ADSL service at China Netcom, so I started surfing the Internet. in the IT circle over the years, I had three computers in my home, with a roommate's notebook and a PC, there were a total of five computers, so I began to wonder how I could get these computers online.

After searching for a while on the Internet, I can see from some jars that there is no limit on one account to dial multiple times. so I also tried my ADSL with the idea of trying it out, the result is that the home ADSL can be used for multiple dial-up times. Hey, it's nice. I bought an eight-port HUB, connected the ADSL cat to the UP Link port of the HUB, and connected other machines to the HUB using a network cable. the ADSL dialing software was installed on each machine, as a result, each computer can dial up independently at a speed of 512 Kbps! If you have ADSL, try again!

As a result, there was a nightmare after a good life. yesterday I went back to the home and turned on the power of the HUB and ADSL cat as usual. I found that no matter how I tried it, I could only dial one machine, after confirmation, we learned that the telephone Bureau in our zone had made some restrictions, so we had to start tossing the proxy server.

There is an old computer left in the house for historical reasons. it is currently idle and not used. it is configured as Sai Yang 366, memory 64 MB, hard disk 2.5 GB, no display, keyboard and mouse, and dual Nic, it is easy to use as a proxy server. after one night of hard work, we have done a good job. Although the internet access speed is slow, we are still satisfied. The following is the entire installation and configuration process.

1. determine the implementation goal:

We need to connect the proxy server to an ADSL cat by using a network card. In addition, we need to connect the proxy server to the HUB, set NAT on the server, and configure firewall and DHCP. other computers on the intranet use the automatic IP address acquisition method, and shared internet access through the proxy server.

2. server installation and network configuration:

Since there was only a RedHat Linux 7.2 installation CD, I decided to install RedHat7.2 as the agent server system. the installation process was not described in detail. I chose the minimum installation method, you have selected the pppd service, firewall, and rp-pppoe package for installation.

After the system is installed, configure two Nics: eth0 and eth1. I chose eth0 to connect to the ADSL cat and eth1 to connect to the intranet. No need to set the eth0 IP address for ADSL dial-up Internet access. The following is my network configuration file settings

/Etc/sysconfig/networks file:

      
       
NETWORKING = yesHOSTNAME = proxyFORWARD_IPV4 = "yes" GATEWAY = "ppp0" GATEWAYDEV = ""
      

/Etc/sysconfig/network-scripts/ifcfg-eth0 file:

      
       DEVICE=eth0BOOTPROTO=static      ONBOOT=yes
      

/Etc/sysconfig/network-scripts/ifcfg-eth1 file:

      
       DEVICE=eth1BROADCAST=192.168.0.255IPADDR=192.168.0.1NETMASK=255.255.255.0NETWORK=192.168.0.0      ONBOOT=yes
      

Next, configure ip forwarding and enable core support for ip forwarding. open the/etc/rc. local file and add the following three lines:

      
       echo 1 > /proc/sys/net/ipv4/ip_forwardipchains -A forward -s 192.168.0.0/24 -d 0/0 -j MASQ      adsl-start &
      

The last line sets the system to automatically connect to ADSL at startup, which is described later.

3. ADSL configuration

After configuring the basic environment of the server, start to configure the ADSL dialing. Michael found a strange problem during the setting, that is, how can he not find the adsl-setup command in the system, I am wondering if I have other options, such as adsl-start and adsl-connect. There is really no way, I went to openbsd.org to download the redhat7.3 rp-pppoe-3.5-1. i386.rpm package, and then re-installed the rp-pppoe package with the following command:

      
       #rpm -Uhiv --replacepkgs rp-pppoe-3.5-1.i386.rpm
      

Just take a look. well, I don't know what's wrong with the 7.2-belt package, and I have no time to study it carefully.

Next, run adsl-setup to set ADSL. the configuration process is as follows:

      
       #/usr/sbin/adsl-setup
      

When:

      
       Enter your PPPoE user name :
      

Enter the username of the ADSL account.

When:

      
       Enter the Ethernet interface connected to the ADSL modemFor Solaris, this is likely to be something like /dev/hme0.For Linux, it will be ethn, where 'n' is a number.      (default eth0):
      

 

[1] [2] Next page

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.