# Network issues on newly installed system



## Phobios (Dec 14, 2018)

Hi all, first-time poster and freebsd noob here, just installed my first system and am having some difficulties. 

When booting up the network is not automatically enabled. In fact the network interface seems to be down with ifconfig showing _status: no carrier_. By manually doing `ifconfig ix0 up` it is enabled and then `dhclient ix0` will give me access to the network. How can I set it up so that I don't have to do this across reboots?

The next issue is that name resolving doesn't work. I added both my router which supports name lookups to /etc/resolv.conf and also verified that it can do name lookups by issuing `drill google.com @192.168.1.1`, but trying to run `ping google.com` will result in _'ping: cannot resolve google.com: Host name lookup failure'_

Thanks for any help!


----------



## ralphbsz (Dec 14, 2018)

First: Read the documentation.  Unlike some other OSes, FreeBSD has excellent documentation, which is centralized in the handbook.  There is a handbook chapter on network configuration, and one one DHCP.  Just look around the web for "FreeBSD handbook", find the copy that matches the version you have installed, and start reading.  Most likely, after that your problem will go away.

If it doesn't: What does your /etc/rc.conf look like?  More accurately, what are the network-related lines in there?  I'm not going to post the ones from my machine at home (it doesn't use DHCP, but has a static address), but there needs to be a line there that looks roughly like ifconfig_ix0="DHCP".  Next problem, your DNS: Editing /etc/resolv.conf by hand _before_ running DHCP is silly, since the DHCP client typically overwrites that file.  In theory, your DHCP server should have told you who your DNS server is, which should have been recorded automatically in /etc/resolv.conf.

If you have configured all that correctly, the network should come up at the next boot.  If it doesn't, then using commands like ifconfig and dhclient is not a good idea, other than for debugging: instead of doing things manually, you should fix the automated process.  One way to test the automated process (which is roughly equivalent to what happens during boot, just without having to wait for a full reboot) is "service netif restart" (or ... stop followed by ... start).


----------



## Phishfry (Dec 14, 2018)

Alot of the 10GbE cards must load a firmware and it is done in /boot/loader.conf like the handbook for ix(4) shows:
if_ixgbe_load="YES"


----------



## Phobios (Dec 17, 2018)

Thanks for your answers. I have managed to get the interface up and connected at boot. Weird thing is that when I purchased my motherboard it said they were just regular gb ethernet ports, but checking dmesg on my system it says 10gbe.

Another weird thing is that my dhcp server doesn't supply me with a nameserver. It does for all of my other machines. Adding a nameserver to resolv.conf manually was just to test, but shouldn't it work if I add it manually? Because it doesn't. I have checked the freebsd handbook for a solution, but cannot find anything useful. So, kinda stuck..

Edit: Ok, silly mistake, I only added the ip address of the nameserver to resolv.conf, and not `nameserver <ip-address>` which made it work. Still, as ralphbsz said, this should be automated.


----------



## Phishfry (Dec 17, 2018)

Phobios said:


> but shouldn't it work if I add it manually? Because it doesn't.


No adding it settings manually doesn't help much. If everything is working correctly the service `resolvconf` is sent the dhcp packets and stores its settings to /etc/resolv.conf. It is auto-populated.
If resolv.conf is empty then you have mis-configured network setting on your side or the providers side.

There is some problems with dhcp and dhclient recently that affect more than just em(4) interface.
The fixed setting below even helped an Amazon cloud user here.
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229432#c3


----------



## Polyatomic (Dec 17, 2018)

Lordly correct operator Phobios, I salute. A problem solver you are, rejoice as your FreeBSD intuition widens. `:)`


----------

