How to make a proxy server with Linux (the simplest practice, here is redhat9.0 as an example)
Need configuration: CPU: Pentium 133 MHz memory: 32 MB hard drive: 640 MB network card: 2
1. Install Linux, select the minimum installation, remove all the hooks of the component, in addition to configuring IP, all other default installations After entering the prompt
2. First configure the network card. If you are configured with a graphical interface, check if the IP is correct ifconfig eth0 # check the status of the NIC 0, if you want to change the configuration file (command: vi / etc / sysconfig / network-scripts / ifcfg-eth0) file Ifconfig eth1 # check the status of the NIC 1, if you want to change the configuration file (command: vi / etc / sysconfig / network-scripts / ifcfg-eth1) file Route # check the gateway, want to change (command: vi / etc / sysconfig / NetWork) Here's Gateway = After the change of the changed gateway can check the status of the route with Route, if it is read, it means no problem, use ping to detect the intranet and the external network to ping 3. Iptables implements dual network card NAT features, enabling proxy Internet VI / ETC / SYSCONFIG / Network # First, edit this file, plus a line at the end of the file (Forward_IPv4 = YES) only open IP transit function to achieve nat forward_ipv4 = Yes Vi /etc/rc.d/rc.local # Edit the start batch file, add the following lines at the end of the file ## 号 号 注 注语 语 不 不 i i i 表 网 i t p p p p p i p p i Table iptables -t nat -a postrouting -o eth0 -s 192.168.0.0/16 -j masquerade # Add new iPnat table, 192.168.0.0 / 16 is the LAN IP
Echo L> / proc / sys / net / ipv4 / ip_forward # launch IP transit function, to this, restart the machine after the proxy server should seem to be almost possible and use 4. Configure the service NTSysv # when the system is started, then a conversation Box, leaving only the iptables service and networks service, other services have removed VI /etc/grub.conf # If the system starts a 10 second wait time dialog, set the wait time here.