春风十里不如你 —— Taozi - 实验 https://www.xiongan.host/index.php/tag/%E5%AE%9E%E9%AA%8C/ zh-CN Tue, 10 Oct 2023 21:13:54 +0800 Tue, 10 Oct 2023 21:13:54 +0800 【安全】搭建VPN案例 https://www.xiongan.host/index.php/archives/224/ https://www.xiongan.host/index.php/archives/224/ Tue, 10 Oct 2023 21:13:54 +0800 admin 搭建VPN

环境网络拓扑

69692593485

作为VPN服务器的Win2003 添加一张网卡用于连接内部权限子网的端口

配置VPN服务器

选择路由和远程访问

69692606999

69692610290

选择配置VPN服务器

69692612654

选择外网网卡

69692647054

IP地址指定→自动

名称和地址转换服务→启用基本的名称和地址服务

管理多个远程访问服务器→否

完成后确定

69692669398

VPN网络客户端的配置

在XP系统中进行配置,添加网络连接

69692680204

69692683263

网络连接→虚拟专用网络连接

连接名→随意

VPN服务器选择→win2003的ip地址

69692696765

下一步完成后就会弹出一个登陆窗口,此时需要去win 2003VPN服务器中创建新的用户和密码

69692719271

设置用户权限

69692724242

测试远程访问VPN

在XP端中成功登录连接后

69692734391

运行cmd命令执行ipconfig,可以查看客户机已经获取的新地址与内部网络一致了

69692759966

查看到时随机地址,只需要去VPN服务器中修改配置,改为静态地址即可

69692766247

再次测试,就可以看到是自定义的静态地址池

69692776320

]]>
2 https://www.xiongan.host/index.php/archives/224/#comments https://www.xiongan.host/index.php/feed/tag/%E5%AE%9E%E9%AA%8C/
【VPC】AWS构建VPC并启动Web服务器 https://www.xiongan.host/index.php/archives/223/ https://www.xiongan.host/index.php/archives/223/ Mon, 09 Oct 2023 23:16:17 +0800 admin 构建 VPC 并启动 Web 服务器
  • 创建 VPC。
  • 创建子网。
  • 配置安全组。
  • 在 VPC 中启动 EC2 实例

创建VPC

进入AWS管理控制台中,创建VPC,包括单个可用区中的一个 VPC、一个互联网网关、一个公有子网和一个私有子网,以及两个路由表和一个 NAT 网关

  • 选择 VPC and more(VPC 等)。
  • Name tag auto-generation(名称标签自动生成)下,将 Auto-generate(自动生成)保持选中状态,但将值从 project 更改为 lab
  • IPv4 CIDR block(IPv4 CIDR 块)设置保持为 10.0.0.0/16
  • 对于 Number of Availability Zones(可用区数量),请选择 1
  • 对于 Number of public subnets(公有子网的数量),请将设置保留为 1
  • 对于 Number of private subnets(私有子网的数量),请将设置保留为 1
  • 展开 Customize subnets CIDR blocks(自定义子网 CIDR 块)部分

    • Public subnet CIDR block in us-east-1a(us-east-1a 中的公有子网 CIDR 块)更改为 10.0.0.0/24
    • Private subnet CIDR block in us-east-1a(us-east-1a 中的私有子网 CIDR 块)更改为 10.0.1.0/24
  • NAT gateways(NAT 网关)设置为 In 1 AZ(在一个可用区中)。
  • VPC endpoints(VPC 终端节点)设置为 None(无)。
  • DNS hostnames(DNS 主机名)和 DNS resolution(DNS 解析)都保持为 enabled(已启用)状态。

69681902189

创建成功

69681921731

创建额外子网

创建第二个公有子网

  • VPC IDlab-vpc(从菜单中选择)。
  • Subnet name(子网名称):lab-subnet-public2
  • Availability Zone(可用区):选择第二个可用区(例如 us-east-1b)
  • IPv4 CIDR block(IPv4 CIDR 块):10.0.2.0/24

此子网将包含所有以 10.0.2.x 开头的 IP 地址。

69681965888

创建第二个私有子网

  • VPC IDlab-vpc
  • Subnet name(子网名称):lab-subnet-private2
  • Availability Zone(可用区):选择第二个可用区(例如 us-east-1b)
  • IPv4 CIDR block(IPv4 CIDR 块):10.0.3.0/24

此子网将包含所有以 10.0.3.x 开头的 IP 地址。

69681986865

配置路由表

现在,您将配置这个新的私有子网,将流向互联网的流量路由到 NAT 网关,以便第二个私有子网中的资源能够连接到互联网,同时这些资源仍然保持私有。这是通过配置路由表完成的。

路由表包含一组规则(称为路由),用于确定网络流量的流向。VPC 中的每个子网必须与一个路由表相关联;而路由表控制子网的路由。

此路由表用于路由来自私有子网的流量。

69682026426

此路由表用于公有子网的流量

69682041729

创建VPC安全组

    • Security group name(安全组名称):Web Security Group
    • Description(描述):Enable HTTP access
    • VPC:选择 X 删除当前选择的 VPC,然后从下拉列表中选择 lab-vpc
  1. Inbound rules(入站规则)窗格中,选择 Add rule(添加规则)
  2. 配置以下设置:

    • Type(类型):HTTP
    • Source(源):Anywhere-IPv4
    • Description(描述):Permit web requests

69682072072

启动Web服务器实例

  1. 配置网络设置:

    • Network settings(网络设置)旁边,选择 Edit(编辑),然后配置:

      • Network(网络):lab-vpc
      • Subnet(子网):lab-subnet-public2私有!)
      • Auto-assign public IP(自动分配公有 IP):Enable(启用)
    • 接下来,您将实例配置为使用之前创建的 Web Security Group

      • Firewall (security groups)(防火墙(安全组))下,选择 Select existing security group(选择现有安全组)。
      • 对于 Common security groups(常见安全组),选择 Web Security Group
        此安全组将允许对实例进行 HTTP 访问。
  2. Configure storage(配置存储)部分中,保留默认设置。
    注意:默认设置指定实例的根卷(托管您之前指定的 Amazon Linux 来宾操作系统)在大小为 8 GiB 的通用型 SSD (gp3) 硬盘驱动器上运行。您也可以添加更多存储卷,但在本实验中不需要这样做。
  3. 配置一个脚本,在实例启动时在实例上运行此脚本:

    • 展开 Advanced details(高级详细信息)面板。
    • 滚动到页面底部,然后复制下面显示的代码并将其粘贴到 User data(用户数据)框中:

      #!/bin/bash
      # Install Apache Web Server and PHP
      dnf install -y httpd wget php mariadb105-server
      # Download Lab files
      wget https://aws-tc-largeobjects.s3.us-west-2.amazonaws.com/CUR-TF-100-ACCLFO-2/2-lab2-vpc/s3/lab-app.zip
      unzip lab-app.zip -d /var/www/html/
      # Turn on web server
      chkconfig httpd on
      service httpd start

      此脚本将在实例的来宾操作系统上以根用户权限运行,并且会在实例首次启动时自动运行。此脚本将安装一个 Web 服务器、一个数据库和 PHP 库,然后在 Web 服务器上下载并安装 PHP Web 应用程序。

69682147698

69682151894

]]>
0 https://www.xiongan.host/index.php/archives/223/#comments https://www.xiongan.host/index.php/feed/tag/%E5%AE%9E%E9%AA%8C/
【华为数通】MPLS-Vpn基础实验案例(企业级) https://www.xiongan.host/index.php/archives/222/ https://www.xiongan.host/index.php/archives/222/ Mon, 25 Sep 2023 16:08:29 +0800 admin MPLS-VPN基础实验案例

整体拓扑

image-20230925140615634

要求:某公司在北京设有总部并且在重庆设置分部。公司希望两个区域的员工可以通过私网路由互相访问。在网络边缘设备上使用BGP协议将私网路由发送给运营商,同时需要保证网络信息的安全性。R1,R2,R3,R4属于AS100模拟运营商。运营商内部使用OSPF协议实现IGP互通。在R1,R4建立MP-IBGP邻居,使用MPLS VPN技术使两个区域通过私网路由互访。

环境配置

首先配置好各个路由器的接口地址以及路由器的环回口地址

在R1上创建实例:

在R1上创建VPN实例1,并将实例1和接口G0/0/0绑定。需注意,在接口上进行实例的绑定后,原配置IP地址会清空,需要重新配置IP地址。
VPN实例用于将VPN私网路由域公网路由隔离,不同VPN实例中的路由也是相互隔离的。
在实例中需要配置RD值和RT值,RD用于区分每个VPN实例的VPN路由,最好保证RD值全网唯一,保证路由在公网传递时不冲突;RT值用于控制VPN路由信息的接收和发布。

image-20230925142249408

image-20230925142323710

在R4上创建实例:

image-20230925142614878

部署OSPF

在R1上配置ospf:

image-20230925142910235

在R2上配置ospf:

image-20230925143058675

在R3上配置ospf:

image-20230925143216232

在R4上配置ospf:

image-20230925143522497

在R5上配置ospf:

image-20230925143707104

在R6上配置ospf:

image-20230925143959619

在R1上查看邻居关系:

image-20230925144159861

可以观察到,R1与R2,R5成功建立OSPF邻居关系。

配置MPLS

在R1上配置mpls:

image-20230925144826948

在R2上配置mpls:

image-20230925151331473

在R3上配置mpls:

image-20230925145206723

在R4上配置mpls:

image-20230925145334917

配置BGP

在R1上配置BGP:

在R1与R4之间使用环回口建立IBGP邻居关系。

image-20230925145539149

在R4上配置BGP:

image-20230925145731150

在R1上查看BGO vpnv4邻居关系:

image-20230925145834905

在R1上路由引入:

在R1上将实例中的路由引入进BGP中,通过Vpn4路由向外通告,并将BGP的路由引入进OSPF实例下。由于BGP协议可承载的路由条目更多,为了防止后期引入路由条目过多,设备的负载压力过大,使用路由控制,只引入重庆分公司的路由。

image-20230925150245557

在R4上路由引入:

在R4上将实例中的路由引入进BGP中,通过Vpn4路由向外通告,并将BGP的路由引入进OSPF实例下。由于BGP协议可承载的路由条目更多,为了防止后期引入路由条目过多,设备的负载压力过大,使用路由控制,只引入北京总公司的路由。

在R1上查看标签交换路径:

可以观察到,在R1上有AS100内所有的32位环回口地址的FEC,并且为北京总公司的网络生成Vpnv4标签

image-20230925151724185

在R5上查看路由:

image-20230925151925064

可以观察到,R5通过OSPF学习到重庆分公司的6.6.6.6/32的路由。
本路由在R4上通过Vpnv4路由传递给R1,并在R1的OSPF实例下引入BGP路由学习到。

在R5上ping测试:

image-20230925152016442

]]>
0 https://www.xiongan.host/index.php/archives/222/#comments https://www.xiongan.host/index.php/feed/tag/%E5%AE%9E%E9%AA%8C/
【ENSP】GRE协议基础配置 https://www.xiongan.host/index.php/archives/210/ https://www.xiongan.host/index.php/archives/210/ Mon, 22 May 2023 19:07:26 +0800 admin GRE协议基础配置

本实验模拟企业网络场景,R1为企业总部的网关设备,并且内部有一台服务器,R3连接着企业分公司网关设备,R2为公网ISP设备。一般情况下,运营商只会维护自身的公网路由信息,而不会维护企业内部私网的路由信息,即运营商设备上的路由表中不会出现任何企业内部私网的路由条目。通过配置GRE实现公司总部和分部间私网路由信息的透传及数据通信。

拓扑实验

1684725003897

1684724964839

实验步骤

配置接口端口地址,根据上图信息进行配置

检测R1、R3直连链路的连通性

1684725679943

1684725739113

配置R1、R3默认路由

[R1]ip route-static 0.0.0.0 0.0.0.0 10.1.12.2
[R3]ip route-static 0.0.0.0 0.0.0.0 10.1.23.2

测试PC1和Server1的连通性

1684726077765

可以观察到,跨越了互联网的两个私网网段之间默认是无法直接通信的。此时可以通过GRE协议来实现跨越了互联网的两个私网网段之间的通信。

配置GRE Tunnel

配置R1、R3的GRE tunnel

在路由器R1、R3上配置GRE Tunnel,使用命令interface tunnel创建隧道接口,指定隧道模式为GRE。配置R1、R3 Tunnel接口的源地址为其S 1/0/0接口IP地址,目的地址为R1/R3的S 1/0/0接口IP地址。还要使用命令ip address配置Tunnel接口的IP地址,注意要在同一网段。

1684726463543

1684726570311

测试R1与目的地址的连通性

1684726676501

检查R1、R3隧道接口状态

1684726763561

1684726845074

检查R1、R3路由表

1684726889733

1684726908531

配置基于GRE接口的动态路由协议

测试PC1与Server1的连通性,发现还不能联通

1684727035010

配置R1、R3 RIPv2协议

1684727119110

1684727171142

检查R1、R3的RIP邻居

1684727223382

1684727242742

检查R1、R3路由表

1684727283255

1684727309531

测试PC1和Server1的连通性,可以看到已经联通

1684727349281

查看R2的路由表

1684727393881

]]>
0 https://www.xiongan.host/index.php/archives/210/#comments https://www.xiongan.host/index.php/feed/tag/%E5%AE%9E%E9%AA%8C/
【ENSP】RSTP和MSTP基础配置 https://www.xiongan.host/index.php/archives/209/ https://www.xiongan.host/index.php/archives/209/ Mon, 22 May 2023 19:00:23 +0800 admin RSTP、MSTP基础配置

实验组网

1684719281673

任务步骤

设备开启STP,并将STP模式切换为RSTP

[S1]stp enable
[S1]stp mode rstp
[S2]stp enable
[S2]stp mode rstp
[S3]stp enable
[S3]stp mode rstp
[S4]stp enable
[S4]stp mode rstp

1684720282267

查看STP的状态和统计信息摘要

1684720489701

1684720513926

1684720543670

1684720568088

在S1上查看STP的状态和统计信息(S1为根桥交换机)

1684720917704

根桥选举控制

配置S1为主根桥,S2为备份根桥

[S1]stp priority 4096
[S2]stp priority 8192

在另外两台交换机保持默认桥优先级(32768)的情况下,S1拥有最小的桥优先级,S2次之。

再次查看S1上的状态信息(此时S1的桥优先级为4096,并且此时仍然是根桥)

1684721119496

取消S1、S2上手动调整桥优先级的配置,使用stp root命令指定根桥和备份根桥

[S1]undo stp priority
[S1]stp root primary
[S2]undo stp priority
[S2]stp root secondary

查看S1和S2的stp状态信息

1684721311217

1684721329737

S1的桥优先级为0,而S2的桥优先级为4096,此时S1为根桥,S2为备份根桥。

修改接口开销控制根端口选举

在S4上查看stp状态和统计信息

1684721474502

S4上0/0/2拥有更小的RPC(根路径开销),从而成为根端口

查看S4的0/0/2的STP状态和统计信息

1684721623276

此时路径开销计算方法为Dotlt,接口的STP cost的值为20000

修改S4的0/0/2的STP cost值为40001

[S4]interface g0/0/2
[S4-GigabitEthernet0/0/2]stp cost 40001
[S4-GigabitEthernet0/0/2]

查看s4的STP状态信息

1684721879063

此时0/0/1的RPC为40000,小鱼0/0/2的RPC 40001 S4的0/0/1接口成为根端口

修改接口优先级控制根端口选举

查看S2的STP状态信息

1684722038120

S2上GE0/0/10、GE0/0/11接口收到的BPDU拥有相同的RPC、网桥ID、接口优先级,此时将会比较接收到的BPDU接口ID中的接口编号。

在S1、S2上开启LLDP,查看接口的互联关系

[S1]lldp enable
[S2]lldp enable
[S2]display lldp neighbor brief

1684722179609

S2的GE0/0/10接口对端为S1的GE0/0/10接口,S2的GE0/0/11接口对端为S1的GE0/0/11接口,S2的GE0/0/10接口接收到的BPDU拥有更小的接口编号,这是GE0/0/10成为根端口的原因

在S1上修改GE0/0/11的STP接口优先级,使其发送的BPDU优于 GE0/0/10发送的BPDU

[S1]interface GigabitEthernet 0/0/11
[S1-GigabitEthernet0/0/11] stp port priority 64

STP接口优先级为128,数值越小越优。

再次查看S2的stp状态信息

1684722305430

此时S2的GE0/0/10接口成为根端口。

MSTP基础配置

在所有交换机上创建VLAN10、20、30、40、50、60、70、80,配置MSTP域hcip,并创建两个新的实例:Instance 1、Instance 2,将VLAN10、30、50、70映射到Instance 1,将VLAN20、40、60、80映射到Instance 2,同时将SW1规划为MSTI1的主根桥、MSTI2的备份根桥,将SW2规划为MSTI2的主根桥、MSTI1的备份根桥。

[S1]vlan batch 10 20 30 40 50 60 70 80
[S2]vlan batch 10 20 30 40 50 60 70 80
[S3]vlan batch 10 20 30 40 50 60 70 80
[S4]vlan batch 10 20 30 40 50 60 70 80

将所有的互联接口(S1、S2、S3、S4)配置为Trunk接口,放通所有的(接口端口)Vlan

interface GigabitEthernet0/0/10
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40 50 60 70 80
#
interface GigabitEthernet0/0/11
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40 50 60 70 80
 stp instance 0 port priority 64
#
interface GigabitEthernet0/0/12
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40 50 60 70 80
#
interface GigabitEthernet0/0/13
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40 50 60 70 80

修改STP模式为MSTP

[S1]stp mode mstp
[S2]stp mode mstp
[S3]stp mode mstp
[S4]stp mode mstp

配置MSTP

[S1]stp region-configuration
[S1-mst-region] region-name hcip
[S1-mst-region] revision-level 1
[S1-mst-region] instance 1 vlan 10 30 50 70
[S1-mst-region] instance 2 vlan 20 40 60 80
[S1-mst-region] active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1-mst-region] quit
/
[S2]stp region-configuration
[S2-mst-region] region-name hcip
[S2-mst-region] revision-level 1
[S2-mst-region] instance 1 vlan 10 30 50 70
[S2-mst-region] instance 2 vlan 20 40 60 80
[S2-mst-region] active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[S2-mst-region] quit
/
[S3]stp region-configuration
[S3-mst-region] region-name hcip
[S3-mst-region] revision-level 1
[S3-mst-region] instance 1 vlan 10 30 50 70
[S3-mst-region] instance 2 vlan 20 40 60 80
[S3-mst-region] active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[S3-mst-region] quit
/
[S4]stp region-configuration
[S4-mst-region] region-name hcip
[S4-mst-region] revision-level 1
[S4-mst-region] instance 1 vlan 10 30 50 70
[S4-mst-region] instance 2 vlan 20 40 60 80
[S4-mst-region] active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[S4-mst-region] quit

在S1上检查MSTP实例和Vlan的映射关系

1684722873417

//配置SW1为MSTI1的根桥、MSTI2的备份根桥
[S1]stp instance 1 root primary 
[S1]stp instance 2 root secondary
//配置SW2为MSTI2的根桥、MSTI1的备份根桥
[S2]stp instance 1 root secondary 
[S2]stp instance 2 root primary

在S1上查看MST1状态信息

1684724119504

S1上所有接口都是指定接口,S1为MSTI1的根桥

1684724164486

S2上所有接口都是指定接口,S2为MSTI2的根桥。

]]>
0 https://www.xiongan.host/index.php/archives/209/#comments https://www.xiongan.host/index.php/feed/tag/%E5%AE%9E%E9%AA%8C/
【k8s】标签Label与Label Selector https://www.xiongan.host/index.php/archives/207/ https://www.xiongan.host/index.php/archives/207/ Tue, 16 May 2023 20:43:42 +0800 admin Label与Label Selector

标签

进入目录保存实验文件

并创建一个yaml使用多个标签

[root@master tz123]# cd /root/tz123/labfile/labelfile
[root@master labelfile]# vim labelpod.yaml
kind: Pod
apiVersion: v1
metadata:
  name: labelpod
  labels:
    app: busybox
    version: new
spec:
  containers:
    - name: labelpod
      image: busybox
      args:
      - /bin/sh
      - -c
      - sleep 30000

创建Pod,并查看pod的label

[root@master labelfile]# kubectl apply -f labelpod.yaml 
pod/labelpod created
[root@master labelfile]# kubectl get pod --show-labels
NAME       READY   STATUS    RESTARTS   AGE   LABELS
labelpod   1/1     Running   0          11s   app=busybox,version=new

为容器添加新标签

[root@master labelfile]# kubectl label pod labelpod time=2019
pod/labelpod labeled
[root@master labelfile]# kubectl get pod --show-labels
NAME       READY   STATUS    RESTARTS   AGE   LABELS
labelpod   1/1     Running   0          69s   app=busybox,time=2019,version=new

标签选择器

创建新的yaml

[root@master labelfile]# vim labelpod2.yaml
kind: Pod
apiVersion: v1
metadata:
  name: labelpod2
  labels:
    app: httpd
    version: new
spec:
  containers:
    - name: httpd
      image: httpd

创建并查看新创建的labelpod2

[root@master labelfile]# kubectl apply -f labelpod2.yaml
[root@master labelfile]# kubectl get pod --show-labels
NAME        READY   STATUS              RESTARTS   AGE   LABELS
labelpod    1/1     Running             0          12m   app=busybox,time=2019,version=new
labelpod2   0/1     ContainerCreating   0          23s   app=httpd,version=new

使用给予等值的标签选择器

[root@master labelfile]# kubectl get pod -l app=httpd
NAME        READY   STATUS    RESTARTS   AGE
labelpod2   1/1     Running   0          100s
或
[root@master labelfile]# kubectl get pod -l app==httpd
NAME        READY   STATUS    RESTARTS   AGE
labelpod2   1/1     Running   0          114s

使用基于不等值的标签选择器和查看pod针对某标签键的值

[root@master labelfile]# kubectl get pod -l app!=httpd
NAME       READY   STATUS    RESTARTS   AGE
labelpod   1/1     Running   0          14m
[root@master labelfile]# kubectl get pod -L app
NAME        READY   STATUS    RESTARTS   AGE    APP
labelpod    1/1     Running   0          15m    busybox
labelpod2   1/1     Running   0          3m5s   httpd

使用标签选择器实现调度

将节点1打上标签并查看

[root@master labelfile]# kubectl label node node env=test
node/node labeled
[root@master labelfile]# kubectl get node -L env
NAME     STATUS   ROLES                  AGE   VERSION   ENV
master   Ready    control-plane,master   91d   v1.20.6   
node     Ready    <none>                 91d   v1.20.6   test

使用nodeselector实现调度,创建新的yaml文件

[root@master labelfile]# vim nsdeploy.yaml
kind: Deployment
apiVersion: apps/v1
metadata:
  name: nginx-dy
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.7.9
        ports:
        - containerPort: 80
      nodeSelector:
        env: test

查看deployment中的pod位置

[root@master labelfile]# kubectl get pod -o wide
NAME                        READY   STATUS    RESTARTS   AGE     IP               NODE   NOMINATED NODE   READINESS GATES
labelpod                    1/1     Running   0          28m     10.244.167.145   node   <none>           <none>
labelpod2                   1/1     Running   0          15m     10.244.167.146   node   <none>           <none>
nginx-dy-6dd6c76bcb-667ss   1/1     Running   0          5m19s   10.244.167.148   node   <none>           <none>
nginx-dy-6dd6c76bcb-q8tqh   1/1     Running   0          5m19s   10.244.167.149   node   <none>           <none>
nginx-dy-6dd6c76bcb-xc9h7   1/1     Running   0          5m19s   10.244.167.147   node   <none>           <none>

使用 node affinity 调度,创建一个新的 yaml 文件 nadeploy2.yaml

[root@master labelfile]# vim nadeploy2.yaml
kind: Deployment
apiVersion: apps/v1
metadata:
  name: httpd-dy
  labels:
    app: httpd
spec:
  replicas: 3
  selector:
    matchLabels:
      app: httpd
  template:
    metadata:
      labels:
        app: httpd
    spec:
      containers:
      - name: httpd
        image: httpd
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: env
                operator: In
                values:
                - test

创建deployment并查看deployment中的pod位置,三个pod都在node上

[root@master labelfile]# kubectl apply -f nadeploy2.yaml 
deployment.apps/httpd-dy created
[root@master labelfile]# kubectl get pod -o wide
NAME                        READY   STATUS              RESTARTS   AGE   IP               NODE   NOMINATED NODE   READINESS GATES
httpd-dy-5b4bb9646-g4jzb    1/1     Running             0          33s   10.244.167.150   node   <none>           <none>
httpd-dy-5b4bb9646-lb876    1/1     Running             0          33s   10.244.167.151   node   <none>           <none>
httpd-dy-5b4bb9646-q7zcm    0/1     ContainerCreating   0          33s   <none>           node   <none>           <none>
labelpod                    1/1     Running             0          38m   10.244.167.145   node   <none>           <none>
labelpod2                   1/1     Running             0          26m   10.244.167.146   node   <none>           <none>
nginx-dy-6dd6c76bcb-667ss   1/1     Running             0          15m   10.244.167.148   node   <none>           <none>
nginx-dy-6dd6c76bcb-q8tqh   1/1     Running             0          15m   10.244.167.149   node   <none>           <none>
nginx-dy-6dd6c76bcb-xc9h7   1/1     Running             0          15m   10.244.167.147   node   <none>           <none>

实训任务

创建一个deployment

使用镜像nginx,5个副本

deployment中的pod不能出现在node上

[root@master labelfile]# vim shixun01.yaml
kind: Deployment
apiVersion: apps/v1
metadata:
  name: nginx-dy
  labels:
    app: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: env
                operator: Not In
                values:
                - node

寻找一种方式搜索出kubernetes系统上提供core-dns,kubeproxy以及dashboard服务的pod

先给core-dns,kubeproxy,dashboard打上标签

68422694647

[root@master labelfile]# kubectl label -n kube-system pod kube-proxy-kj8j5 app=kubeproxy
[root@master labelfile]# kubectl label -n kube-system pod coredns-7f89b7bc75-n224r app=coredns

查找关键词的pod

68422698315

搜索dashboard的pod

68422720762

使用标签和标签选择器,使用一条命令删除node2节点的nginx

68422750468

]]>
0 https://www.xiongan.host/index.php/archives/207/#comments https://www.xiongan.host/index.php/feed/tag/%E5%AE%9E%E9%AA%8C/
【HCIP】路由策略与路由控制 https://www.xiongan.host/index.php/archives/203/ https://www.xiongan.host/index.php/archives/203/ Sat, 06 May 2023 20:24:50 +0800 admin 路由策略与路由控制

实验组网

1682218215575

每台设备都创建了Loopback0,地址为10.123.x.x/32(x为设备号)

在R2、R4上测试ip连通性

1682218707426

1682218720689

配置OSPF、IS-IS

R1、R2、R3使用Loopback0接口地址作为Router ID,在互联接口、Loopback0接口上激活OSPF。

//R1
[R1]ospf 1 router-id 10.123.1.1
[R1-ospf-1] area 0
[R1-ospf-1-area-0.0.0.0] network 10.123.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0] network 10.123.12.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0] quit
[R1-ospf-1] quit

1682219138575

//R2
[R2]ospf 1 router-id 10.123.2.2
[R2-ospf-1] area 0.0.0.0
[R2-ospf-1-area-0.0.0.0] network 10.123.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0] network 10.123.12.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0] network 10.123.23.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0] quit
[R2-ospf-1] quit

1682219234462

//R3
[R3]ospf 1 router-id 10.123.3.3
[R3-ospf-1] area 0.0.0.0
[R3-ospf-1-area-0.0.0.0] network 10.123.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0] network 10.123.23.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0] quit
[R3-ospf-1] quit

1682219275126

在R2上检查OSPF邻居概要信息

1682219311591

R3、R4上配置IS-IS,区域为49.0001,系统ID采用0000.0000.000x格式(x为设备编号),两台设备都为Level-1路由器,在互联接口、R4的Loopback0接口上激活IS-IS。

//R3
[R3]isis 1
[R3-isis-1] is-level level-1
[R3-isis-1] network-entity 49.0001.0000.0000.0003.00
[R3-isis-1] quit
[R3]interface GigabitEthernet0/0/1
[R3-GigabitEthernet0/0/1] isis enable 1
[R3-GigabitEthernet0/0/1] quit

1682219708071

//R4
[R4]isis 1
[R4-isis-1] is-level level-1
[R4-isis-1] network-entity 49.0001.0000.0000.0004.00
[R4-isis-1] quit
[R4]interface GigabitEthernet0/0/0
[R4-GigabitEthernet0/0/0] isis enable 1
[R4-GigabitEthernet0/0/0] quit
[R4]interface LoopBack 0
[R4-LoopBack0] isis enable 1
[R4-LoopBack0] quit

1682219778719

在R3上检查IS-IS邻居状态

1682219823838

在R1上引入直连路由

创建IP前缀列表1,匹配Loopback1接口路由(A业务网段)

[R1]ip ip-prefix 1 index 10 permit 172.16.1.0 24 greater-equal 24 less-equal 24

创建IP前缀列表2,匹配Loopback2接口路由(B业务网段)

[R1]ip ip-prefix 2 index 10 permit 172.16.2.0 24 greater-equal 24 less-equal 24

1682220874885

创建Route-Policy hcip,并创建节点10、20,分别调用IP前缀列表1、2,打上路由标记

[R1]route-policy hcip permit node 10
[R1-route-policy] if-match ip-prefix 1
[R1-route-policy] apply tag 10
[R1-route-policy] quit
[R1]route-policy hcip permit node 20
[R1-route-policy] if-match ip-prefix 2
[R1-route-policy] apply tag 20 
[R1-route-policy] quit

1682220900637

在R1的OSPF中引入直连路由,调用Route-Policy hcip

[R1]ospf 1
[R1-ospf-1] import-route direct route-policy hcip

1682220936669

在R1上查看OSPF LSDB

1682220968693

Loopback1、2接口路由已经被成功引入OSPF中

在R1上查看OSPF LSDB中AS-external LSA 172.16.1.0、172.16.2.0的相关信息

1682221042318

在R2上配置过滤策略

在R2上配置Filter-Policy对接收的OSPF路由进行过滤,只接收B业务网段的路由。

查看配置Filter-Policy前的OSPF路由表

1682221201853

查看配置Filter-Policy前的IP路由表中的OSPF路由

1682221298477

配置基础ACL

[R2]acl number 2000
[R2-acl-basic-2000] rule 5 deny source 172.16.1.0 0.0.0.255
[R2-acl-basic-2000] rule 10 permit

1682221695477

在OSPF中部署入方向的Filter-Policy,调用ACL 2000

[R2]ospf 1
[R2-ospf-1] filter-policy 2000 import

1682221843867

查看配置Filter-Policy后的OSPF路由表

1682221875196

查看配置Filter-Policy后的IP路由表中的OSPF路由

1682222005316

在IP路由表中路由172.16.2.0/24已经不存在,但是在OSPF路由表中依旧存在。这验证了对于OSPF,Filter-Policy只是限制路由加入IP路由表,不影响本地的LSDB以及LSA的传递。

在R3上查看IP路由表中的OSPF路由

1682222044354

R3的IP路由表中OSPF外部路由172.16.1.0/24、172.16.2.0/24依旧存在

在R3上将OSPF路由引入到IS-IS

在R3上将OSPF路由引入到IS-IS中,通过Route-Policy匹配路由标记,只引入A业务网段的OSPF外部路由。

创建Route-Policy hcip

[R3]route-policy hcip permit node 10
[R3-route-policy] if-match tag 10
[R3-route-policy] quit

1682222232010

在IS-IS中引入OSPF路由,调用Route-Policy hcip只引入A业务网段的OSPF外部路由

[R3]isis 1
[R3-isis-1] import-route ospf 1 level-1 route-policy hcip

1682222248020

查看R3的IS-IS路由表

1682222273164

Level-1的路由重分发表中只有172.16.1.0/24。

]]>
0 https://www.xiongan.host/index.php/archives/203/#comments https://www.xiongan.host/index.php/feed/tag/%E5%AE%9E%E9%AA%8C/
【BGP】BGP路由优选 https://www.xiongan.host/index.php/archives/202/ https://www.xiongan.host/index.php/archives/202/ Fri, 21 Apr 2023 18:18:36 +0800 admin BGP路由优选

实验组网

image-20230417105035681

R2、R3、R4各添加Loopback0 接口
10.123.x.x

测试R2、R4的连通性

image-20230417105816250

image-20230417105829529

配置OSPF 64512

//配置R2,激活OSPF
[R2]ospf 1 router-id 10.123.2.2
[R2-ospf-1] area 0.0.0.0
[R2-ospf-1-area-0.0.0.0] network 10.123.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0] network 10.123.23.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0] quit
[R2-ospf-1] quit
//配置R3.激活OSPF
[R3]ospf 1 router-id 10.123.3.3
[R3-ospf-1] area 0.0.0.0
[R3-ospf-1-area-0.0.0.0] network 10.123.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0] network 10.123.23.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0] network 10.123.34.3 0.0.0.0 
[R3-ospf-1-area-0.0.0.0] quit
[R3-ospf-1] quit
//配置R4,激活OSPF
[R4]ospf 1 router-id 10.123.4.4
[R4-ospf-1] area 0.0.0.0
[R4-ospf-1-area-0.0.0.0] network 10.123.4.4 0.0.0.0
[R4-ospf-1-area-0.0.0.0] network 10.123.34.4 0.0.0.0 
[R4-ospf-1-area-0.0.0.0] quit
[R4-ospf-1] quit

在R3查看ospf的邻居信息

image-20230417110451401

查看OSPF路由表

image-20230417111308299

配置BGP对等体

//配置R1
[R1]bgp 100
[R1-bgp] router-id 10.123.1.1
[R1-bgp] peer 10.123.12.2 as 64512
//配置R2
[R2]bgp 64512
[R2-bgp] router-id 10.123.2.2
[R2-bgp] peer 10.123.3.3 as-number 64512
[R2-bgp] peer 10.123.3.3 connect-interface LoopBack0
[R2-bgp] peer 10.123.3.3 next-hop-local
[R2-bgp] peer 10.123.12.1 as-number 100
//配置R3
[R3]bgp 64512
[R3-bgp] router-id 10.123.3.3
[R3-bgp] peer 10.123.2.2 as-number 64512
[R3-bgp] peer 10.123.2.2 connect-interface LoopBack0
[R3-bgp] peer 10.123.4.4 as-number 64512
[R3-bgp] peer 10.123.4.4 connect-interface LoopBack0
//配置R4
[R4]bgp 64512
[R4-bgp] router-id 10.123.4.4
[R4-bgp] peer 10.123.3.3 as-number 64512
[R4-bgp] peer 10.123.3.3 connect-interface LoopBack0
[R4-bgp] peer 10.123.3.3 next-hop-local
[R4-bgp] peer 10.123.45.5 as-number 200
//配置R5
[R5]bgp 200
[R5-bgp] router-id 10.123.5.5
[R5-bgp] peer 10.123.45.4 as 64512

在R2、R4上检查BGP对等体状态

image-20230417112418938

image-20230417112435610

路由发布到BGP中
//R1
[R1]bgp 100
[R1-bgp] network 172.16.1.0 24
[R1-bgp] network 172.16.2.0 24
[R1-bgp] network 172.16.3.0 24
[R1-bgp] network 172.16.4.0 24
//R5
[R5]bgp 200
[R5-bgp] network 172.16.1.0 24
[R5-bgp] network 172.16.2.0 24
[R5-bgp] network 172.16.3.0 24
[R5-bgp] network 172.16.4.0 24
查看R3的路由表,查看BGP是否学习

image-20230417115946237

修改AS_Path属性

//创建IP前缀列表1,匹配Loopback1接口路由
[R1]ip ip-prefix 1 permit 172.16.1.0 24 greater-equal 24 less-equal 24
//创建Route-Policy hcip,并创建节点10,在其中调用IP前缀列表1,修改AS_Path属性值
[R1]route-policy hcip permit node 10
[R1-route-policy] if-match ip-prefix 1
[R1-route-policy] apply as-path 300 400 additive
[R1-route-policy] quit
[R1]route-policy hcip permit node 20
//对向BGP对等体R2通告的BGP路由应用Route-Policy
[R1]bgp 100
[R1-bgp] peer 10.0.12.2 route-policy hcip export
//在R1上触发出方向的软复位,刷新对外通告的BGP路由
<R1>refresh bgp all export

在R3上查看BGP路由172.16.1.0/24的信息

image-20230417120211488

此时R3优选R4通告的BGP路由172.16.1.0/24,R2通告的未被优选的原因是AS_Path长度。

修改Local_Preference属性

创建IP前缀列表1,匹配BGP路由172.16.2.0/24

[R4]ip ip-prefix 1 permit 172.16.2.0 24 greater-equal 24 less-equal 24

image-20230421115545426

创建Route-Policy hcip,并创建节点10,在其中调用IP前缀列表1,修改Local_Preference属性值

[R4]route-policy hcip permit node 10
[R4-route-policy] if-match ip-prefix 1
[R4-route-policy] apply local-preference 200
[R4-route-policy] quit
[R4]route-policy hcip permit node 20

image-20230421115653744

对向BGP对等体R3通告的BGP路由应用Route-Policy

[R4]bgp 64512
[R4-bgp] peer 10.0.3.3 route-policy hcip export

image-20230421115826726

刷新对外通告BGP路由

<R4>refresh bgp all export

在R3上查看BGP路由172.16.2.0/24的明细信息

image-20230421120133683

此时R3优选R4通告的BGP路由172.16.2.0/24,R2通告的BGP路由其Local_Preference值为100,小于R3通告的BGP路由Local_Preference值200,因此R2通告的BGP路由未被优选。

修改MED属性

在R2上使得R3优选R5发布的BGP路由172.16.3.0/24

//ip前缀列表1 匹配GBP路由172.16.3.0/24
[R2]ip ip-prefix 1 permit 172.16.3.0 24 greater-equal 24 less-equal 24

创建Route-Policy hcip,并创建节点10,在其中调用IP前缀列表1,修改MED属性值

[R2]route-policy hcip permit node 10
[R2-route-policy] if-match ip-prefix 1
[R2-route-policy] apply cost 200
[R2-route-policy] quit
[R2]route-policy hcip permit node 20

对来自BGP对等体R1的BGP路由应用Route-Policy

[R2]bgp 64512
[R2-bgp] peer 10.0.12.1 route-policy hcip import

在R2刷新接收到的BGP路由

<R2>refresh bgp all import

在R3上配置允许来自不同AS的BGP路由的MED值

[R3]bgp 64512
[R3-bgp] compare-different-as-med

在R3上查看BGP路由172.16.3.0/24的明细信息

image-20230421170741680

R2通告的BGP路由172.16.3.0/24其MED值为200,而R4通告BGP路由MED值为0,R3优选MED值较小的BGP路由,因此R2通告的BGP路由未被优选。

修改preferred-value属性

修改R3的路由的pre-value属性的策略,使得R3优选R4通告的BGP路由172.16.4.0/24

创建IP前缀列表1,匹配BGP路由172.16.4.0/24

[R3]ip ip-prefix 1 permit 172.16.4.0 24 greater-equal 24 less-equal 24

创建Route-Policy hcip,并创建节点10,在其中调用IP前缀列表1,修改preferred-value属性值

[R3]route-policy hcip permit node 10
[R3-route-policy] if-match ip-prefix 1
[R3-route-policy] apply preferred-value 300
[R3-route-policy] quit
[R3]route-policy hcip permit node 20

对来自BGP对等体R4的BGP路由应用Route-Policy

[R3]bgp 64512
[R3-bgp] peer 10.123.4.4 route-policy hcip import

R3刷新收到的路由并查看BGP路由172.16.4.0/24的信息

image-20230421171636819

R4通告的BGP路由172.16.3.0/24其preferred-value值为300,而R2通告的preferred-value值为0,R3优选preferred-value值较大的BGP路由,因此R3优选R4通告的BGP路由。

修改Origin属性

在R1、R5上创建Loopback5接口,将接口路由发布到BGP中,验证Origin属性为IGP的BGP路由优于Origin属性为Incomplete的BGP路由。

R1、R5上创建Loopback5,IP地址为172.16.5.1/24

[R1]interface LoopBack 5
[R1-LoopBack5] ip address 172.16.5.1 24
[R1-LoopBack5] quit
[R5]interface LoopBack 5
[R5-LoopBack5] ip address 172.16.5.1 24
[R5-LoopBack5] quit

在R1、R5上将Loopback5接口路由发布到BGP中,通过network方式

[R1]bgp 100
[R1-bgp] network 172.16.5.0 24
[R5]bgp 200
[R5-bgp] network 172.16.5.0 24

在R3上查看BGP路由表

image-20230421172459858

此时R3上优选R2通告(由R1发布)的BGP路由172.16.5.0/24,此时R2、R4通告的BGP路由Origin属性值都为IGP。

在R1上取消将Loopback5接口路由发布到BGP

image-20230421172759346

创建IP前缀列表2,匹配R1 Loopback5接口路由172.16.5.0/24

[R1]ip ip-prefix 2 permit 172.16.5.0 24 greater-equal 24 less-equal 24

image-20230421172900846

创建Route-Policy origin,并创建节点10,在其中调用IP前缀列表2

[R1]route-policy origin permit node 10
[R1-route-policy] if-match ip-prefix 2
[R1-route-policy] quit

image-20230421173121348

R1上修改为使用import-route direct将直连路由发布到BGP,调用Route-Policy origin限制只引入Loopback5接口路由

[R1]bgp 100
[R1-bgp] import-route direct route-policy origin

image-20230421173415965

在R3上查看BGP路由172.16.5.0/24的明细信息

image-20230421173512347

此时R3优选R4通告的BGP路由172.16.5.0/24。

R2通告(R1发布)的BGP路由172.16.5.0/24此时Origin属性值为incomplete(通过import-route方式发布到BGP),由于Origin属性值原因,该条路由未被优选。

验证BGP优选到Nex_Hop的IGP度量值最小的路由

R2、R4之间基于环回口建立IBGP对等体关系,在R2、R3上建立Loopback7接口并将接口路由发布到BGP中,在R4上观察BGP路由优选情况。

R2、R4之间建立IBGP对等体关系

[R2]bgp 64512
[R2-bgp] peer 10.0.4.4 as-number 64512
[R2-bgp] peer 10.0.4.4 connect-interface LoopBack 0

[R4]bgp 64512
[R4-bgp] peer 10.0.2.2 as-number 64512
[R4-bgp] peer 10.0.2.2 connect-interface LoopBack0

检查IBGP对等体关系状态

image-20230421174136728

R2、R4上创建Loopback7接口,并将接口路由发布到BGP

[R2]interface LoopBack 7
[R2-LoopBack7] ip address 172.16.7.1 24
[R2-LoopBack7] quit
[R2]bgp 64512
[R2-bgp] network 172.16.7.0 24

[R3]interface LoopBack 7
[R3-LoopBack7] ip address 172.16.7.1 24
[R3-LoopBack7] quit
[R3]bgp 64512
[R3-bgp] network 172.16.7.0 24

在R4上查看BGP路由172.16.7.0/24的明细信息

image-20230421180929836

R4优选R3发布的BGP路由,其IGP cost为1,小于R2发布的BGP路由IGP cost 2。

R2发布的BGP路由未被优选的原因为IGP cost。

]]>
0 https://www.xiongan.host/index.php/archives/202/#comments https://www.xiongan.host/index.php/feed/tag/%E5%AE%9E%E9%AA%8C/
【mininet】Opendaylight下的路由实验 https://www.xiongan.host/index.php/archives/200/ https://www.xiongan.host/index.php/archives/200/ Tue, 18 Apr 2023 21:12:00 +0800 admin 简单的路由实验

路由实验

首先运行Opendaylight,并安装好组件

68155958600

编辑路由脚本脚本

#!/usr/bin/python
import time
from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSKernelSwitch,UserSwitch
from mininet.cli import CLI
from mininet.log import setLogLevel
from mininet.link import Link, TCLink
def topology():
    "Create a network."
    net = Mininet( controller=RemoteController, link=TCLink, switch=OVSKernelSwitch )
    print "*** Creating nodes ***"
    h1 = net.addHost( 'h1', mac='00:00:00:00:00:01', ip='10.123.10.1/24' )
    h2 = net.addHost( 'h2', mac='00:00:00:00:00:02', ip='10.123.10.2/24' )
    h3 = net.addHost( 'h3', mac='00:00:00:00:00:03', ip='10.123.1.1/24' )
    s1 = net.addSwitch( 's1', listenPort=6673, mac='00:00:00:00:00:11' )
    s2 = net.addSwitch( 's2', listenPort=6674, mac='00:00:00:00:00:12' )
    c0 = net.addController( 'c0', controller=RemoteController, ip='127.0.0.1', port=6633 )
    print "*** Creating links ***"
    net.addLink(s1, h1, 1, 0)
    net.addLink(s2, h3, 1, 0)
    Link(h2, s1, intfName1='h2-eth0')
    Link(h2, s2, intfName1='h2-eth1')
    h2.cmd('ifconfig h2-eth1 10.123.1.2 netmask 255.255.255.0')
    h2.cmd('sysctl net.ipv4.ip_forward=1')
    h1.cmd('route add default gw 10.123.10.2')
    h3.cmd('route add default gw 10.123.1.2')
    print "*** Starting network ***"
    net.build()
    c0.start()
    s1.start( [c0] )
    s2.start( [c0] )
    print "*** Running CLI ***"
    CLI( net )
    print "*** Stopping network ***"
    net.stop()
if __name__ == '__main__':
    setLogLevel( 'info' )
    topology()

运行脚本

python router.py

68155974153

两个交换机下发转发规则:

root@guest-virtual-machine:/home/guest# ovs-ofctl add-flow s1 in_port=1,actions=output:2
root@guest-virtual-machine:/home/guest# ovs-ofctl add-flow s1 in_port=2,actions=output:1
root@guest-virtual-machine:/home/guest# ovs-ofctl add-flow s2 in_port=1,actions=output:2
root@guest-virtual-machine:/home/guest# ovs-ofctl add-flow s2 in_port=2,actions=output:1

在CLI命令行里执行

mininet> h1 route add default gw 10.123.10.2
mininet> h3 route add default gw 10.123.1.2
mininet> h1 ping 10.123.10.2
mininet> h1 ping 10.123.1.2

68156011191

这时候再次测试h1 ping h3 就可以通

68156034980

举例

环境继承上述,再添加一个h4,使他们都可以通

mininet> py net.addHost( 'h4', mac='00:00:00:00:00:04', ip='10.123.123.1/24' )
mininet> py net.addSwitch( 's3', listenPort=6675, mac='00:00:00:00:00:13' )

image-20230416143505205

创建链路

mininet> py net.addLink(s3, h4, 1, 0)
mininet> py net.addLink(h2, s3, intfName1='h2-eth2')

image-20230416145756561

环境继承上述,再添加一个h4,使他们都可以通

//添加h4设备
h4 = net.addHost( 'h4', mac='00:00:00:00:00:04', ip='10.123.123.1/24' )
//添加s3交换机
s3 = net.addSwitch( 's3', listenPort=6675, mac='00:00:00:00:00:13' )
//添加s3和h4的链路
net.addLink(s3, h4, 1, 0)
//设置ip端口
h2.cmd('ifconfig h2-eth2 10.123.123.2 netmask 255.255.255.0')
//设置h4的网关
h4.cmd('route add default gw 10.123.123.2')
//开启s3
s3.start( [c0] )

8908

0230

0230

0230

0230

0230

]]>
0 https://www.xiongan.host/index.php/archives/200/#comments https://www.xiongan.host/index.php/feed/tag/%E5%AE%9E%E9%AA%8C/