Diferente da identificação genérica ethX usada pelo Linux® para identificar a interface de rede, o FreeBSD usa o nome do driver seguido por um número. A seguinte saída do comando ifconfig(8) mostra duas interfaces de rede Intel® Pro 1000 (em0
e em1
):
%
ifconfig
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=b<RXCSUM,TXCSUM,VLAN_MTU> inet 10.10.10.100 netmask 0xffffff00 broadcast 10.10.10.255 ether 00:50:56:a7:70:b2 media: Ethernet autoselect (1000baseTX <full-duplex>) status: active em1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=b<RXCSUM,TXCSUM,VLAN_MTU> inet 192.168.10.222 netmask 0xffffff00 broadcast 192.168.10.255 ether 00:50:56:a7:03:2b media: Ethernet autoselect (1000baseTX <full-duplex>) status: active
Um endereço IP pode ser designado à uma interface utilizando o comando ifconfig(8). Para torna-lo definitivo e persistente entre as reinicializações, o endereço IP deve ser incluído no arquivo /etc/rc.conf
. A seguinte entrada no arquivo /etc/rc.conf
especifica o nome da máquina, o endereço IP e o gateway padrão da rede:
hostname="server1.example.com" ifconfig_em0="inet 10.10.10.100 netmask 255.255.255.0" defaultrouter="10.10.10.1"
Use a seguinte entrada para configurar uma interface para obter sua configuração por meio do DHCP:
hostname="server1.example.com" ifconfig_em0="DHCP"
All FreeBSD documents are available for download at https://download.freebsd.org/ftp/doc/
Questions that are not answered by the
documentation may be
sent to <freebsd-questions@FreeBSD.org>.
Send questions about this document to <freebsd-doc@FreeBSD.org>.