The network does not beg for favors! Set up a simple Linux bureau network server _unix Linux

Source: Internet
Author: User
Tags squid proxy

Now has more than two desktops of the family has a lot of retired from the old machine food tasteless, discard. In fact, you can use it as a local area network server, after dinner to call friends to drink friends, shouting neighbors, pull a few network cable, move on the laptop to battle CS and the era of Empires, or use proxy server sharing Internet. Come with me and build a simple Linux LAN server.

Linux system requirements for the server is very low, the author with Celeron 466CPU, 128MB memory computer as a server, can be fully 50 stand-alone services, fast. If you use a PⅢ1G professional server, you can theoretically even meet the needs of 250 users.

First of all, to www.redhat.com or domestic related Web site download Redhat Linux version of the latest 8.0, this system has similar Windows operating interface x-windows application, the operation is relatively simple. Secondly, we will be equipped with two network cards for the server, a connection to the external line, a piece of the internal network. The configuration of modem access is different from ADSL, this paper takes ADSL access as an example, other access methods can be referenced.

Software installation is relatively simple, but to be aware of the following points in the partition: the Var partition should be larger, because all the Internet users of the files, and HTTP publishing site are in this section. It is best to set a temp partition to use as an administrator staging file. When choosing a file Baoqun, be sure to select KDE, squid two pack. To publish a Web site in a local area network, you should choose HTTP. If you do not know how to choose, then all the choice is OK, anyway, the impact is not big.

The installation process should be noted: The server in the installation process required to enter the IP address of the network card, this place to carefully choose, the author's ADSL external network card input address is 10.89.127.6, subnet mask is 255.255.255.0, Gateway is 10.89.127.254. This NIC is used for external access and is required to be enabled when the server is started, and the name is defined as eth0.

Topological structure diagram of LAN

The internal gateway uses the network card generally to use three kinds of addresses, we can set its address to 192.168.0.10, while the subnet mask is set to 255.255.255.0, also requires the server to be enabled at startup, the name is defined as eth1. The DNS service address of the two networks takes the same address, for example, the author is set to 202.102.227.68. Note that the eth0 and eth1 two names cannot be mixed, and if they are found to be different, they can be reset in server Configuration (service configuration) network settings on the Serverõs desktop.

The hardware circuitry can take the following topology map, with both the server and the client connected to the same switch. After the server is installed, the main task is to configure the Squid proxy Server software. Squid function is very powerful, but need to modify some of the content to be able to use normally. Open the/etc/squid/squid.conf file with the Advanced editor, in about 1450 lines, with the following two words:

http_access allow localhost

Http_access Deny All

The first sentence is that the local Internet access through HTTP, the second sentence is to prohibit other users through the local Internet, the second sentence should be modified to change it to

Http_access Allow all

Configuration complete. Squid agent is turned off by default at server startup and needs to be changed. In Server Desktop Icon Server Configuration (service configuration)/start at boot (boot selection), the squid and ipchains two items are marked with an asterisk, so that the server can start both squid and ipchains at startup. You can also run the command setup separately to locate the server configuration entry for the above configuration.

At this point, the server has been able to provide the WWW agent service, but there are still a lot of things to configure. For example, chat function, to specifically set address spoofing to proceed. Add the following content to the end of the/etc/rc.local file, and then restart the server.

Echo 1 >/proc/sys/net/ipv4/ip_forward

/sbin/ipchains-p forward DENY

/sbin/ipchains-f

/sbin/ipchains-a forward-s 192.168.0.0/24-j masq-i eth0

These four sentences are set address spoofing and address spoofing for 192.168.0.0 to 192.168.0.254 address ranges. Eth0 is the external network adapter name. With such a setting, all clients have only one address externally, which can play a role as a firewall.

In the local area network publish the website to be easy, we can use the FTP to have already done the webpage to put under the \var\www\http, can. However, we still need an asterisk in front of HTTP and wu-ftp in the server Desktop Icon Server Configuration (service configuration)/start at boot (boot selection).

The client's settings are simple, and its IP address must be set between 192.168 0.0 and 192.168.0.254, and it cannot be set to the same internal address as the server. We set the client's gateway to the IP address of the server's internal network card, and the port is set to 3128. This is the default value of the Squid agent, which can be reset on the server. DNS of clients can be set directly to a unified address, such as 202.102.227.68. Because the client uses address spoofing to surf the Internet, you can ping the external address directly by using the ping command.

 

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.