Latest interface: 0.3.1
Latest system: 010

6 posts

Posted on 16 January 2017 @ 14:35

I'm having trouble setting up my static ip. I modify my /etc/rc.conf, but after restarting I'm not getting any ip and especially not the one I set as static ip in rc.conf. Can somebody see what I'm doing wrong / forgetting. Thanks in advance:

# add interfaces at your leisure when requiring static configuration
# ifconfig_DEFAULT="DHCP"
# some examples (you can override your own interface keeping DEFAULT intact)
# example1: static IP address (also set defaultrouter and also /etc/resolv.conf)
ifconfig_em0=inet netmask
# example2: enable 'Jumbo Frames' which is MTU larger than 1536 bytes
# ifconfig_em0="DHCP mtu 7000"
# example3: force interface to gigabit full-duplex link if autodetect is borked
# ifconfig_em0="DHCP media 1000baseTX mediaopt full-duplex"

# if you want static IP, you need to specify default gateway here
# don't forget to edit /etc/resolv.conf for DNS configuration as well!
# note that DHCP interfaces may override the /etc/resolv.conf

As you notice I want as static IP.


1199 posts

Posted on 17 January 2017 @ 11:32
First of all you should use " " parenthesis.

ifconfig_em0=inet netmask
should be:
ifconfig_em0="inet netmask"

Second, you should check whether 'em0' is your network adapter. Type 'ifconfig' to see all adapters you currently have. If you see an adapter having the line "status: no carrier" that means that no cable is connected to that adapter.

1199 posts

Posted on 19 February 2017 @ 04:55edited 05:14 32s
For other readers:

After having configured /etc/rc.conf you also need to configure the default gateway and the DNS servers. But first, make sure that dhclient (DHCP client) is not running:

Configuring default gateway

Automatic (upon boot), modify in /etc/rc.conf:

Note: How to know this IP number? It should be the same as on your Windows/Mac computer. Somewhere in the Network adapter settings (IP address) you should also find the default gateway address, at the same place where you would see (primary/secondary) DNS servers listed.

Configuring DNS (nameserver)
Overwrite the current /etc/resolv.conf by executing:

echo "nameserver" > /etc/resolv.conf

Test using: ping
Test whether IPv4 internet works: ping
Test whether Google DNS works: drill @

You can change your nameserver to Google ( to test, but i suggest you only use this for testing, and use your ISP DNS instead for privacy reasons.
Last Page

Valid XHTML 1.1