How to Set Up Network Hostname, IP, Gateway, DNS Client in Freebsd Complete

After the process of installing freebsd, then setting the network in freebsd there are two ways to do the setting, namely Dhcp (get ip address automatically on DHCP server), Static (setting ip address on freebsd manually).

For the main network configuration on freebsd there are 4, namely:

  • Hostname = the naming of freebsd whose function is as an identifying name on the internet.
  • IP (Internet Protocol) = As a protocol for connecting to the internet that contains unique numbers assigned to each connected device
  • Gateway = IP used as an entrance / gate to connect to the internet.
  • DNS Client = The address of the dns server used to query the public IP address of a domain.


Display ip address information used by Freebsd

ifconfig
Command results



Static IP configuration on em1 interface

Sign in to user root
su -

vim /etc/rc.conf

or 

nano /etc/rc.conf

Result



Add a new command in the /etc/rc.conf file
ifconfig_em1 ="inet 192.168.43.100 netmask 255.255.255.0"

defaultrouter ="192.168.43.1"
Result



Note

For ip address adjust to what is used

DNS Client using OpenDNS from google 8.8.8.8
vi /etc/resolv.conf

Change to 
nameserver 8.8.8.8
Restart Service Network and Routing
/etc/rc.d/netif restart 
/etc/rc.d/routing restart

Turn off freebsd, go to the virtual machine settings, go to the network adpater in the virtual machine virtualbox into a bridge.



Note

  • For IP Address Configuration on vps stay adjusted only the difference vps using public ip address and setting it on vps 
  • if in virtualbox using ip private settings in virtualbox

DHCP Client IP Request command to DHCP Server
dhclient "interface"
example
dhclient em0
em0 interface in virtualbox

The hostname, ip address, netmask, gateway, and dns gateway settings are not too difficult to do especially for beginners.

LihatTutupKomentar