Freebsd networking

From wikinotes
Revision as of 14:29, 20 September 2020 by Will (talk | contribs) (Will moved page Freebsd-networking to Freebsd networking)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Manual Connection

# Starting a manual network connection from CLI
sudo route add default 192.168.1.1 # Set path to your router
ifconfig                           # find interface you want
ifconfig em0 up                    # set interface 'up'
dhclient em0                       # (equivalent of DHCPCD, requests IP address)

Configuration

Static IP

# /etc/rc.conf
ifconfig_nfe0="inet 192.168.1.220 netmask 255.255.255.0"
defaultrouter="192.168.1.1"
# If you still are not able to get outside the internal
# network, try deleting and re-adding the default router from CLI
route delete default
route add default 192.168.1.1  

# The following should restart your internet connection.
ifconfig em0 inet 192.168.0.254 netmask 255.255.255.0

Dynamic IP