2024-07-12
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
Under the root account, execute
bsdconfig
Select CBSD Config from the menu
Then select: Global Settings
Then select: natcfg
Then select: nat_enable select pf
Natip selects the local IP address,
Finally, don't forget to commit, and the global NAT configuration is complete.
For a single bhyve, you can configure NAT separately.
implement
bsdconfig
Select CBSD Config from the menu
Select Configure Bhyve Machines from the menu
Select the name of the bhyve virtual machine to be configured, such as bub12
Then select: bconfig
Then select: hbyvenic
Then select the network card: nic1
Then configure the network card ip, etc.
For each jail, you can configure NAT separately.
implement
bsdconfig
Select CBSD Config from the menu
Select Configure Jail Machines from the menu.
Select the name of the jail virtual machine to be configured, such as fb12
Then select: jconfig
Then select: jail_options
Then select the network card: nic1
Then configure the network card ip, etc.
Finally, I found that bsdconfig still cannot configure nat well, and still needs manual configuration
/usr/jails/etc # cat pfnat.conf
nat on igb0 from 10.0.0.0/8 to ! 10.0.0.0/8 -> 192.168.1.5 # // Setup by CBSD NAT
nat on igb0 from 172.16.0.0/12 to ! 172.16.0.0/12 -> 192.168.1.5 # // Setup by CBSD NAT