Static IP problem connecting to internet

Dimitri

New Member


Messages: 10

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
 

sidetone

Daemon

Reaction score: 398
Messages: 1,122

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.
 

tommiie

Active Member

Reaction score: 72
Messages: 246

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?
 
OP
OP
D

Dimitri

New Member


Messages: 10

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?
 

PMc

Well-Known Member

Reaction score: 155
Messages: 471

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).
 
OP
OP
D

Dimitri

New Member


Messages: 10

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
 

tommiie

Active Member

Reaction score: 72
Messages: 246

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?
 
OP
OP
D

Dimitri

New Member


Messages: 10

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
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,771
Messages: 30,912

Try pinging your default gateway.
 

tommiie

Active Member

Reaction score: 72
Messages: 246

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.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,771
Messages: 30,912

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.
 

tommiie

Active Member

Reaction score: 72
Messages: 246

Perhaps the ISP remembers the first MAC address it sees and blocks all other MAC addresses for the first x hours?
 

PMc

Well-Known Member

Reaction score: 155
Messages: 471

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.
 

PMc

Well-Known Member

Reaction score: 155
Messages: 471

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.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,771
Messages: 30,912

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.
 

PMc

Well-Known Member

Reaction score: 155
Messages: 471

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. :(
 
OP
OP
D

Dimitri

New Member


Messages: 10

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.
 
Top