10 Oct 2006

Using ath0 as bridge in VMware… or almost

Posted by Jacob Emcken

Well I couldn’t make my Atheros (ath0) work as a bridged network with VMware… but I made a workaround which I want to share with you guys. Anyways I’ll have it documented if I cant remember what I did later on. I have installed VMware on my Ubuntu laptop and a edgy-alternative (server) as a guest OS within VMware. The way I did this was making my laptop into a router between the “VMware host only” net and my wireless net.

You need to have configured a host only network for your VMware machines, mine is called vmnet1 and is using the network:

192.168.154.0/24

My laptop has the following ip’s:

wireless:    ath0     192.168.20.197 (provided by DHCP)
wired:       eth0     * (not used in this example)
VMware net:  vmnet1   192.168.154.1 (static)
gateway:     default  192.168.20.1

My Ubuntu edgy server has the following ip’s:

wired:       eth0     192.168.154.2 (static)

On my laptop I have made a script that does the following:

INTERNAL=vmnet1
EXTERNAL=ath0

# Enable router functionality
echo 1 > /proc/sys/net/ipv4/ip_forward

# Enabling SNAT (MASQUERADE) functionality on $EXTERNAL
iptables -t nat -A POSTROUTING -o $EXTERNAL -j MASQUERADE

All my rules are set to accept as default, if yours are not you might want to add something like this:

iptables -A FORWARD -i $EXTERNAL -o $INTERNAL -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i $INTERNAL -o $EXTERNAL -j ACCEPT

On my VMware guest I have configured eth0 to have the static ipadress 192.168.154.2 and to use 192.168.154.1 as default gateway. The way you set this up depends on you guest OS, but you can also do this manually with:

INTERNAL=eth0

ip a add dev $INTERNAL 192.168.154.2/24
ip link set $INTERNAL up
route add default gw 192.168.154.1

Now test by pinging you host’s gateway (my laptop):

ping 192.168.20.1

Note: You propably want to set you guest OS to be able to use a DNS server.

3 Comments to Using ath0 as bridge in VMware… or almost

Manolis
October 12, 2006

Hi

I thought there would be a solution like this, I have a configuration very similar to yours, with an atheros based wireless card and vmware fails to bind to it. I was almost certain I could do it with a forwarding. Thanks for sharing the details. Will try it very soon.

Alfredo
November 2, 2006

Check /etc/vmware/locations

answer BINDIR /usr/bin answer INITDIR /etc answer INITSCRIPTSDIR /etc/init.d answer SBINDIR /usr/sbin answer LIBDIR /usr/lib/vmware-player answer DOCDIR /usr/share/doc/vmware-player answer RUNDIR /var/run/vmware answer RUN_CONFIGURATOR yes answer NETWORKING yes

answer VNET_0_INTERFACE ath0

Chetan Patil
June 26, 2007

I have managed to bridge to ath0 in VMWare. My post may be of help.

http://justbarebones.blogspot.com/2007/06/setting-up-ubuntu-704-feisty-as-vmware.html

Thx Chetan

Leave a comment