Hi
My goal is to setup VNET Jails with their own IP in my home network. For example, my home router has IP 192.168.1.1 and this FreeBSD server has IP 192.168.2.1
I would like my Jail to have unique IP in the home LAN, e.g: 192.168.2.2, 192.168.2.3 and etc.
The configs I am having right now:
/etc/jail.conf.d/example.conf
I have couple questions
My goal is to setup VNET Jails with their own IP in my home network. For example, my home router has IP 192.168.1.1 and this FreeBSD server has IP 192.168.2.1
I would like my Jail to have unique IP in the home LAN, e.g: 192.168.2.2, 192.168.2.3 and etc.
The configs I am having right now:
On the host:
/etc/rc.conf
Code:
defaultrouter="192.168.1.1"
gateway_enable="YES" # do I need this enabled?
cloned_interfaces="bridge0"
ifconfig_bridge0="inet 192.168.2.1/24 addm em0 up" # do I need to add alc0 into bridge0?
ifconfig_em0="up" # can I also assign IP to this em0, which is my actually physical interface
/etc/jail.conf.d/example.conf
Code:
example {
exec.prestart = "ifconfig epair0 create up";
exec.prestart += "ifconfig bridge0 addm epair0a up";
exec.poststop = "ifconfig epair0a destroy";
vnet;
vnet.interface = "epair0b";
.......... # other configs
}
Inside my example Jail:
/etc/rc.conf
Code:
defaultrouter="192.168.2.1"
ifconfig_epair0b="192.168.2.2"
I have couple questions
- Should I add em0 (the physical interface of my server) to the bridge if I enable gateway service? I thought gateway service can auto-forward ethernet packets from physical interface to the bridge.
- Do I need to assign an IP to em0?
- Do I need to assign an IP to epair0a?
- If I have multiple VNET Jails, bridge is mandatory or is there a way I can achieve without bridge for having VNET Jails with unique IPs?