一、 Linux网络相关

yum install net-tools

ifconfig查看网卡ip

ifup ens33开启网卡

ifdown ens33关闭网卡

设定虚拟网卡ens33:0

mii-toll ens33 与ethtool ens33一样查看网卡是否连接

更改主机名hostnamectl sethostname davery

DNS配置文件vi /etc/resoly.conf /etc/host文件

临时更改IP

vim /cat/hosts    编辑

二、firewalld和netfilter

selinux临时关闭setenforce 0

selinux永久关闭

vi /etc/selinux/config  

更改SELINUX=disabled

变成

centos7之前版本使用netfilter防火墙

centos7使用firewalld防火墙

关闭firewalld开启netfilter方法

systemctl stop firewalld 关闭

systemctl disable firewalld不让开机启动

yum install -y iptables-services

启动iptables防火墙服务

systemctl enable iptables

systemctl start iptables

iptables -nvL 查看

三、netfilter5表5链介绍

netfilter的5个表

filter表用于过滤包,常用表有INPUT、FORWARD、OUTPUT三个链

nat表用于网络地址转换,有PREROUTING、OUTPUT、POSTROUTING三个链

四、ipstables语法

查看ipstables规则: ipstables -nvL

iptables -F清空规则

重启规则

service ipstables save保存当前规则到配置文件

查看配置文件,显示默认规则

ipstables -t filter -t指定表

ipstables -Z 可以把计数器清零

[root@davery ~]# iptables -I INPUT -p tcp --dport 80 -j DROP    插入

[root@davery ~]# iptables -D INPUT -p tcp --dport 80 -j DROP删除

iptables -nvL --line-numbers

iptables -D INPUT 1

iptables -D INPUT DROP

Linux centos7 Linux网络相关、firewalld和netfilter、netfilter5表5链介绍、iptables语法的更多相关文章

  1. 10.11 Linux网络相关 10.12 firewalld和netfilter 10.13 netfilter5表5链介绍 10.14 iptables语法

    Linux网络相关 ifocnfig 查看网卡ip(yum install net-tools) ip add 查看网卡 ip add = ifocnfig ifconfig 不显示down掉的网卡, ...

  2. Linux网络相关、firewalld和netfilter、netfilter5表5链介绍、iptables语法 使用介绍

    第7周第3次课(5月9日) 课程内容: 10.11 Linux网络相关10.12 firewalld和netfilter10.13 netfilter5表5链介绍10.14 iptables语法 扩展 ...

  3. [linux]netstat命令详解-显示linux中各种网络相关信息

    1.功能与说明 netstat 用于显示linux中各种网络相关信息.如网络链接 路由表  接口状态链接 多播成员等等. 2.参数含义介绍 -a (all)显示所有选项,默认不显示LISTEN相关-t ...

  4. Linux对外提供服务 网络操作 端口操作 1.开启服务监听端口 2.设置防火墙,放行访问端口的包 iptables&netfilter 四表五链和通堵策略

    主题: Linux服务器上软件提供服务 1.网络操作 2.端口操作 1.网络操作 本机必须能够ping通目标主机(本地虚拟机或者远程主机) 2.端口操作 1.开启服务监听端口 2.设置防火墙,放行访问 ...

  5. Linux系统之网络相关的命令

    Linux系统之网络相关的命令 网络概述 网络:通过通信介质和通信设备 将分布不同地点的两台或多台计算机,经过相应的程序实现通信switch 交换机router 路由器网络的功能:数据通信:利用网络传 ...

  6. linux 命令学习-网络相关配置

    网络配置相关 网卡配置文件:etc/sysconfig/network-scripts/ifcfg-eth0 DNS 配置文件 etc/resolv.conf 主机配置文件 etc/sysconfig ...

  7. LINUX内核参数网络相关

    有助于提高网络性能和吞吐量的参数 net.core.somaxconn = 128 已完成连接队列(completed connection queue) (1)三次握手已经完成,但还未被应用层接收( ...

  8. 【linux】命令-网络相关

    目录 前言 1. ifconfig 1.1 语法 1.2 参数说明 1.3 例程 2. iw 2.1 扫描可用无线网络 2.2 WiFi连接步骤(教程A) 2.2.1 查看可以用无线设备信息 2.2. ...

  9. Linux centos7 linux任务计划cron、chkconfig工具、systemd管理服务、unit介绍、 target介绍

    一.linux任务计划cron crontab -u  -e -l -r 格式;分 时 日 月 周 user command 文件/var/spool/corn/username 分范围0-59,时范 ...

随机推荐

  1. AtCoder AGC038 C-LCMs 题解

    题目链接:https://agc038.contest.atcoder.jp/tasks/agc038_c?lang=en 题意:给定一个数组,求这个数组中所有数对的LCM之和. 分析:网上看到了很多 ...

  2. 一文搞懂vim复制粘贴

    转载自本人独立博客https://liushiming.cn/2020/01/18/copy-and-paste-in-vim/ 概述 复制粘贴是文本编辑最常用的功能,但是在vim中复制粘贴还是有点麻 ...

  3. finalize()

    本文介绍的是Java里一个内建的概念,Finalizer.你可能对它对数家珍,但也可能从未听闻过,这得看你有没有花时间完整地看过一遍java.lang.Object类了.在java.lang.Obje ...

  4. Educational Codeforces Round 76 (Rated for Div. 2)E(最长上升子序列)

    #define HAVE_STRUCT_TIMESPEC#include<bits/stdc++.h>using namespace std;int a[200007],b[200007] ...

  5. webservice笔记

    Web Service基本概念 Web Service也叫XML Web Service WebService是一种可以接收从Internet或者Intranet上的其它系统中传递过来的请求,轻量级的 ...

  6. No module named '_ctypes'

    3.7版本需要一个新的包libffi-devel,安装此包之后再次进行编译安装即可. #yum install libffi-devel -y #make install 若在安装前移除了/usr/b ...

  7. go开发工具goclipse的安装

    (1) 安装Eclipse 建议下载Eclipse时直接下载"Eclipse IDE for Java Developers"的package,而不要下载较小的Installer. ...

  8. retrying 模块

    我们在写爬虫的过程中,经常遇到爬取失败的情况,这个时候我们一般会通过 try 块去进行重试,但是每次都写那么一堆 try 块,真的是太麻烦了,所以今天就来说一个比较 pythonic 的模块,retr ...

  9. plus接口

    //获取手机端本地文件路径 plus.io.resolveLocalFileSystemURL(url, success(e){ }, fail(e){ })

  10. 吴裕雄 python 神经网络——TensorFlow 花瓣分类与迁移学习(1)

    import glob import os.path import numpy as np import tensorflow as tf from tensorflow.python.platfor ...