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:
- IPADDR="202.114.194.130"# External network IP address of the first card
- NETMASK="2017100000000128"# External subnet mask of the first card
- NETWORK="202.114.194.0"# External network segment of the first card
- BROADCAST="202.114.194.255"# External network broadcast address of the first card
- 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
- /sbin/ifconfigeth0${IPADDR}
- broadcast${BROADCAST}metmask${NETMASK}
# Set the first card
- /sbin/ifconfigeth1${IPADDR1}
- broadcast${BROADCAST1}metmask$
- {NETMASK1}
# Set the second card
- /sbin/routeadd-net${NETWORK}
- netmask${NETMASK}
- /sbin/routeadddefaultgw$
- {GATEWAY}metric1
- /sbin/routeadd-net${NETWORK1}
- 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.
- Use logs to make Linux management easier
- Operation notes: Linux Framebuffer Programming
- Detailed introduction to Linux File Types
- Command Daquan: Linux advanced command line skills
- Introduction Linux screenshot tool: import