Solved Ping indicates I'm not connected

using 11.2 (BTW).
if I type "ping 8.8.8.8" I get "no route to host" then I use ^C to stop it. command reports 100% loss.
Where do I go to configure the ethernet port?
 
FreeBSD handbook
Go to Chapter 11: Configuration and tuning
Go to Section 11.5: Setting up network interface cards

I just looked at it, and it is pretty concise and clear, but only for the case that you are assigned an IP address using DHCP, which is the common case. If you are using a static address, then
  1. talk to your network administrator (which might be yourself!) about what IP address, network, broadcast, DNS server etc. you need to use, then
  2. try those settings with an ifconfig(8) command (the link goes to the man page), and finally
  3. once you have it working make the settings permanent in rc.conf(5).

If you are using a GUI (like gnome or KDE), there are probably graphical tools for administering this, in particular for the today common case of wireless on laptops. I have no experience with GUIs on FreeBSD, so I can't help with that.
 
#ifconfig_em0="DHCP" gives command not found
I guess you figured out yourself that this line belongs in /etc/r.conf since you marked the thread solved...

Just wanted to mention something.
In general, when a problem is solved, it's nice to post something like:
"Adding the following line to some/file and running this [I]command[/I] did the trick."
That will help others with the same problem :)
 
The "no route to host" error indicates that there's something wrong with your routing table. To be even more precise: I think that you never set up a so called "default route".

TCP/IP networking 101: When you set up your NIC with an IP address and network mask then your server will know that it belongs to a network which size is defined by the network mask. Example: 10.0.1.25/255.255.255.0. As such I know that this network range stretches between 10.0.1.1 and 10.0.1.255 (that's the basic theory at least, I'm skipping specifics). How do I know? Because of those 255's which tell me that the corresponding part of the IP address can't change. So only the 0 provides maximum "change", thus 1 - 255 (in theory at least).

So how does this setup know how to reach anything beyond this local network? The default route:

Code:
peter@zefiris:/home/peter $ netstat -4rn
Routing tables

Internet:
Destination        Gateway            Flags     Netif Expire
default            10.0.1.1           UGS         em0
10.0.1.0/24        link#1             U           em0
10.0.1.5           link#1             UHS         lo0
127.0.0.1          link#2             UH          lo0
See? It knows that em0 (the link itself) is supposed to be used to access the 10.0.1.0/24 network. Anything beyond that gets sent off to 10.0.1.1.

If I wouldn't have this default rule in place then my system would only know how to access the local network. Anything beyond that.... there would literally be no route to that host.

So your solution?

Either set up your system to use DHCP as mentioned by the others above, this will usually set everything up for your automatically. OR... Find out the IP address of the router and add that manually.

On the command line you'd use: # route add default <IP address>.

And to make sure this is set up automatically during boot you'd add:
Code:
defaultrouter="<IP address>"
...to your /etc/rc.conf file. Where you'd obviously need to replace that with your actual router address.
 
Back
Top