LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-14-2015, 12:55 PM   #1
josefelk
LQ Newbie
 
Registered: Jul 2015
Posts: 7

Rep: Reputation: Disabled
Connect a Virtual Machine to a tap bridge


Hi all,

I'm using two Virtual Machines to create an ns3 emulated network. I'm trying to integrate an external node (VM) in a simulated environement with a scenario like in the link https://www.nsnam.org/docs/release/3.../html/tap.html

I have ns3 installed and working in a VM and I created a tap and bridge:

sudo brctl addbr br-left
sudo tunctl -t tap-left
sudo ifconfig tap-left 0.0.0.0 promisc up
sudo brctl addif br-left tap-left
sudo ifconfig br-left up

I can ping a simulated node locally like in the link https://www.nsnam.org/doxygen/tap-wi...cc_source.html

The problem I'm facing connecting the other virtual machine to the simulator, I don't really know how to connect the VM to the TAP cereated in the simulation machine.

Thanks in advance
 
Old 07-14-2015, 03:26 PM   #2
arre
Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Slackware 10.2 & Windows 98 & Windows XP Pro & ...
Posts: 30

Rep: Reputation: 4
Hi,

You can add a vm interface to the brigde:

Brctl addif bridge-left eth0

Then you can configure vbox to bridge that adaptor to a physical interface in the gui.
 
Old 07-14-2015, 03:33 PM   #3
arre
Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Slackware 10.2 & Windows 98 & Windows XP Pro & ...
Posts: 30

Rep: Reputation: 4
Hmm, maybe I misunderstood your question,

In case you have only one linux box, and are running ns-vm's, your question is how to tie a ns-application to a tap interface.
In that case, forget the last post. You then have to somehow configure it indeed. The doc you specified seems to indicate that you can pass this along?

./waf --run "tap-wifi-dumbbell --mode=UseBridge --tapName=mytap2"

I'm not familiar with ns unfortunately, so won't be able to help you further there.
 
Old 07-14-2015, 03:55 PM   #4
josefelk
LQ Newbie
 
Registered: Jul 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
First thanks for reply. I have two virtual machines and I'm using vmware:
VM 1 <external host> <===> VM 2 <bridge> <tap device> <ns-3>

What I wanted to know is how to connect the eth0 of the VM1 to the bridge I created in VM2. Or this will be done by configuring the VMware workstation ??
 
Old 07-15-2015, 01:55 AM   #5
arre
Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Slackware 10.2 & Windows 98 & Windows XP Pro & ...
Posts: 30

Rep: Reputation: 4
Hmm, what exactly do you mean with external host? Is it a different physical machine, or just two VM's on one machine?

What do you want to communicate with in ns3? A linux stack? Or another ns3? or the internet?

I'm going assume now:

- You have one physical machine running 2 vmware boxes
- You want to communicate with the linux stack on one with ns3 on the other

In that case,

- On vm2: Brctl addif bridge-left eth0
- In vmware: configure a connection between network adaptor 1 in VM1 to network adaptor in VM2
- On vm1: configure an ip address on its eth0, and try and ping ns3 or something.

Hope it helps
 
Old 07-15-2015, 08:20 AM   #6
josefelk
LQ Newbie
 
Registered: Jul 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Thank you verry much arre for the clue, I figured it out. And yes I was using 2 Virtual machines, by "external host" i meant "external node" to ns3. I added eth1 in VM2 to the bridge and I created in Vmware virtual network (host-Only) and connect the two VMs to it, and I can go inside ns3.

But I'm still confused, because I'm trying another scenario with 2 Virtual Machines and ns3 installed in a 3rd VM as a channel, (like in this tutorial but with Virtual Machines instead of lxc).

https://www.nsnam.org/wiki/index.php...rtual_networks

VM1<Centos Linux> <===> VM2<ns3> <==> VM3<Centos Linux>

So how can I configure it ? I can't add eth1 (from VM2) to two bridges (left & right) in the same time! can I create another ethernet adapter, eth2 for example and add it to the other bridge ?

Hope you get what I trying to do, thanks in advance.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to setup tap networking for running virtual machine? flyxtop Linux - Server 0 09-19-2014 01:44 PM
How to connect two systems via virtual network devices like tap in linux. Kalamram Linux - Networking 4 04-19-2013 02:53 PM
Configuring TUN/TAP for a virtual machine slakwarebunny Linux - Networking 2 06-14-2008 07:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration