通过OpenFlow软件开关将主机连接到互联网

时间:2014-04-08 20:56:07

标签: networking network-programming openflow

我有两个Ubuntu虚拟机X和Y. x上运行Open vSwitch和泛光灯,Y vm充当主机。 我有一个Host-Only适配器和一个连接到X vm的NAT适配器。并且Y vm只有一个Host-Only适配器。

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

现在我想通过在X vm上运行的OVS将Y vm连接到互联网。 可能吗? 如果有,怎么样?

2 个答案:

答案 0 :(得分:2)

仅通过Open 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.

答案 1 :(得分:0)

我的问题不明确。如果可以,请详细说明。 否则,测试 openflow 服务的最简单方法是使用 mininet 模拟器。 这是一个如何使用它的教程。

<强> http://mininet.org/walkthrough/