Solved Best way to adress a jail

Hello,

I'm currently my FreeBSD machine and I wondering what'S best option to adress a jail with IP.

my ifconfig

Code:
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
        ether 48:5b:39:c9:68:11
        inet 192.168.2.16 netmask 0xffffff00 broadcast 192.168.2.255
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
        inet 127.0.0.1 netmask 0xff000000
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

Should I create an alias on re0 or lo0 ?

So /etc/rc.conf

Code:
cloned_interfaces="lo1"
ifconfig_lo1_alias0="inet 192.168.2.21 netmask 255.255.255.255"

or

Code:
cloned_interfaces="re0"
ifconfig_re1_alias0="inet 192.168.2.21 netmask 255.255.255.255"

Thank you in advance for sharing your knowledge and wisdom :)
 
If you use 'lo1' then your jails will use local IP address something like this '10.0.0.21' and enable firewall for NAT routing from '192.168.2.21' to '10.0.0.21'.

if you use 're0' then jails will be connected directly to your NIC card as '192.168.2.21' so no need for NAT routing.
 
Thank you for your response.

In term of security or "best practice" the best way is to use a local IP adress or connected directly to NIC ?

It sound like stupid question but I try to figure what's best for me ?

The pupose is to install stuff like plex and nextcloud in distinct jail.
 
I'm going to assume you'll be using the computer at home behind a router so direct connection to NIC is better. Personally it makes no difference unless if you want to keep jails separated from the Internet then 'lo1' is better with firewall enabled in FreeBSD. I usually find Plex or Serviio works better without the firewall.
 
Thank you very much for your response, and you guest well, the server is behind a router.

:)
 
Back
Top