Setelah berhasil melakukan instalasi FreeBSD, tahap selanjutnya melakukan konfigurasi jaringan seperti IP static untuk interface jaringan yang kedua.
Menampilkan semua interface jaringan
1 | ifconfig |
Hasilnya
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM> ether 08:00:27:76:77:78 inet 10.0.2.15 netmask 0xffffff00 broadcast 10.0.2.255 nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> media: Ethernet autoselect (1000baseT <full-duplex>) status: active em1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM> ether 08:00:27:00:ca:29 inet 192.168.56.100 netmask 0xffffff00 broadcast 192.168.56.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 0x3 inet 127.0.0.1 netmask 0xff000000 nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL> groups: lo |
Menjadi user root
1 | su - |
Buka file /etc/rc.conf
1 | vi /etc/rc.conf |
Contoh isi konfigurasi untuk hostname, IP, dan gateway
1 2 3 4 5 | hostname="server.musaamin.web.id" ifconfig_em0="DHCP" ifconfig_em1="inet 192.168.56.100 netmask 255.255.255.0" #gateway defaultrouter="192.168.56.1" |
Untuk DNS Client, buka file /etc/resolv.conf, sama persis dengan os basis Linux.
1 | vi /etc/resolv.conf |
Isinya
1 | nameserver 8.8.8.8 |
Restart service jaringan dan routing
1 2 | /etc/rc.d/netif restart /etc/rc.d/routing restart |
Jika koneksi internet berasal dari DHCP, setelah restart jaringan tidak bisa terhubung ke internet, ping gagal. Jalankan perintah dhclient.
1 | dhclient em0 |
selamat mencoba 🙂
makasih tutorialnya mantap