Static IP problem connecting to internet

Greetings
I have a fresh install of FreeBSD 12 that I am trying to configure to connect to the internet over ethernet cable.
I am fairly certain that the settings provided by my ISP are correct because when I connect a elementaryOS laptop with those settings to the ethernet cable there is Internet access.
When I connect my FreeBSD computer however, ping 8.8.8.8 yields sendto: No route to host

rc.conf is as follows:
Code:
hostname="mail1.xxx.com"
ifconfig_nfe0="inet xxx.50.247.150 netmask 255.255.255.248"
defaultrouter="xxx.50.247.145"
sshd_enable="YES"
dumpdev="AUTO"
resolv.conf contains the appropriate nameserver addresses.

Does anyone have any ideas on what to try next to get the connection to work?
Thanks in advance
 
After you update settings, use service resolv onerestart, service routing onerestart and service netif onerestart, so you won't have to reboot after you adjust settings.

resolv.conf
Code:
search routernameaddress.net
nameserver 192.168.1.254
nameserver xxxx:xxxx:xxx:xxxx::1  #ipv6
options edns0

In rc.conf, use automatic settings, then get the results of ifconfig and fill in the values for rc.conf. Also get settings from your router's diagnostics and your computer's traceroute and traceroute6for rc.conf values. It's better to set the default router for each ipv4 and if you're using ipv6.

On my setting for defaultrouter, I have 192.168.1.254. That's generic for IPv4.
 
Does anyone have any ideas on what to try next to get the connection to work?

I suggest basic troubleshooting.
  1. Can you ping your default gateway?
  2. Does your routing table (netstat -r) show your default route correctly?
  3. Can you do a traceroute to 8.8.8.8? If not, where does it stop?
  4. Can you resolve domain names?
 
1. No
2. No
3.No
4. No
Yet when I use the same credentials on a linux flavour machine, everything works. I know very little about freebsd. Is there something in a default installation that needs to be opened up?
 
netstat -rn would be the logical next step. The error message says that there is the error. It shoudl show something like this:
Code:
Destination        Gateway            Flags     Netif Expire
default            xxx.50.247.145      UGS         nfe0
127.0.0.1          link#2             UH          lo0
xxx.50.247.144/29   link#1             U           nfe0
xxx.50.247.150      link#1             UHS         lo0
We don't want to involve name resolution at this point, we just want basic IP connectivity. Name resolution then comes in the next step.

We may also have a look at ifconfig nfe0, and check if we can ping xxx.50.247.150 and ping xxx.50.247.145 (the latter may not always work, depending on the kind of router there is).
 
netstat -rn returns exactly what you mention above, but in addition there is a section with Internet6 information

ping xxx.50.247.150 works
ping xxx.50.247.145 does not work. Router is juniper os
 
What is the output of ifconfig(8)? If you really entered the settings correctly, then you have an issue with the cabling, the switch, or the router. Or you have installed a firewall on FreeBSD and configured it badly. Might that be the case?
 
See the screenshot attached of the ifconfig
This is a fresh install so I never configured a firewall explicitly.
Also , somewhere I read that if the IPv6 DNS is not configured there can be problems, but I don't know how to disable IPv6 or to set the nameservers for IPv6
 
He already stated pinging his default gateway does not work. I don't see anything wrong, really. If there is no firewall configured, it must be cabling or the router. But that should not be the case since his linux distro works.
 
If the IP address is indeed correct then there's something wrong on the provider side. If the default gateway cannot be accessed you cannot connect to anything outside of the local network. There's nothing "special" to configure on the FreeBSD side for this.
 
Perhaps the ISP remembers the first MAC address it sees and blocks all other MAC addresses for the first x hours?
 
netstat -rn returns exactly what you mention above, but in addition there is a section with Internet6 information

ping xxx.50.247.150 works
ping xxx.50.247.145 does not work. Router is juniper os

Ack. Yes, ther is ip6 stuff also, but that should not bother us. Some routers do just not answer to a ping to themselves, but would otherwise work.
One more thing to check: run tcpdump -ni nfe0, then in another terminal run the ping xxx.50.247.145 again.
 
If the IP address is indeed correct then there's something wrong on the provider side. If the default gateway cannot be accessed you cannot connect to anything outside of the local network. There's nothing "special" to configure on the FreeBSD side for this.

Tell me I'm wrong, but I'd think the "no route to host" error comes from the kernel not finding a way to deliver the packet.
 
You get the same error message if you try to access something outside your local network and an incorrect (or not working) gateway.

It's not common to disable pings on a gateway, it interferes with basic troubleshooting and doesn't "improve" security.
 
It's not common to disable pings on a gateway, it interferes with basic troubleshooting and doesn't "improve" security.

I agree, it's a pain when troubleshooting. But I've seen a lot of these, where you get a reply for traceroute (as soon as you aren't behind a NAT), but not for ping (including my provider). And I've witnessed these "corporate security" discussions. :(
 
Alas, new network card makes no difference on FreeBSD.
I then did a fresh install of linux on the same hardware and the connection works which leaves me to conclude that there is something wrong with my FreeBSD install rather than the router.
 
Back
Top