4. shielding IP addresses
# If you only want to block the IP address, you can skip "3. open the specified port.
# The command to shield a single IP address is
Iptables-I INPUT-s 123.45.6.7-j DROP
# The Command for sealing the entire segment from 123.0.0.1 to 123.20.255.254
Iptables-I INPUT-s 123.0.0.0/8-j DROP
# An IP address segment is a command from 123.45.0.1 to 123.45.255.254.
Iptables-I INPUT-s 124.45.0.0/16-j DROP
# The Command from 123.45.6.1 to 123.45.6.254 is
Iptables-I INPUT-s 123.4
/Etc/init. d/iptablesrestart # Restart the firewall to make the change take effect. of course, you can restart the system (Command: reboot)/etc/rc if you do not feel any trouble. d/init. d/iptablessave # save the changes. in actual applications, it is easy to add-I, but-a is not easy to use. The rules are filled in different locations. (I is suspected to be inserted from top down
/Etc/init. d/IptablesRestart
# Restart the
" of the tcp three-segment handshake, in other words, allow the client machine to send a link request to the server. ESTABLISHED indicates that a link has been ESTABLISHED through a handshake.
Iptables-a output-o eth2-p tcp -- sport 32768: 61000-m state -- state NEW, ESTABLISHED-j ACCEPT
Let's take a look at this sentence first. Now your data packets have entered the linux server firewall. Squid needs to be accessed in place of you. Therefore, the ser
CentOS Linux firewall configuration and shutdown
Firewall shutdown, turn off its services:
To view firewall information:#/etc/init.d/iptables status
To turn off the Firewall service:#/etc/init.d/iptables stop
Permanently closed.
/ssh_host_ecdsa_key# Lifetime and sizeof ephemeral version 1 server key#keyregenerationinterval 1h#serverkeybits 1024# ciphers and keying#rekeylimit default non e# logging# obsoletes quietmode and fascistlogging#syslogfacility authsyslogfacility AUTHPRIV#LogLevel INFO# Authentication: #LoginGraceTime 2m#permitrootlogin yes#strictmodes yes#maxauthtries 6#maxsessions 10# Rsaauthentication yes#pubkeyauthentication yes# The default is to check both. Ssh/authorized_keys and. Ssh/authorized_key s2# bu
Centos firewall operations
First, check the Firewall Status:
Input command: service iptables status
If it is enabled:
If the disabled status is:
Perform operations on the running status:
Stop Firewall:Service iptables stopStart Firewall:Service iptables startRestart Firewall:Service iptables res
CentOS 7 Open Port and centos Open Port
After CentOS is upgraded to 7, iptables cannot be used to control the Linuxs port, because CentOS 7 uses firewalld instead of the original iptab
Step 5: Use the local machine or ssh to connect to the centos system, run the "/sbin/iptables-I INPUT-p tcp -- dport 1st-j ACCEPT" command, and confirm the method.Note: If you want to open any port, write the port directly in the command. Generally, the default port for a web site is port 80, tomcat is port 8080, and mysql database is port 3306, the specific port numbers can be modified in your own software. To view the port information that has just
IP address (1 host up) scanned in 6.82 seconds
Tip: during the experiment, you can run the following command to clear all the configurations from scratch.
Iptables-P input acceptIptables-P output acceptIptables-P forward acceptIptables-F
RHEL 7 (cetos 7) uses the new firewalld instead of iptables. In this experiment, the script is executed at startup to solve the problem.
# Vi/etc/rc. Lo
This example describes the CentOS firewall usage. Share to everyone for your reference, specific as follows:
Shut down:
/etc/init.d/iptables stop
Open:
/etc/init.d/iptables start
Reboot:
/etc/init.d/iptables restart
View:
/etc/init.d/iptables status
Save:
/etc/init.d/iptables Save
Open po
Use yum to test Zabbix 2.4 On CentOS 7 or RHEL 7
Use yum to test Zabbix 2.4 On CentOS 7 or RHEL 7
Steps for lite version:1. Add SourceYum-y install epel-releaseVi/etc/yum. repos. d/zabbix. repo[Zabbix]Name = ZabbixBase url = http:
Summary of installing mysql with rpm in centos 7, centos 7rpm
Recently, in a project, centos is used as the data server and mysql database is used to install the mysql database. I have never touched centos before, so I don't understand anything, I also checked a lot of infor
. The command is as follows.
# Yum install vsftpd
# Cp-r/mnt/*/var/ftp/pub/
# Chmod-R 755/var/ftp/pub
Install the Vsftpd Server
Copy Files to the FTP path
Set FTP path PermissionsStep 7: START and enable processes within the system
12. Since the PXE Server configuration has been completed, start the DNSMASQ and VSFTPD servers. Verify their status and enable them on the system so that these services can be started with the system after each sys
In a Linux system, after installing a software or application, it is sometimes necessary to manually start the application, but also to receive the application added to the boot key, so that it can be installed on Linux once the application load
How to start the application
CentOS 6:
Service Service Start|stop|restart|reload|status
CentOS
Centos 7 Open Port 80
Enable port 80
Firewall-cmd -- zone = public -- add-port = 80/tcp -- permanent
If success is displayed, the instance is successfully added.
Command description:
-- Zone # Scope
-- Add-port = 80/tcp # add a port in the format of port/communication protocol
-- Permanent # takes effect permanently. If this parameter is not set, it becomes inva
'Password' with grant option;
Modify permissions. % Indicates all IP addresses, and password indicates that the password will be used to log on to the root user. To connect only hosts in an IP segment, you can change it:
Grant all privileges on *. * TO 'root' @ '1970. 192.% 'identified by 'my-new-password' with grant option;
Don't forget:
Flush privileges;
Save the changes and check the user account information:
At this time, we found that the host item is %, which indicates that the configura
machine can ping Virtual Machine 2. The VM can also ping the host 3. The virtual machine can access its web 4. The local machine cannot access the virtual web. This problem occurs because port 80 of the server is not enabled or the firewall is not disabled.
Solution
If centos6 is used, the solution is as follows:/sbin/iptables-I INPUT-p tcp -- dport 80-j ACCEPT and then save:/etc/rc. d/init. d/iptables save and restart
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.