Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[mininet-discuss] Connect VM to mininet network

Bob Lantz rlantz at cs.stanford.edu
Fri May 8 15:45:58 PDT 2015


Yeah this is easy. I think you can just make a KVMhost (or LXChost or DockerHost or whatever) for Mininet. ;-)

You can also easily add existing tap interfaces to a Mininet switch either using the Mininet API or simply using ovs-vsctl.

If you have existing VM images that you want to use for some reason, then that is OK.

However, I greatly prefer the approach of simply running your routing software in a Mininet container rather than a VM or a heavyweight container with a virtual file system and other stuff.

-Bob


> On May 8, 2015, at 3:32 PM, Rob Sherwood <rob.sherwood at bigswitch.com> wrote:
> 
> Thanks for the reply Bob.
> 
> I can very precisely describe what I want to do. I've written a script that manually plumbs together a fixed line topology with VMs *as vswitches/routers* and posted it here:
> 
> https://github.com/opennetworklinux/ONL/blob/master/tools/kvm-router-demo.sh <https://github.com/opennetworklinux/ONL/blob/master/tools/kvm-router-demo.sh>
> 
> The idea the VMs here have multiple interfaces themselves and inside the VM is some sort of packet forwarding logic.  Yes, you can pull the contents of the packet forwarding logic out of the VM and into a container, but if you already have the VMs, this is much easier.
> 
> Does that help?
> 
> Thanks,
> 
> - Rob
> .
> 
> On Sat, Apr 25, 2015 at 6:14 PM, Bob Lantz <rlantz at cs.stanford.edu <mailto:rlantz at cs.stanford.edu>> wrote:
> Maybe someone can describe the problem in detail for me, since there isn’t enough context here for me to figure it out, but I think this was the original issue:
> 
> If you have Mininet running in one VM and you want the Mininet hosts/containers to be able to talk to other VMs connected to your VM bridge, usually the easiest thing to do is to add a new virtual interface (e.g. ‘eth2’) to your Mininet VM (make sure that new virtual interface is connected to your VM bridge), and then to add that interface to OVS, e.g. by using s1.addIntf(’eth2’) or the approach in examples/hwintf.py (which is basically the same thing but using the low-level API.)
> 
>> On Apr 24, 2015, at 10:32 PM, Rob Sherwood <rob.sherwood at bigswitch.com <mailto:rob.sherwood at bigswitch.com>> wrote:
>> 
>> Hi all,
>> 
>> Did anyone get code together to do this through mininet?  I know how to set this up by hand, but I really like having mininet as a wrapper to handle arbitrary topologies and the CLI.
>> 
>> Please let me know and thanks,
>> 
>> - Rob
>> .
>> 
>> On Mon, Feb 2, 2015 at 1:48 PM, Pablo M. Guevara <pablomguevara at gmail.com <mailto:pablomguevara at gmail.com>> wrote:
>> Sorry, I did reply all, thought the list was there!
>> Yes, I'm actually using a pair of veth to interconect 2 VMs, one with Mininet and one running Vyos router. Works like a charm.
>> Thanks!
>> 
>> 
>> On 02/02/2015 06:41 PM, Bob Lantz wrote:
>> Please don't drop the list!! :(
>> Yes, those are two standard methods. You might also add:
>> 3) connect your Mininet network to some sort of tunnel/virtual link that connects to wherever you want
>> 
>> On Feb 2, 2015, at 11:54 AM, Pablo M. Guevara <pablomguevara at gmail.com <mailto:pablomguevara at gmail.com>> wrote:
>> 
>> My bad... I had a problem with my code and that is why it was failling...
>> To complete the topic. To my knoledge there are 2 ways to connect Mininet hosts to the outside world.
>> 
>> 1) add a router (could be iptables, quagga or something else) running on root namespace, add a link from this host to ovs and you are done; this is the approach on
>> https://github.com/mininet/mininet/blob/master/examples/nat.py <https://github.com/mininet/mininet/blob/master/examples/nat.py>
>> 2) add a physical interface to ovs; this is the approach on
>> https://github.com/mininet/mininet/blob/master/examples/hwintf.py <https://github.com/mininet/mininet/blob/master/examples/hwintf.py>
>> 
>> I have both methods working ok now.
>> 
>> Thanks
>> 
>> On 01/31/2015 12:09 AM, Bob Lantz wrote:
>> You haven't provided much information, but this configuration works fine for me with vmware:
>> 
>> # mn -v output --nat
>> 
>> mininet> sh route
>> Kernel IP routing table
>> Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
>> default         192.168.51.2    0.0.0.0         UG    0      0        0 eth0
>> 10.0.0.0        *               255.0.0.0       U     0      0        0 nat0-eth0
>> 192.168.51.0    *               255.255.255.0   U     0      0        0 eth0
>> 
>> mininet> h1 ping -c1 192.168.51.2
>> PING 192.168.51.2 (192.168.51.2) 56(84) bytes of data.
>> 64 bytes from 192.168.51.2 <http://192.168.51.2/>: icmp_seq=1 ttl=127 time=3.61 ms
>> ...
>> 
>> mininet> h1 ping -c1 192.168.51.198
>> PING 192.168.51.198 (192.168.51.198) 56(84) bytes of data.
>> 64 bytes from 192.168.51.198 <http://192.168.51.198/>: icmp_seq=1 ttl=63 time=2.20 ms
>> ...
>> 
>> 
>> On Jan 30, 2015, at 11:44 AM, Jian Li <jli263 at usc.edu <mailto:jli263 at usc.edu>> wrote:
>> 
>> Actually I think you need to check your network settings by ifconfig. Make sure you have an interface connecting to the outside network.
>> 
>> Best Regards,
>> Jian Li
>> 
>> On Jan 30, 2015, at 11:17 AM, Pablo M. Guevara <pablomguevara at gmail.com <mailto:pablomguevara at gmail.com>> wrote:
>> 
>> Hi Guys,
>> 
>> Has anyone found a way to make this work?
>> I have 2 VMs
>> 
>> 1 VM Vyos router 192.168.144.1
>> 2 VM Mininet 192.168.144.2
>> 
>> Ping from Vyos-VM to Mininet-VM works.
>> 
>> Hosts on Mininet can ping Mininet-VM's address 192.168.144.2
>> Hosts on Mininet can not ping Vyos-VM address 192.168.144.1
>> 
>> Thanks
>> 
>> -- 
>> Pablo
>> 
>> _______________________________________________
>> mininet-discuss mailing list
>> mininet-discuss at lists.stanford.edu <mailto:mininet-discuss at lists.stanford.edu>
>> https://mailman.stanford.edu/mailman/listinfo/mininet-discuss <https://mailman.stanford.edu/mailman/listinfo/mininet-discuss>
>> _______________________________________________
>> mininet-discuss mailing list
>> mininet-discuss at lists.stanford.edu <mailto:mininet-discuss at lists.stanford.edu>
>> https://mailman.stanford.edu/mailman/listinfo/mininet-discuss <https://mailman.stanford.edu/mailman/listinfo/mininet-discuss>
>> -- 
>> Pablo
>> 
>> 
>> -- 
>> Pablo
>> 
>> _______________________________________________
>> mininet-discuss mailing list
>> mininet-discuss at lists.stanford.edu <mailto:mininet-discuss at lists.stanford.edu>
>> https://mailman.stanford.edu/mailman/listinfo/mininet-discuss <https://mailman.stanford.edu/mailman/listinfo/mininet-discuss>
>> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/mininet-discuss/attachments/20150508/c3ced73a/attachment.html>


More information about the mininet-discuss mailing list