Networking 通过OpenFlow软件交换机将主机连接到internet

Networking 通过OpenFlow软件交换机将主机连接到internet,networking,network-programming,openflow,Networking,Network Programming,Openflow,我有两台Ubuntu虚拟机X和Y。 x上有打开的vSwitch和泛光灯,Y虚拟机充当主机。 我有一个纯主机适配器和一个NAT适配器连接到X vm。Y虚拟机只有一个仅限主机的适配器 X和Y vm的仅主机适配器位于同一子网中 现在我想通过运行在X虚拟机上的OVS将Y虚拟机连接到internet。 可能吗? 如果是,如何测试?测试openflow服务的最简单方法是使用mininetemulator。这里有一个关于如何使用它的教程 要仅通过开放式vSwitch连接到主机 使用DHCP 1: add th

我有两台Ubuntu虚拟机X和Y。 x上有打开的vSwitch和泛光灯,Y虚拟机充当主机。 我有一个纯主机适配器和一个NAT适配器连接到X vm。Y虚拟机只有一个仅限主机的适配器

X和Y vm的仅主机适配器位于同一子网中

现在我想通过运行在X虚拟机上的OVS将Y虚拟机连接到internet。 可能吗?
如果是,如何测试?

测试openflow服务的最简单方法是使用mininetemulator。这里有一个关于如何使用它的教程


要仅通过开放式vSwitch连接到主机

使用DHCP

1: add the interface connected to internet(say eth0) on the OVS machine to the OVS bridge.
2: change the ip address of eth0 interface to 0 and get a dhcp ip to the bridge interface using dhclient
3: add the interfaces that are connected to the hosts to the OVS bridge
4: get dhcp ip's to the hosts by using dhclient on the host machines
使用自定义IP地址

1: add the interfaces connected to the hosts and the interface connected to the internet to the OVS bridge
2: make the internet interface ip as 0 
3: set the bridge ip address to the ip address that was previously assigned to the internet interface
4: make sure you have the host ip addresses in the same network address range as the bridge IP address.

谢谢你的建议!问题是如何使用运行OVS的PC作为交换机来创建和开放流量网络。连接到OVS PC的主机只能通过OVS访问互联网,而不能通过其他接口访问互联网。我在下面回答了!谢谢