centos7部署k8s集群

環境準備

服務器三臺

10.0.0.70master

10.0.0.71worker1

10.0.0.72worker2

配置yum源(集群機器執行)

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
安裝常用軟件
yum -y install lrzsz vim  net-tools

關閉firewall(集群機器執行)

systemctl stop firewalld
systemctl disable firewalld

查看selinux,設置關閉(集群機器執行)

getenforce
#開啟狀態執行以下命令,需要重啟服務器生效
sed -i 's/enforcing/disabled/' /etc/selinux/config

三臺服務器添加hosts,并更改主機名(先集群機器執行再對應執行)

cat >> /etc/hosts << EOF
10.0.0.70 k8s-master
10.0.0.71 k8s-worker1
10.0.0.72 k8s-worker2
EOF10.0.0.70
hostnamectl set-hostname k8s-master
10.0.0.71
hostnamectl set-hostname k8s-worker1
10.0.0.72
hostnamectl set-hostname k8s-worker2

安裝ntpdate(集群機器執行)

yum install ntpdate -y
#集群所有服務器實現時間同步
ntpdate -u ntp1.aliyun.com

關閉swap(集群機器執行)

sed -ri 's/.*swap.*/#&/' /etc/fstab

配置網絡(集群機器執行)

cat > /etc/sysctl.d/k8s.conf << EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
net.ipv4.tcp_tw_recycle = 0
EOFsysctl -p
modprobe br_netfilter
lsmod | grep br_netfilter

查看并更新內核(集群機器執行)

uname -a
Linux k8s-master 3.10.0-1160.71.1.el7.x86_64 #1 SMP Tue Jun 28 15:37:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linuxyum update

配置ipvs功能(集群機器執行)

# 安裝ipset和ipvsadm
yum install ipset ipvsadmin -y
#如果提示No package ipvsadmin available.需要使用
yum install ipvsadm
cat <<EOF > /etc/sysconfig/modules/ipvs.modules
#!/bin/bash
modprobe -- ip_vs
modprobe -- ip_vs_rr
modprobe -- ip_vs_wrr
modprobe -- ip_vs_sh
modprobe -- nf_conntrack_ipv4
EOF
chmod +x /etc/sysconfig/modules/ipvs.modules
# 執行腳本文件
/bin/bash /etc/sysconfig/modules/ipvs.moduleslsmod | grep -e ip_vs -e nf_conntrack_ipv4

重啟服務器(集群機器執行)

reboot

安裝軟件

安裝docker(集群機器執行)

wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo
yum -y install docker-ce
systemctl enable docker && systemctl start docker

配置國內源(集群機器執行)

cat > /etc/docker/daemon.json <<EOF
{
  "registry-mirrors": ["https://docker.hpcloud.cloud","https://docker.m.daocloud.io","https://docker.unsee.tech","https://docker.1panel.live","http://mirrors.ustc.edu.cn","https://docker.chenby.cn","http://mirror.azure.cn","https://dockerpull.org","https://dockerhub.icu","https://hub.rat.dev"],
  "exec-opts": ["native.cgroupdriver=systemd"],
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "100m"
  }
}
EOFsystemctl restart docker

安裝 cri-dockerd(集群機器執行)

# 通過 wget 命令獲取 cri-dockerd軟件
wget https://github.com/Mirantis/cri-dockerd/releases/download/v0.3.12/cri-dockerd-0.3.12-3.el7.x86_64.rpm
#服務器無法下載離線上傳# 通過 rpm 命令執行安裝包
rpm -ivh cri-dockerd-0.3.12-3.el7.x86_64.rpm# 打開 cri-docker.service 配置文件
vim /usr/lib/systemd/system/cri-docker.service# 修改對應的配置項
ExecStart=/usr/bin/cri-dockerd --container-runtime-endpoint fd:// --pod-infra-container-image=registry.aliyuncs.com/google_containers/pause:3.9systemctl daemon-reload
systemctl enable cri-docker && systemctl start cri-docker
systemctl enable cri-docker.socket && systemctl start cri-docker.socket
systemctl status cri-docker.service

添加國內yun源(集群機器執行)

cat > /etc/yum.repos.d/kubernetes.repo << EOF
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=0
repo_gpgcheck=0
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF

安裝 kubeadm、kubelet 和 kubectl(集群機器執行)

yum install -y kubelet-1.28.0 kubeadm-1.28.0 kubectl-1.28.0
systemctl start kubelet
systemctl enable kubelet

Master 節點初始化 K8s (master執行)

#注意需要更改ip為自己服務器ip,后面同理
kubeadm init \
  --apiserver-advertise-address=10.0.0.70 \
  --image-repository registry.aliyuncs.com/google_containers \
  --kubernetes-version v1.28.0 \
  --service-cidr=10.96.0.0/12 \
  --pod-network-cidr=10.244.0.0/16 \
  --cri-socket=unix:///var/run/cri-dockerd.sock \
  --ignore-preflight-errors=all#顯示成功之后需要master執行以下命令
mkdir -p $HOME/.kube
cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
chown $(id -u):$(id -g) $HOME/.kube/config
#kubernetes強化tab(安裝之后會tab可以補全命令及參數)
echo 'source  <(kubectl  completion  bash)' >> ~/.bashrc

示例

[root@k8s-master ~]# kubeadm init \
>   --apiserver-advertise-address=10.0.0.70 \
>   --image-repository registry.aliyuncs.com/google_containers \
>   --kubernetes-version v1.28.0 \
>   --service-cidr=10.96.0.0/12 \
>   --pod-network-cidr=10.244.0.0/16 \
>   --cri-socket=unix:///var/run/cri-dockerd.sock \
>   --ignore-preflight-errors=all
[init] Using Kubernetes version: v1.28.0
[preflight] Running pre-flight checks
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
[certs] Using certificateDir folder "/etc/kubernetes/pki"
[certs] Generating "ca" certificate and key
[certs] Generating "apiserver" certificate and key
[certs] apiserver serving cert is signed for DNS names [k8s-master kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 10.0.0.70]
[certs] Generating "apiserver-kubelet-client" certificate and key
[certs] Generating "front-proxy-ca" certificate and key
[certs] Generating "front-proxy-client" certificate and key
[certs] Generating "etcd/ca" certificate and key
[certs] Generating "etcd/server" certificate and key
[certs] etcd/server serving cert is signed for DNS names [k8s-master localhost] and IPs [10.0.0.70 127.0.0.1 ::1]
[certs] Generating "etcd/peer" certificate and key
[certs] etcd/peer serving cert is signed for DNS names [k8s-master localhost] and IPs [10.0.0.70 127.0.0.1 ::1]
[certs] Generating "etcd/healthcheck-client" certificate and key
[certs] Generating "apiserver-etcd-client" certificate and key
[certs] Generating "sa" key and public key
[kubeconfig] Using kubeconfig folder "/etc/kubernetes"
[kubeconfig] Writing "admin.conf" kubeconfig file
[kubeconfig] Writing "kubelet.conf" kubeconfig file
[kubeconfig] Writing "controller-manager.conf" kubeconfig file
[kubeconfig] Writing "scheduler.conf" kubeconfig file
[etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests"
[control-plane] Using manifest folder "/etc/kubernetes/manifests"
[control-plane] Creating static Pod manifest for "kube-apiserver"
[control-plane] Creating static Pod manifest for "kube-controller-manager"
[control-plane] Creating static Pod manifest for "kube-scheduler"
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Starting the kubelet
[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take up to 4m0s
[apiclient] All control plane components are healthy after 6.501620 seconds
[upload-config] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace
[kubelet] Creating a ConfigMap "kubelet-config" in namespace kube-system with the configuration for the kubelets in the cluster
[upload-certs] Skipping phase. Please see --upload-certs
[mark-control-plane] Marking the node k8s-master as control-plane by adding the labels: [node-role.kubernetes.io/control-plane node.kubernetes.io/exclude-from-external-load-balancers]
[mark-control-plane] Marking the node k8s-master as control-plane by adding the taints [node-role.kubernetes.io/control-plane:NoSchedule]
[bootstrap-token] Using token: x3jlhw.ymjilbj6aiqyjelh
[bootstrap-token] Configuring bootstrap tokens, cluster-info ConfigMap, RBAC Roles
[bootstrap-token] Configured RBAC rules to allow Node Bootstrap tokens to get nodes
[bootstrap-token] Configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials
[bootstrap-token] Configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token
[bootstrap-token] Configured RBAC rules to allow certificate rotation for all node client certificates in the cluster
[bootstrap-token] Creating the "cluster-info" ConfigMap in the "kube-public" namespace
[kubelet-finalize] Updating "/etc/kubernetes/kubelet.conf" to point to a rotatable kubelet client certificate and key
[addons] Applied essential addon: CoreDNS
[addons] Applied essential addon: kube-proxyYour Kubernetes control-plane has initialized successfully!To start using your cluster, you need to run the following as a regular user:  mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/configAlternatively, if you are the root user, you can run:  export KUBECONFIG=/etc/kubernetes/admin.confYou should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
  https://kubernetes.io/docs/concepts/cluster-administration/addons/Then you can join any number of worker nodes by running the following on each as root:kubeadm join 10.0.0.70:6443 --token x3jlhw.ymjilbj6aiqyjelh \
	--discovery-token-ca-cert-hash sha256:e0222e1db79bd45841dbf390f9060d208b03bfa1c88c76067e2de6d5322bc845 [root@k8s-master ~]#mkdir -p $HOME/.kube
[root@k8s-master ~]#cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
[root@k8s-master ~]#chown $(id -u):$(id -g) $HOME/.kube/config

worker節點加入master集群(worker執行)

K8s 初始化之后,就可以在其他 2 個工作節點上執行 “kubeadm join” 命令,因為我們使用了 cri-dockerd ,需要在命令加上 “–cri-socket=unix:///var/run/cri-dockerd.sock” 參數。

kubeadm join 10.0.0.70:6443 --token x3jlhw.ymjilbj6aiqyjelh --discovery-token-ca-cert-hash sha256:e0222e1db79bd45841dbf390f9060d208b03bfa1c88c76067e2de6d5322bc845 --cri-socket=unix:///var/run/cri-dockerd.sock

安裝網絡插件 (master執行)

wget https://docs.projectcalico.org/manifests/calico.yaml
sed -i 's#docker.io/##g' calico.yaml
vim calico.yaml
#搜索/CALICO_IPV4POOL_CIDR
#效果見下圖
# 修改文件時注意格式對齊
 - name: CALICO_IPV4POOL_CIDR
   value: "10.244.0.0/16"
image: calico/cni:v3.25.0
image: calico/cni:v3.25.0
image: calico/node:v3.25.0
image: calico/node:v3.25.0
image: calico/kube-controllers:v3.25.0


docker pull calico/cni:v3.25.0
docker pull calico/node:v3.25.0
docker pull calico/kube-controllers:v3.25.0kubectl apply -f calico.yamlkubectl delete -f calico.yamlkubectl apply -f calico.yaml --request-timeout=300s
systemctl restart kubelet

離線安裝(上面方案二選一)

#傳輸到集群中的所有 3 個節點上
#位置 C:\baidunetdiskdownload\k8s離線鏡像包
calico-image-3.25.1.zip 中是離線鏡像文件,解壓后在每個節點上執行導入命令。
ls *.tar |xargs -i docker load -i {}kubectl delete -f calico.yaml# 依次部署兩個 yaml 文件
kubectl apply -f tigera-operator.yaml --server-side
kubectl apply -f custom-resources.yaml

其他

查詢work加入集群的join

K8S在kubeadm init以后查詢kubeadm join
kubeadm token create --print-join-command

不進入容器執行命令

kubectl exec -it  podname -n namespace -- 命令eg:
kubectl exec -it  nginx-deployment1-8659769b68-6zq4c -n nginx -- cat /data/nginx/nginx.conf

k8s常用重啟pod命令

yaml 文件的情況下可以直接使用kubectl replace --force -f xxxx.yaml 來強制替換Pod 的 API 對象,從而達到重啟的目的
kubectl replace --force -f xxxx.yaml
沒有 yaml 文件,直接使用的 Pod 對象
kubectl get pod {podname} -n {namespace} -o yaml | kubectl replace --force -f -
刪除 Pod 后,控制器(如 Deployment)會自動重新創建一個新的 Pod
kubectl delete pod <pod_name> -n {namespace}
yaml文件直接delete后跟yaml文件
kubectl delete -f xxxx.yaml

部署nginx

nginx-deployment.yaml

#volumeMounts:容器內路徑
#volumes:宿主機路徑
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: nginx
  name: nginx-deployment1
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      nodeName: k8s-worker1
      containers:
      - image: nginx:1.26.1
        ports:
        - containerPort: 80
        name: nginx
        volumeMounts:
        - name: conf
          mountPath: /data/nginx/nginx.conf
        - name: ssl
          mountPath: /data/nginx/ssl
        - name: confd
          mountPath: /data/nginx/conf.d
        - name: log
          mountPath: /var/log/nginx
        - name: html
          mountPath: /data/nginx/html
      tolerations:
      - key: "key"
        operator: "Equal"
        value: "nginx"
        effect: "NoSchedule"
      volumes:
      - name: conf
        hostPath:
          path: /data/nginx/conf/nginx.conf
      - name: log
        hostPath:
          path: /data/nginx/logs
      - name: html
        hostPath:
          path: /data/nginx/html
      - name: confd
        hostPath:
          path: /data/nginx/conf.d
      - name: ssl
        hostPath:
          path: /data/nginx/ssl

nginx-service.yaml

apiVersion: v1
kind: Service
metadata:name: nginx-service
spec:type: NodePortselector:app: nginxports:- protocol: TCPport: 80targetPort: 80name: httpnodePort: 30080- protocol: TCPport: 443targetPort: 443name: httpsnodePort: 30443

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/77432.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/77432.shtml
英文地址,請注明出處:http://en.pswp.cn/web/77432.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

第三方軟件檢測報告:熱門辦公軟件評估及功能表現如何?

第三方軟件檢測報告是重要文件。它用于對軟件做專業評估。能反映軟件各項性能。能反映軟件安全性等指標。該報告為軟件使用者提供客觀參考。該報告為軟件開發者提供客觀參考。有助于發現問題。還能推動軟件改進。 檢測概述 本次檢測針對一款熱門辦公軟件。采用了多種先進技術…

Linux:41線程控制lesson29

1.線程的優點&#xff1a; ? 創建?個新線程的代價要?創建?個新進程?得多 創建好線程只要調度就好了 ? 與進程之間的切換相?&#xff0c;線程之間的切換需要操作系統做的?作要少很多 為什么&#xff1f; ? 最主要的區別是線程的切換虛擬內存空間依然是相同的&#x…

【MCP】從一個天氣查詢服務帶你了解MCP

1. 前言 這篇文章將通過一個集成高德天氣查詢的 MCP Server 用例&#xff0c;帶你上手開發自己的 MCP Server ,文章將通過以下三種方式&#xff08;自己編寫 Client 端代碼&#xff0c;使用 mcp-cli 自帶頁面&#xff0c;集成到 Claude 桌面版等&#xff09;帶你測試自己的 MC…

SHCTF-REVERSE

前言 之前寫的&#xff0c;一直沒發&#xff0c;留個記錄吧&#xff0c;萬一哪天記錄掉了起碼在csdn有個念想 1.ezapk 反編譯 快速定位關鍵函數 package com.mycheck.ezjv;import adrt.ADRTLogCatReader; import android.app.Activity; import android.content.Context; impo…

安卓觸摸事件分發機制分析

1. 前言 &#x1f3af; 一句話總結&#xff1a; 觸摸事件&#xff08;TouchEvent&#xff09;會從 Activity 層開始&#xff0c;按從外到內的方式傳遞給每一個 ViewGroup/View&#xff0c;直到某個 View 消費&#xff08;consume&#xff09; 它&#xff0c;事件傳遞就會停止…

Spring MVC 多個攔截器的執行順序

一、流程總覽 該流程圖描述了一個多層攔截器鏈的業務處理流程&#xff0c;核心邏輯為&#xff1a; 前置攔截&#xff1a;通過 predHandler1 和 predHandler2 逐層校驗請求合法性。核心處理&#xff1a;通過校驗后執行核心業務邏輯 handler()。后置處理與清理&#xff1a;按反…

django filter 排除字段

在Django中&#xff0c;當你使用filter查詢集&#xff08;QuerySet&#xff09;時&#xff0c;通常你會根據模型的字段來過濾數據。但是&#xff0c;有時你可能想要排除某些特定的字段&#xff0c;而不是過濾這些字段。這里有幾種方法可以實現這一點&#xff1a; 使用exclude方…

ByeCode,AI無代碼開發平臺,拖拽式操作構建應用

ByeCode是什么 ByeCode 是一款先進的 AI 無代碼平臺&#xff0c;旨在幫助企業迅速創建數字名片、網站、小程序、應用程序及內部管理系統&#xff0c;無需繁雜的編碼或開發工作。ByeCode 采用直觀的可視化界面和拖拽式操作&#xff0c;使得非技術用戶能夠輕松上手。同時&#x…

AI日報 - 2025年04月28日

&#x1f31f; 今日概覽(60秒速覽) ▎&#x1f916; 能力進展 | Gemini 2.5 Pro成功挑戰《口袋妖怪紅》8道館&#xff1b;AI推理器具備自我糾錯能力&#xff1b;LLM在游戲、多模態理解、代碼遷移等方面展現新能力。 ▎&#x1f4bc; 商業動向 | Google回應DOJ反壟斷案&#xff…

在Java中實現List按自定義順序排序的幾種方案

在Java中實現List按自定義順序排序的幾種方案 在實際開發中&#xff0c;我們經常需要對集合中的對象按照特定字段進行排序。當排序規則不是簡單的字母或數字順序&#xff0c;而是自定義的順序時&#xff0c;我們需要采用特殊的方法。本文將以一個List<Person>按省份特定…

微服務架構在云原生后端的深度融合與實踐路徑

??個人主頁??:一ge科研小菜雞-CSDN博客 ????期待您的關注 ???? 一、引言:后端架構的演變,走向云原生與微服務融合 過去十余年,后端架構經歷了從單體應用(Monolithic)、垂直切分(Modularization)、到微服務(Microservices)的演進,每一次變化都是為了解決…

Python中的Walrus運算符分析

Python中的Walrus運算符&#xff08;:&#xff09;是Python 3.8引入的一個新特性&#xff0c;允許在表達式中同時賦值和返回值。它的核心作用是減少重復計算&#xff0c;提升代碼簡潔性。以下是其適用的典型場景及示例&#xff1a; 1. 在循環中避免重復計算 當循環條件需要多次…

用Node.js施展文檔比對魔法:輕松實現Word文檔差異比較小工具,實現Word差異高亮標注(附完整實戰代碼)

引言&#xff1a;當「找不同」遇上程序員的智慧 你是否經歷過這樣的場景&#xff1f; 法務同事發來合同第8版修改版&#xff0c;卻說不清改了哪里 導師在論文修改稿里標注了十幾處調整&#xff0c;需要逐一核對 團隊協作文檔頻繁更新&#xff0c;版本差異讓人眼花繚亂 傳統…

前端瀏覽器窗口交互完全指南:從基礎操作到高級控制

瀏覽器窗口交互是前端開發中構建復雜Web應用的核心能力&#xff0c;本文深入探討23種關鍵交互技術&#xff0c;涵蓋從傳統API到最新的W3C提案&#xff0c;助您掌握跨窗口、跨標簽頁的完整控制方案。 一、基礎窗口操作體系 1.1 窗口創建與控制 // 新窗口創建&#xff08;現代瀏…

Git和Gitlab的部署和操作

一。GIT的基本操作 1.GIT的操作和查看內容 [rootmaster ~]# yum install git -y [rootmaster ~]# git config --list&#xff1a;查看所有配置 2.GIT倉庫初始化 [rootmaster ~]# mkdir /gittest&#xff1a;創建目錄 [rootmaster ~]# cd /gittest/&#xff1a;進入目錄 [rootm…

Linux中線程池的簡單實現 -- 線程安全的日志模塊,策略模式,線程池的封裝設計,單例模式,餓漢式單例模式,懶漢式單例模式

目錄 1. 對線程池的理解 1.1 基本概念 1.2 工作原理 1.3 線程池的優點 2. 日志與策略模式 2.1 日志認識 2.2 策略模式 2.2.1 策略模式的概念 2.2.2 工作原理 2.2 自定義日志系統的實現 3. 線程池設計 3.1 簡單線程池的設計 3.2 線程安全的單例模式線程池的設計 3…

量子力學:量子通信

量子通信是利用量子力學原理對信息進行編碼、傳輸和處理的新型通信方式&#xff0c;以下是其詳細介紹及業界發展現狀&#xff1a; 基本原理 量子疊加態 &#xff1a;量子系統可以處于多個狀態的疊加&#xff0c;如光子的偏振方向可以同時處于水平和垂直方向的疊加態&#xff…

企業架構之旅(1):TOGAF 基礎入門

大家好&#xff0c;我是沛哥兒。今天我們簡單聊下TOGAF哈。 文章目錄 一、TOGAF 是什么定義與核心定位發展歷程與行業地位與其他架構框架的區別 二、TOGAF 核心價值企業數字化轉型助力業務與 IT 的協同作用降本增效與風險管控 三、TOGAF 基礎術語解析架構域&#xff08;業務、…

CSS 內容超出顯示省略號

CSS 內容超出顯示省略號 文章目錄 CSS 內容超出顯示省略號**1. 單行文本省略&#xff08;常用&#xff09;****2. 多行文本省略&#xff08;如 2 行&#xff09;****3. 對非塊級元素生效****完整示例****注意事項** 在 CSS 中實現內容超出顯示省略號&#xff0c;主要通過控制文…

路由器重分發(OSPF+RIP),RIP充當翻譯官,OSPF充當翻譯官

路由器重分發&#xff08;OSPFRIP&#xff09; 版本 1 RIP充當翻譯官 OSPF路由器只會OSPF語言&#xff1b;RIP路由器充當翻譯官就要會OSPF語言和RIP語言&#xff1b;則在RIP中還需要將OSPF翻譯成RIPOSPF 把RIP路由器當成翻譯官&#xff0c;OSPF路由器就只需要宣告自己的ip&am…