包含标签 Linux 的文章

Internet和internet

internet意思是用一个共同的协议族把多个网络连接在一起. 而Internet指的是世界范围内通过TCP/IP互相通信的所有主机集合 Internet是一个internet,但internet不等于Internet……

阅读全文

ip link

ip link命令格式 命令实例 ip link add link eth0 name eth0.10 type vlan id 10 命令实例 解释 ip link add link eth0 name eth0.10 type vlan id 10 在设备eth0上创建新的vlan设备eth0.10 ip link set eth0 up 或:ifconfig eth0 up 开启eth0网卡 ip link set eth0 down或:ifconfig eth0 down 关闭eth0网卡 ip link set eth0 promisc on 开启网卡的混合模式 ip link set eth0 promisc off……

阅读全文

iptables详解

k8siptable 了解 https://blog.csdn.net/qq_36183935/article/details/90734847 iptables工作流程 iptables是采用数据包过滤机制工作的,所以它会对请求的数据包的包头进行分析,并根据我们预先设定的规则进行匹配来决定是否可以进入主机。 ① 防火墙是一层一层过滤的。实际是按照配置规则的顺序从上到下,从前到后进行过滤的; ② 如果匹配上规则,即明确表明阻……

阅读全文

k8s downward API

前面我们从pod的原理到生命周期介绍了pod的一些使用,作为kubernetes中最核心的对象,最基本的调度单元,我们可以发现pod中的属性还是非常繁多的,前面我们使用过一个volumes的属性,表示声明一个数据卷,我们可以通过命令kubectl explain pod.spec.volumes……

阅读全文

linux tmp文件

tmp是temporary的缩写,这个目录是用来存放一些临时文件。/tmp是Linux下的临时文件夹。 该文件夹中的内容一般不会删除,以redhat为例,系统自动清理/tmp文件夹的默认时限是30天。30天不访问的/tmp下的文件会被系统自动删除。 /tmp-临时文件目录,能够被任何……

阅读全文

linux_lldptool

1 2 3 4 5 6 [root@localhost ~]# lldptool set-lldp -i eno2 adminStatus=rxtx; [root@localhost ~]# lldptool -T -i eno2 -V sysName enableTx=yes; [root@localhost ~]# lldptool -T -i eno2 -V portDesc enableTx=yes; [root@localhost ~]# lldptool -T -i eno2 -V sysDesc enableTx=yes; [root@localhost ~]# lldptool -T -i eno2 -V sysCap enableTx=yes;……

阅读全文

linux用户态与内核态

一. 概念 操作系统 - 管理计算机硬件与软件资源的软件.是用户与系统交互的操作接口.为它上面运行的程序提供服务. 操作系统内核 - 操作系统的核心.负责管理系统的进程.内存.设备驱动程序.文件和网络系统.一个内核不是一套完整的操作系统.如Linux. Linux操作系统 - 基于Linux 内核的操……

阅读全文

shell中=和~的用法

shell 中 =~ 的用法 我们先看一个脚本,该脚本的功能是搜索当前目录下文件中的指定字符串 1 2 3 4 5 6 7 8 9 10 11 #!/bin/bash apath=$1;acontent=$2;aexp=$3; if [[ $aexp =~ all ]] ;then atype='' else atype=".$aexp" fi find $apath -name "*"$atype -type f -print0 | xargs -0 grep --color -rn "$acontent" if [[ $aexp =~ all ]] 其中 ~是对后面的正则表达式匹配的意思,如果匹配就输出1,不匹配就输出0……

阅读全文

SNAT和DNAT

参考 SNAT In Source Network Address Translation (SNAT), the NAT router modifies the IP address of the sender in IP packets. SNAT is commonly used to enable hosts with private addresses to communicate with servers on the public Internet. RFC 1918 reserves the following three subnets as private addresses: 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 DNAT In Destination Network Address Translation (DNAT), the NAT router modifies the IP address of the destination in IP packet headers. OpenStack uses DNAT to route packets from instances to the OpenStack metadata service. Applications running inside of instances access the OpenStack metadata service by making HTTP GET requests to a web server with IP address 169.254.169.254. In an OpenStack deployment, there is no host with this IP address. Instead, OpenStack uses DNAT to change the destination IP of these packets so they reach the network interface……

阅读全文