春风十里不如你 —— Taozi - ping https://www.xiongan.host/index.php/tag/ping/ 【华为数通】MPLS的基础配置 https://www.xiongan.host/index.php/archives/221/ 2023-09-19T12:30:45+08:00 MPLS的基础配置整体拓扑首先配置各个路由器及接口ip地址配置OSPFR1: [R1-ospf-1]dis this [V200R003C00] # ospf 1 router-id 1.1.1.1 area 0.0.0.0 network 10.1.1.1 0.0.0.0 network 10.123.12.1 0.0.0.0 # return R2: [R2-ospf-1]dis this [V200R003C00] # ospf 1 router-id 2.2.2.2 area 0.0.0.0 network 10.123.12.2 0.0.0.0 network 10.123.23.2 0.0.0.0 network 20.1.1.1 0.0.0.0 # return R3: [R3-ospf-1]dis this [V200R003C00] # ospf 1 router-id 3.3.3.3 area 0.0.0.0 network 10.123.23.3 0.0.0.0 network 10.123.34.3 0.0.0.0 network 30.1.1.1 0.0.0.0 # return R4: [R4-ospf-1]dis this [V200R003C00] # ospf 1 router-id 4.4.4.4 area 0.0.0.0 network 10.123.34.4 0.0.0.0 network 10.123.45.4 0.0.0.0 network 40.1.1.1 0.0.0.0 # return R5: [R5-ospf-1]dis this [V200R003C00] # ospf 1 router-id 5.5.5.5 area 0.0.0.0 network 10.123.45.5 0.0.0.0 # return在R9上检查路由表配置MPLS在R1上配置MPLS在R2上配置MPLS在R3上配置MPLS在R4上配置MPLS配置MPLS 静态LSP在R1上配置静态LSPR1作为ingress设备在去往40.1.1.1/32和 10.123.45.0/24网络时打上标签,同时作为egress设备,当收到标签为201或者205时弹出标签进行路由转发。[R1]static-lsp ingress 1to4 destination 40.1.1.1 32 nexthop 10.123.12.2 out-labe l 104 [R1]static-lsp ingress 1to45 destination 10.123.45.0 24 nexthop 10.123.12.2 out- label 105 [R1]static-lsp egress 4to1 incoming-interface g0/0/0 in-label 201 [R1]static-lsp egress 45to1 incoming-interface g0/0/0 in-label 205在R2上配置静态LSPR2作为Transit设备进行标签的交换。[R2]static-lsp transit 1to4 incoming-interface GigabitEthernet 0/0/0 in-label 10 4 nexthop 10.123.23.3 out-label 204 [R2]static-lsp transit 1to45 incoming-interface GigabitEthernet 0/0/0 in-label 1 05 nexthop 10.123.23.3 out-label 205 [R2]static-lsp transit 4to1 incoming-interface GigabitEthernet0/0/1 in-label 301 nexthop 10.123.12.1 out-label 201 [R2]static-lsp transit 45to1 incoming-interface GigabitEthernet0/0/1 in-label 30 5 nexthop 10.123.12.1 out-label 205在R3上配置静态LSPR3作为Transit设备进行标签交换。[R3]static-lsp transit 1to4 incoming-interface GigabitEthernet 0/0/0 in-label 20 4 nexthop 10.123.34.4 out-label 304 [R3]static-lsp transit 4to1 incoming-interface GigabitEthernet0/0/1 in-label 401 nexthop 10.123.23.2 out-label 301 [R3]static-lsp transit 1to45 incoming-interface GigabitEthernet 0/0/0 in-label 2 05 nexthop 10.123.23.3 out-label 305 [R3]static-lsp transit 45to1 incoming-interface GigabitEthernet0/0/1 in-label 40 5 nexthop 10.123.23.2 out-label 305在R4上配置静态LSPR4与R1类似,同样既作为ingress设备又作为egress设备。作为ingress设备在去往40.1.1.1/32和 10.123.45.0/24网络时打上标签,同时作为egress设备,当收到标签为201或者205时弹出标签进行路由转发。[R4]static-lsp egress 1to4 incoming-interface g0/0/0 in-label 304 [R4]static-lsp egress 1to45 incoming-interface g0/0/0 in-label 305 [R4]static-lsp ingress 4to1 destination 10.1.1.1 32 nexthop 10.123.34.3 out-labe l 401在R1上查看标签交换路径:标签路径中有In/Out Label,在mpls中,Out Label为空时,表示该FEC是由本路由器向上游发布标签,该路由器一般是该FEC的egress设备。In Label是指本路由器为某个FEC分配给对端的Out Label标签,当In Label为空时,表示本路由器是该LSP的最上游路由器,一般是ingress设备。在R2上查看在R3上查看在R4上查看在R1上Ping测试右键点击R1设备,选择数据抓包中的G0/0/0接口进行抓包。在R1上带环回口ping测试R4的环回口地址。进入抓包界面,点击源为10.1.1.1,目的地址为40.1.1.1的数据包查看。我们可以观察到,在数据包中存在MPLS的头部,由此,判断出10.1.1.1访问40.1.1.1走的是MPLS的路径。 【docker】完成跨主机通信 https://www.xiongan.host/index.php/archives/176/ 2022-11-16T10:58:00+08:00 实验要求掌握利用Docker实现跨主机容器互连的方法。前置准备要求实验主机能够连接外网,已经正确安装Docker,并关闭防火墙和selinux,各主机配置信息如表1-1所示。表1-1 主机配置信息表主机名IP地址/子网掩码容器名node1192.168.123.88/24Centosnode2192.168.123.99/24Centos实验步骤步骤1:创建跨主机的容器,测试连通性。步骤2:设置域名解析。步骤3:安装etcd和flannel服务。node01需要安装两个服务(etcd、flannel),node02需要安装一个服务(flannel)步骤4:编辑etcd配置文件并启动etcd服务。node01节点注:1.ETCD_DATA_DIR为etcd数据存放路径 2.ETCD_LISTEN_CLIENT_URLS为监听客户端地址 3.ETCD_NAME为节点名称 4.ETCD_ADVERTISE_CLIENT_URLS为通知etcd服务器步骤5:测试etcd服务。node01节点:步骤6:设置网络网段。node01节点:注:查看容器ipdocker inspect 容器名/id | grep IPAddress步骤7:配置并重启flannel服务。步骤8:配置flannel0与docker0之间的网络。(两个节点)步骤9:设置防火墙。(两个节点)步骤10:启动容器,测试连通性。(两个节点)