How to run a service on the second interface - FreeBSD
Add the service name and specify the fib “apache24_fib="1”
to /etc/rc.conf
, in our case is “1” this can be found if we check the network interfaces with ifconfig
vmx0: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500options=4e403bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,NOMAP>ether 1e:00:ae:00:00:bcinet 162.19.189.18 netmask 0xfffffff0 broadcast 162.19.189.31media: Ethernet autoselectstatus: activend6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>vmx1: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500options=4e403bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,NOMAP>ether 02:00:1a:9a:00:69inet 10.10.1.74 netmask 0xffffff00 broadcast 10.10.1.255
fib: 1
media: Ethernet autoselectstatus: activend6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>inet6 ::1 prefixlen 128inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3inet 127.0.0.1 netmask 0xff000000groups: lond6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
Here is our: /etc/rc.conf
hostname="freebsd13.localdomain"
ifconfig_vmx0="DHCP fib 0"ifconfig_vmx1="SYNCDHCP fib 1"
sshd_enable="YES"ntpdate_enable="YES"ntpd_enable="YES"
apache24_fib="1”
Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="NO"
#vmware supportvmware_guestd_enable="YES"
automatic fsck
fsck_y_enable="YES"background_fsck="NO"
Here is an example of how you can run a ping test via second interface:
[root@freebsd13 ~]#
setfib 1 ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes64 bytes from 8.8.8.8: icmp_seq=0 ttl=113 time=2.295 ms64 bytes from 8.8.8.8: icmp_seq=1 ttl=113 time=1.737 ms64 bytes from 8.8.8.8: icmp_seq=2 ttl=113 time=1.738 ms64 bytes from 8.8.8.8: icmp_seq=3 ttl=113 time=1.634 ms