[Mininet/Miniedit]: 无法通过路由器连接两台主机互相ping通

问题描述 投票:0回答:0

作为实验的一部分,我的网络具有以下拓扑结构,两台主机连接到 mininet 中的路由器(在 Ubuntu 22.04.02 虚拟机上)

     h1 - r1 - h2

主机“h1”具有以下配置: h1 ifconfig

主机“h2”具有以下配置: h2 ifconfig

路由器 r1 具有以下配置: r1 ifconfig

我正在尝试设置实验拓扑,以便两台主机可以相互访问,这当然可以通过配置路由表

我已采取以下步骤:

路由器终端(xterm)上:

    ifconfig r1-eth0 192.168.3.0 netmask 255.0.0.0  
    ip route add 192.168.0.0/24 dev r1-eth0   
    ip route add 192.168.1.0/24 dev r1-eth0 

h1终端(xterm)

    ifconfig h1-eth0 192.168.0.103 netmask 255.0.0.0
    ip route add 192.168.1.0/24 via 192.168.3.0
    route add default gw 192.168.3.0

h2终端(xterm)

    ifconfig h2-eth0 192.168.1.2 netmask 255.0.0.0
    ip route add 192.168.0.0/24 via 192.168.3.0
    route add default gw 192.168.3.0

h1、h2、r1更新后的路由表如下:

h1 IP routes
h2 IP routes
r1 IP routes

当我尝试从 h1 ping h2 时,反之亦然,我收到目标主机无法访问的错误。

我哪里错了?有没有我跳过的步骤?任何见解/帮助表示赞赏。

P.S.:如果有任何关于静态 IP 路由的好资源,我将不胜感激。

networking mininet sdn
© www.soinside.com 2019 - 2024. All rights reserved.