Change MAC Address of iocage jail

Status
Not open for further replies.

Cytomax

Explorer
Joined
Nov 29, 2015
Messages
67
I leave all my computers/servers/devices with DHCP enabled and control their ip addresses via my pfsense firewall using their MAC address

How do i change or adjust the MAC address of my new jails in iocage?

When i run ifconfig in the jail its giving me the same mac address as my freenas NIC
 

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
I leave all my computers/servers/devices with DHCP enabled and control their IP addresses via my pfsense firewall using their MAC address

How do i change or adjust the MAC address of my new jails in iocage?

When i run ifconfig in the jail its giving me the same mac address as my freenas NIC
You need to enable VIMAGE (aka VNET) to give the jail it's own networking stack.
 

Binary Buddha

Contributor
Joined
Mar 6, 2016
Messages
126
You need to enable VIMAGE (aka VNET) to give the jail it's own networking stack.

Any chance you elaborate on the procedure? I tried using the vnet stuff, but the closest I get is the same MAC for bridge0 or the igb0.
 

colmconn

Contributor
Joined
Jul 28, 2015
Messages
174
MACs can be assigned to jails manually (rather than letting iocage generate them randomly) with a simple modification of your command:
Code:
iocage create --name "jailname" -r 11.2-RELEASE --ip4_addr="vnet0|xxx.xxx.xxx.xxx/xx" \
                      --defaultrouter="xxx.xxx.xxx.xxx" \
                     vnet0_mac="588F8446FC00,588F8446FC01"


MACs should be specified with no characters (e.g., :, -) between octets. The 11.2 documentation for this is currently lacking and a ticket is open to have it fixed. The docs implies that only one MAC is needed, so that's what I tried initially which did not work. Upon perusing the iocage code, I discovered that a pair of MACs is required: one for each of the epair0a and epair0b interfaces of a jail.
 
Status
Not open for further replies.
Top