It is currently Thu Dec 12, 2019 7:45 am


All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Bridge OSX to ethernet card - is it possible?
PostPosted: Wed Dec 04, 2013 8:12 am 
Offline

Joined: Tue Mar 29, 2011 11:39 am
Posts: 5
Hi

I have looked around for an answer to this so would be really grateful is someone can help :), is it possible on Mac to bridge your ethernet card to your real network via a cloud like this example:
http://www.youtube.com/watch?v=xIDLZaeh6ow
i.e. using a cloud, find out your ethernet card, using ifconfig, add your lan card to the cloud and connect the cloud to a router:

everytime i try this a get: lost communication with server 127.0.0.1:7201, tried to change port for dynampis and have unchecked "Enable JIT sharing support" like most guides say - same error.

or do you need to use tun/tap drivers and /dev/tap to the cloud, and share your internet with sudo sysctl -w net.inet.ip.forwarding=1
like : topic5787.html

THANKS!




Attachments:
Skärmavbild 2013-12-04 kl. 09.07.22.png
Skärmavbild 2013-12-04 kl. 09.07.22.png [ 53.11 KiB | Viewed 8151 times ]
Skärmavbild 2013-12-04 kl. 08.58.26.png
Skärmavbild 2013-12-04 kl. 08.58.26.png [ 94.02 KiB | Viewed 8151 times ]
Top
 Profile  
 
 Post subject: Re: Bridge OSX to ethernet card - is it possible?
PostPosted: Wed Dec 04, 2013 2:33 pm 
Offline

Joined: Fri Mar 05, 2010 11:33 am
Posts: 1494
Location: Australia
Here is an extract from my book GNS3 Network Simulation Guide. I know the formatting is a bit screwed up and the diagrams are missing. Let me know how it goes - I didn't get a chance to test it on a Mac using a TB connector.

Quote:
The OS X TUN/TAP adapter
The concept on Mac OS X is similar to Linux, create a tap interface and bridge to it.
Step 1: Install the TunTap package
Start by downloading the tuntaposx package from http://tuntaposx.sourceforge.net. When I did this, it came as a compressed .tar file that had to be decompressed until a .pkg file was revealed, which I installed. You can verify that the package has installed properly by running the following commands and seeing sixteen tap devices (tap0 – tap15) and sixteen tun devices (tun0 – tun15):
ls -l /dev | egrep 'tap|tun'
Step 2: Create and configure the tap interface
One of the trickiest parts of this configuration is that you do not see the tap0 interface on your Mac until you have used it in GNS3, so this step is completed in GNS3 running as root user.
Select your cloud/host icon. Navigate to Device | Configure (or simply double-click on the device). In the Node configurator, click on your cloud device (called C1). Select the NIO TAP tab.
There is no drop-down list of interfaces on this tab. You will have to enter /dev/tap0 as the name of your TAP interface and click on Add to add it to your cloud, then click on OK.
The device name must be /dev/tap0, unlike the Linux tap0

Insert Image 0809OS_03_14.png
The tap interface should now be visible:
users-Mac:~ user$ ifconfig tap0
tap0: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 9e:ce:5d:bb:c5:40
open (pid 850)
Step 3: Create and configure the bridge
OS X has bridging capability built in. Here is how you create and configure it to bridge your en0 (Ethernet interface) to your newly created tap0 interface.
For OS X users 10.7 and earlier
Bridging was introduced with OS X 10.8 (Mountain Lion). The GNS3 forum has a "how to" for other OS X versions at topic5787.html.
sudo ifconfig bridge0 create
sudo ifconfig bridge0 addm en0
sudo ifconfig bridge0 addm tap0
sudo ifconfig bridge0 up
ifconfig ;#To check
Step 4: Assign an IP address to bridge0
Finally, before you can access your router, you will have to give the bridge interface bridge0 an IP address. If you are using DHCP:
sudo ipconfig set bridge0 DHCP
Or if you are using a static IP, you'll need to assign an IP and probably a default gateway too, replacing x, y, and z with addresses and masks suitable for your network.
sudo ifconfig bridge0 x.x.x.x/y
sudo route add default gw z.z.z.z
Step 5: Test your connectivity
From your router, ping your host computer's bridge0 IP address. In my example, my host computer (en0) was given a DHCP IP address of 192.168.1.75 and bridge0 was given 192.168.1.76.
R2#ping 192.168.1.75
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.75, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R2#ping 192.168.1.76
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.76, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/6/9 ms

Note that the router was only able to ping the bridge0 IP address, so to test connectivity in the reverse direction, you will have to tell your host Macintosh that you wish to use the bridge0 IP address (192.168.1.76 in my case) as your source address when communicating with the router. For example (the router's IP is 192.168.1.77):
users-Mac:~ user$ ping -S 192.168.1.76 192.168.1.77
PING 192.168.1.77 (192.168.1.77) from 192.168.1.76: 56 data bytes
64 bytes from 192.168.1.77: icmp_seq=0 ttl=255 time=11.659 ms
The –S parameter with the ping command tells OS X to use 192.168.1.76 as the source IP when sending the pings to 192.168.1.77. For telnet, the parameter is similar, but uses a lowercase s.
users-Mac:~ user$ telnet -s 192.168.1.76 192.168.1.77
Trying 192.168.1.77...
Connected to 192.168.1.77.
Step 6: Make it last.
Unfortunately, like Linux, most of the changes you made will be lost when you reboot. I suggest that you keep a script handy that you can run whenever you wish to use the tap interface. Here is my script, which I called gns3tuntap and stored in a bin directory off my own home directory.
#!/bin/sh
#gns3tuntap – a script to setup tap0 and bridge0 interfaces
#usage: sudo ~/bin/gns3tuntap
echo Must be run AFTER the /dev/tap0 interface
echo has been created in GNS3
sudo ifconfig bridge0 create
sudo ifconfig bridge0 addm en0
sudo ifconfig bridge0 addm tap0
sudo ifconfig bridge0 up
sudo ipconfig set bridge0 DHCP
To create the script and make it executable:
mkdir ~/bin
touch ~/bin/gns3tuntap
chmod +x ~/bin/gns3tuntap
pico ~/bin/gns3tuntap
At this point I entered the script as preceding lines and of course saved my work. To re-enable the tap interface after I have created it in GNS3, I now run:
sudo ~/bin/gns3tuntap

_________________
RedNectar
http://rednectar.net
@rednectarchris
GNS3 WorkBench-a VMware image of Ubuntu with GNS3 and VPCS installed and a collection of exercises/labs


Top
 Profile  
 
 Post subject: Re: Bridge OSX to ethernet card - is it possible?
PostPosted: Wed Dec 04, 2013 7:33 pm 
Offline

Joined: Tue Mar 29, 2011 11:39 am
Posts: 5
Thank you so much for your help!!
Binding the physical card directly under the cloud don't seem to work, a lot of people seem to have problem with this :/, but your post is a great way to reach your lan from GNS3! No problem setting up a default gateway (in my case I pointed to my real switch, which in turn has a gateway) for internet under the virtual router as well!
The book you linked to also seems interesting :)!


Top
 Profile  
 
 Post subject: Re: Bridge OSX to ethernet card - is it possible?
PostPosted: Wed Dec 04, 2013 11:21 pm 
Offline

Joined: Fri Mar 05, 2010 11:33 am
Posts: 1494
Location: Australia
The book I linked to is VERY interesting - but since I wrote it that is an extremely biased view!!!

_________________
RedNectar
http://rednectar.net
@rednectarchris
GNS3 WorkBench-a VMware image of Ubuntu with GNS3 and VPCS installed and a collection of exercises/labs


Top
 Profile  
 
 Post subject: Re: Bridge OSX to ethernet card - is it possible?
PostPosted: Thu Dec 05, 2013 2:01 pm 
Offline

Joined: Tue Mar 29, 2011 11:39 am
Posts: 5
Just bought a copy ;), thanks again for your help!!


Top
 Profile  
 
 Post subject: Re: Bridge OSX to ethernet card - is it possible?
PostPosted: Thu Dec 05, 2013 10:25 pm 
Offline

Joined: Fri Mar 05, 2010 11:33 am
Posts: 1494
Location: Australia
Thanks



_________________
RedNectar
http://rednectar.net
@rednectarchris
GNS3 WorkBench-a VMware image of Ubuntu with GNS3 and VPCS installed and a collection of exercises/labs


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO