我有三台 Ubuntu 虚拟机客户端、服务器和路由器。我想用这三台机器创建一个小型本地网络。配置如下:
client: one network interface, 192.168.100.2/24, connected to client-net
router: two network interfaces, 192.168.100.1/24, connected to client-net and 192.168.101.1/24, connected to server-net.
server: one network interface, 192.168.101.2/24, connected to server-net.
client-net will be 192.168.100.0/24, server-net will be 192.168.101.0/24
我在路由器上有两个接口,eth1(192.168.100.1)和eth2(192.168.101.1)
#I try these command in router machine
route add -host 192.168.100.2 gw 192.168.100.1 dev eth1
route add -host 192.168.101.2 gw 192.168.101.1 dev eth2
但我无法从 192.168.100.2 ping 通 192.168.101.2。如何在路由器机器上使用路由命令设置从客户端到服务器以及从服务器到客户端的路由表?我需要在客户端和服务器机器上执行其他操作吗?如何将这三台机器连接到本地网络。