Skip to content

Instantly share code, notes, and snippets.

@reidransom
Last active December 19, 2015 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reidransom/6011044 to your computer and use it in GitHub Desktop.
Save reidransom/6011044 to your computer and use it in GitHub Desktop.
Configure manual ip on freebsd

Configure manual ip on FreeBSD

Add these lines to your /etc/rc.conf

ifconfig_em0="inet 192.168.0.10 netmask 255.255.255.0"
defaultrouter="192.168.0.1"
hostname="hostname.domain.com"

You may need to run ifconfig to get the name of your network interface like this:

$ ifconfig
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:44:92:b6
	inet 172.18.1.19 netmask 0xffffff00 broadcast 172.18.1.255
	inet6 fe80::a00:27ff:fe44:92b6%em0 prefixlen 64 scopeid 0x1 
	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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment