Linux Seven week three lessons (March 21) Notes

Source: Internet
Author: User

Seven weeks three sessions (March 21)
10.11 Linux Network related
10.12 Firewalld and NetFilter
10.13 NETFILTER5 Table 5 Chain Introduction
10.14 iptables Syntax

Extensions (SELinux understands)

    1. SELinux Tutorial Http://os.51cto.com/art/201209/355490.htm
      2.selinux PDF ebook Http://pan.baidu.com/s/1jGGdExK

10.11 Linux Network related

Run the command ifconfig to view the NIC, and if you do not have this command, install the Net-tools package.

Ifconfig is more refreshing than ipadd. Two effects are the same.

The network card is disconnected or has no IP address and can be displayed with Ifconfig-a.

The network card is broken and cannot be ordered.

Without an IP address, you need to run the IFUP command

Two commands to execute together.

The backslash is meant to take off the colon.

Change name, DEVICE, ipaddr

One more NIC.

Use windows,ping for a moment.

A server, see if it has a network cable, in the computer room can see the use of network cards. View in system, use command Mii-tool ens33, see if link OK

If not supported, use the command Ethtool ENS33

Look at the physical machine, it's a server on the line.

Change host Name

The configuration file for the DNS.

is defined in the NIC configuration file.

Join a row

To change the DNS, go to change the DNS configuration file. You can also temporarily edit this file.


After changing the network card, restarting the network card will still be overwritten by DNS in the NIC configuration file.

This file, Linux and Windows all have.

Www.qq123.com is a public network IP.

Change the parsing

Support 1 IP with multiple domain names. to a space.

Supports 1 domain names, multiple IPs. The following IP will prevail.

10.12 Firewalld and NetFilter

Change Selinux=enforcing to Selinux=disabled


Permissive SELinux is on, just a reminder of what happens when a block is needed. Does not need to be really blocked.

NetFilter

View Default Rules

10.13 NETFILTER5 Table 5 Chain Introduction

Man iptables a look. When CentOS6, there were only 4 tables.

Look at this article, as a reference

10.14 iptables Syntax

Restart, the rules have not changed.

Where the rules are saved.

Purge rule

The current rule is saved to a file, and you need to execute the following command. Clear the rules, save no use.

Restart the service and load it back.

Zeroing the calculator

I wrote a monitoring script and found that IP had a field that dropped the IP. Review the rules if the number of packets does not exceed 100. can be solved by sealing off. The number through the first column. Recalculate after 30 minutes.

After the data came, said not to say, directly kicked off.

After the data came, say, can't come in.

The usage of-I. -I is inserted, metaphorically queued, inserted to the front,-a queues the last side.

Match 1th first, and if it matches, it will not match down.

Delete Rule

Print out the serial number of the rule.

There are also removal rules for the NIC.

There is also the deletion of the default rule.

Re-login, release


Don't move the rules, keep the default.

Linux Seven week three lessons (March 21) Notes

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.