I’m trying to understand how I can make jails have a fixed IP, and be able to have them communicate between eachother (my usecase being one jail having an apache server, and providing reverse proxying for services running in other jails).
The problem I’m running into is that the jails (which have both NAT and VNET enabled) can ping and generally interact with one another, but their IPs randomly change.
I’ve tried disabling NAT and just keeping VNET enabled, but then the jails can’t ping eachother.
Turn off NAT. Set a static IP address in the same subnet /24 on each jail.IPV4 interface to vnet0, probably, common for the jais. Set a default router IP.
This works for me.
You can only edit a jail when it is stopped.
Okay, yeah, I must’ve been doing something wrong last time I tested, now I can actually ping the other jail if I set both up like that.
Let’s say I have jail A and jail B.
-If both have NAT disabled, they can ping eachother, but can’t reach the internet.
-If both have NAT enabled, they can ping eachother and reach the internet, but the IPs change.
-If one has NAT enabled and one has NAT disabled, they can’t ping eachother.
How can I make it so they still have internet access if NAT is disabled?
Your default gateway here is different than in your jails. Edit your jails and input an IP that is in the same subnet, and edit your jail default gateway to read the same as the screenshot above.
The 172.x.x.x IP is only necessary when using NAT. If you use VNET, your jails are essentially part of your local network, and need to have an IP within that network. They also need to be set to the same gateway as your local network.