# jails and mac address?



## wonslung (Jun 18, 2009)

Is there anyway to make the mac address for each jail appear different for each outgoing ip?

It would likely make my life easier for routing purposes


----------



## vivek (Jun 18, 2009)

Noop. Freebsd jail can only lock down certain part of the system. It can not assign mac for jails. You need vmware like product to do something like that. May be upcomming FreeBSD v8.0 can do the trick for networking as it has new visualization stack.


----------



## wonslung (Jun 18, 2009)

bah, well i AM using pfsense as my router so maybe i can figure out how to make it work.  I currently have "static dhcp" setup where it gives out ip's based on the mac address....I'm sure it can handle normal static ip as well but i'm not 100% sure it can handle BOTH at the same time, but thats probably a question i should ask in the pfsense forum, so off i go =)


as far as the mac address thing went, i thought there might be a way to make "virtual" interfaces and then bridge them all....or something...oh well, that would proabbly be messy anyways.


----------



## Fred (Jun 18, 2009)

I wanted to do something similar a couple of months ago ; I managed to by using tap devices to fake ethernet cards (and giving them MAC addresses), linking them together with a bridge device. This setup is rather messy as you say, but it works ; I described it in details in a post to freebsd-questions@. A copy is available at <http://www.mail-archive.com/freebsd-questions@freebsd.org/msg208569.html>.

In the thread that ensued, an other solution with netgraph was examined by Nikos Vassiliadis ; but ARP resolution was done by the wrong card, which was a show stopper for me. Another track was hinted at by Nikos, using VIMAGE, much cleaner. However, it wasn't available yet at the time of the thread. It should now, but I didn't tried it.


----------



## wonslung (Jun 18, 2009)

That's pretty cool.  I finally ended up figuring out a way to do it without the need for new mac addresses but i might switch to one of those for a couple of other reasons. 
thanks for that.


----------

