Implementation of routes in red-flag Linux

Source: Internet
Author: User
The implementation of routes in red-flag Linux-Linux Enterprise Application-Linux server application information. The following is a detailed description. To:
1. Install dual NICs. We recommend that you use the RTL8139 series for Nic chips, because red-flag Linux 2.0 provides better support for these chips. I use the Hongqi Linux2.5 Advanced Server version. The intranet card is eth1 and the IP address is 172.16.10.1/24.
The Internet card is eth0 and the IP address is 192.168.1.68/24.
2. Install the red-flag Linux 2.5 system.
(1) it is best to use the image installation method (default mode). It is troublesome to use character and expert mode.
(2) it is more convenient to select Custom partitions for the hard disk. First, determine the swap partition (swap). The size is generally twice the physical memory (for example, the server memory is 64 MB, swap partition is 128 MB ). It is also necessary to determine the primary partition (the basis of the entire system. The rest of the partitions can be determined based on the situation or not.
(3) install the rest as prompted.
3. Create an ip. start file in the/etc directory. The content of the file is as follows: (the description is in Chinese, and you do not need to enter :)-p)
#! /Bin/sh

Echo "Starting ipchains firewall rules ..."

# Refresh all firewall rules

/Sbin/ipchains-F forward

/Sbin/ipchains-F input

/Sbin/ipchains-F output

# Setup default firewall rules (default firewall settings)

/Sbin/ipchains-P forward ACCEPT

/Sbin/ipchains-P input ACCEPT

/Sbin/ipchains-P output ACCEPT

# Setup Loopback interface

/Sbin/ipchains-A input-j ACCEPT-I lo

/Sbin/ipchains-A output-j ACCEPT-I lo

# Disabling IP spoofing (IP spoofing prohibited)

/Sbin/ipchains-A input-j DENY-I eth1-s 192.168.0.0/16

/Sbin/ipchains-A input-j DENY-I eth1-d 192.168.0.0/16

/Sbin/ipchains-A output-j DENY-I eth1-s 192.168.1.0/16

/Sbin/ipchains-A output-j DENY-I eth1-d 192.168.1.0/16

# Refuse packets claiming to be to or from the loopback interface

/Sbin/ipchains-A input-j DENY-I eth1-s 127.0.0.0/8

/Sbin/ipchains-A input-j DENY-I eth1-d 127.0.0.0/8

/Sbin/ipchains-A output-j DENY-I eth1-s 127.0.0.0/8

/Sbin/ipchains-A output-j DENY-I eth1-d 127.0.0.0/8

# Refuse broadcast address source packets (prohibit broadcast packets)

/Sbin/ipchains-A input-j DENY-I eth1-s limit 255

/Sbin/ipchains-A input-j DENY-I eth1-d 0.0.0.0

# Refuse multicast/anycast/broadcast address

/Sbin/ipchains-A input-j DENY-I eth1-s 240.0.0.0/3

# Forwarding all internal traffic (forwarding internal packets)

/Sbin/ipchains-A forward-j ACCEPT-I eth0-s 192.168.1.0/24-d 192.168.1.0/24

# Setup IP Masquerading rules (set I P camouflage rules)

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

Depmod-

/Sbin/modprobe ip_masq_ftp

/Sbin/modprobe ip_masq_irc

/Sbin/modprobe ip_masq_portfw

/Sbin/modprobe ip_masq_user

/Sbin/modprobe ip_masq_autofw

/Sbin/modprobe ip_masq_quake

/Sbin/modprobe ip_masq_vdolive

/Sbin/modprobe ip_masq_cuseeme

/Sbin/modprobe ip_masq_mfw

Ipchains-p forward DENY

# Starting IP masquerading (set I P disguise)

Ipchains-A forward-s 192.168.1.0/255.255.255.0-j MASQ
The uppercase and lowercase letters in this file are different. You can refer to the relevant materials for their meanings. This file can only contain the following three lines:

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

Depmod-

Ipchains-A forward-s 192.168.1.0/255.255.255.0-j MASQ
4. Grant executable rights to the file owner

# Chmod u + x/etc/ip. start

5. Enable the computer to automatically load the ip. start file at startup
# Vi/etc/rc. d/rc. local
Add
/Etc/ip. start
Save the disk and restart the computer.
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.