Solved No internet over ethernet 're0'

Hi
I am having a problem with wired connectivity. When I connect my system of Ethernet cable, although ifconfig is showing 'active' under status, but I cannot ping (or browse) any website. The Ethernet Card is "Realtek RTL810xE PCI Express Fast Ethernet controller". Here is the output of ifconfig:
Code:
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
    ether a3:fd:c7:e3:5a:da
    inet 192.168.2.91 netmask 0xfffff000 broadcast 192.168.15.255 
    media: Ethernet autoselect (100baseTX <full-duplex>)
    status: active
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
and output of /etc/rc.conf
Code:
sendmail_enable="NONE"
hostname="pc"
ifconfig_re0="DHCP"
#wlans_run0="wlan0"
wlans_ral0="wlan0"
ifconfig_wlan0="WPA DHCP"
local_unbound_enable="YES"
sshd_enable="YES"
moused_enable="YES"
ntpdate_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
#slim_enable="YES"
Kindly guide me to solve this problem.
 
The problem is fixed by adding nameservers to resolv.conf.
You should check the DHCP settings on your router. You get the nameservers through DHCP, anything you set by hand is likely to get overwritten by the next DHCP request/response.
 
You should check the DHCP settings on your router. You get the nameservers through DHCP, anything you set by hand is likely to get overwritten by the next DHCP request/response.
I took the settings from my linux installation, where ethernet was working fine.
 
The problem here is that you have provided insufficient information for us to find or debug your real problem. We know that em0 is configured via DHCP. We know that you "can't ping any website", but we don't know what you mean by that. Is the problem hardware connectivity, routing, or DNS? Given that it fixed itself by hand-editing resolv.conf, it seems likely that it was DNS.

To diagnose this yourself, you could have done a few steps. First, ping your own IP address 192.168.2.91, then use tcpdump to see whether any other hosts are on the network. In particular, check your default gateway is correctly configured and reachable. Your netmask is a little unusual (normally, the 192.168.x.y networks are configured with /24 netmasks, and you have /20), so my first suspicion was that the gateway is at a different address, but it seems that wasn't it. To find out who your gateway is, use either the route or netstat -r commands.

Once you know that the hardware works (to the wire and back), and that your gateway exists and is reachable, you can check that low-level connectivity (through the gateway) to the outside world exists, for example with "ping 1.1.1.1" or 8.8.8.8.

And if you get this far, the easiest way to test DNS is to lookup the IP address for some well-known and reliable host, for example "ping www.google.com" or www.yahoo.com. Warning: Using the ping command mixes two things, can the name be resolved to an IP address, and is that IP address reachable. If it doesn't work, you should test just DNS itself with the host or dig commands.

So far, so good. It seems you got all of that to work. But there is still a big structural problem: You had to edit resolv.conf yourself. This means that the combination of your DHCP client and the DHCP server (in your gateway or further upstream) is not working correctly. At this point, you should probably review /etc/dhclient.conf, and manually try to figure out whether DHCP works correctly and reliably. Copying it from from another OS (such as Linux) might work, but there are no guarantees of that, and you are better off in the long run if you understand how FreeBSD DHCP works.
 
Back
Top