Install Linux firewall to ensure Linux security

Source: Internet
Author: User

Linux beginners are always worried about Linux security. In fact, with the Linux firewall installed, Linux security is guaranteed. How to install the Linux firewall? Here we will introduce you to the Linux Firewall method. I hope you can understand how to install the Linux firewall.

1. hardware Installation

Two NICs, one Nic, and one Modem card must be installed on the computer running the Linux firewall. This article takes two NICs as an example. Install the NIC, correctly set the interrupt number and port number, and assign an appropriate IP address to each Nic.

Configure the firewall model.

2. Install the Gateway

There are two ways to install the Gateway: one is to run linuxconf, enter the ROUTINGANDGATEWAYS option, configure the gateway, and the other is to modify the rc. inet1 file. The following describes how to modify the rc. inet1 file to install the gateway.

Go to the/etc/rc. d/directory, type virc. inet1, and press Enter. Modify the parameters as follows:

 
 
  1. IPADDR="202.114.194.130"# External network IP address of the first card
  2. NETMASK="2017100000000128"# External subnet mask of the first card
  3. NETWORK="202.114.194.0"# External network segment of the first card
  4. BROADCAST="202.114.194.255"# External network broadcast address of the first card
  5. GATEWAY="202.114.194.129"# The external network gateway of the first card is also

Default Gateway

IPADDR1 = "192.168.0.1"

# Intranet IP address of the second card

NETMASK1 = "255.255.255.0"

# Intranet subnet mask of the second card

NETWORK1 = "192.168.0.0"

# Intranet segment of the second card

BROADCAST1 = "192.168.0.255"

# Intranet broadcast address of the second card

 
 
  1. /sbin/ifconfigeth0${IPADDR}   
  2. broadcast${BROADCAST}metmask${NETMASK}  

# Set the first card

 
 
  1. /sbin/ifconfigeth1${IPADDR1}   
  2. broadcast${BROADCAST1}metmask$   
  3. {NETMASK1}  

# Set the second card

 
 
  1. /sbin/routeadd-net${NETWORK}   
  2. netmask${NETMASK}   
  3. /sbin/routeadddefaultgw$   
  4. {GATEWAY}metric1   
  5. /sbin/routeadd-net${NETWORK1}   
  6. netmask${NETMASK1}  

To test the gateway settings, run the "ifconfig" command to test the settings. After running the command, eth0 and eth1 are displayed and the modified content is displayed. If no such information is displayed, it indicates that the settings are incorrect and you have to try again.

In this way, you have installed the Linux firewall.

  1. Use logs to make Linux management easier
  2. Operation notes: Linux Framebuffer Programming
  3. Detailed introduction to Linux File Types
  4. Command Daquan: Linux advanced command line skills
  5. Introduction Linux screenshot tool: import

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.