1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FreeBSD jail with VLAN - possible?

Discussion in 'Networking' started by donduq, Dec 19, 2012.

  1. donduq

    donduq New Member

    Messages:
    38
    Thanks Received:
    5
    I would like to do the following on my FreeBSD 9.1 server:

    The host's re0 interface is connected to a managed switch and configured as a trunk port.

    The host itself should be in VLAN 10 and get its IP address from a DHCP server.

    Then I have a couple of jails. Those should be in VLAN 20 and also get their IPs via DHCP.

    Is this possible and if yes then how? :)

    In the past I have used VIMAGE and the method described on http://druidbsd.sourceforge.net/vimage.shtml.
     
  2. Crest

    Crest Member

    Messages:
    117
    Thanks Received:
    34
    You could use ng_bridge and ng_eiface to create the virtual interfaces and run a DHCP client on each interface in the host. The jails could be started with setfib if their routing tables should conflict with the hosts. I can provide the rc script for this setup if you want to try it.
     
    donduq thanks for this.
  3. bbzz

    bbzz Member

    Messages:
    868
    Thanks Received:
    123
    Yes, vlan(4)
    Along the lines of
    Code:
    ifconfig vlan0 create
    ifconfig vlan0 vlan 100 vlandev bge0
    


    That's one vlan.
     
  4. donduq

    donduq New Member

    Messages:
    38
    Thanks Received:
    5
    That's an offer I can't refuse. So please, by all means :)