# FreeBSD 8.2-RC3 no network?



## moesasji (Feb 14, 2011)

I just upgraded my stable 8.2-RC2 to 8.2-RC3 with my usual kernelconfig (mainly generic, just minor things different). Strangely enough the box comes up without access to internet and I can't seem to figure out where it goes wrong, hence the request for suggestions.

The system uses DHCP, which is enabled in /etc/rc.conf (ifconfig_re0="DHCP", which has always worked)

Running `/etc/rc.d/netif restart` gives me the information below for the relevant network card:


```
re0: flags=8843<UP, BROADCAST, RUNNING, SIMPLEX,MULTICAST> metric 0 mtu 1500
   options=398b<RXCSUM,TXCSU,VLAN_MTU,VLAN_HWTAGGING,VLAN,HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
   ether 00:19:......
   media: Ethernet autoselect (none)
   status: no carrier
```

Which according to the manual indicates that no cable is present, yet I clearly see the lights flashing on the router for this cable indicating some form of communication is going on. My only remaining thought was the the network card died, however checking with a linux-rescue CD proofs that the hardware is OK (network comes up under linux).

Anyone any suggestions on how to fix this, as I'm stuck at this point?


----------



## wblock@ (Feb 14, 2011)

There's been talk about re(4) on the freebsd-net mailing list lately.

Some simple things to try would be taking the interface down and then up with ifconfig(8), reconnecting the cable or trying a different one, or resetting the Ethernet switch.  You can also disable the checksum offloading with ifconfig(8).


----------



## francis (Feb 15, 2011)

Hi, only things that comes to my mind: if You obtain IP address via DHCP, check /etc/resolv.conf file for errors in DNS address, or /etc/hosts file?


```
media: Ethernet autoselect (none)
status: no carrier
```
Check all cables - maybe one of them is unplugged? Do it, to be simply sure.

Did You try to use *dhclient* utility? Sometimes I have similar problem with obtaining IP address from DHCP. But remember one thing; You must have the *Berkeley Packet Filter* (BPF) configured in your kernel.

[CMD=""]# dhclient re0[/CMD]

There is one more thing (it also sometimes helps me with DHCP problems). Try add to the /etc/rc.conf file something like that; 

```
ifconfig_re0="DHCP"
hostname="Your_hostname"
synchronous_dhclient="YES"
```
 But you already mentioned that it's always worked. 

*Try it*: [CMD=""]# ifconfig re0 IP_Address/XX[/CMD]

You can also verify that an Ethernet card is configured correctly, using e.g ping utility.
[CMD=""]# ping -c3 IP_Address[/CMD]

Maybe Your card, which You are using is unsupported by FreeBSD 8.2-RC3? Maybe some router settings are not set properly?
What about [CMD=""]# dmesg | grep re0[/CMD]


----------



## wblock@ (Feb 15, 2011)

francis said:
			
		

> There is one more thing (it also sometimes helps me with DHCP problems). Try add to the /etc/rc.conf file something like that;
> 
> ```
> ifconfig_re0="DHCP"
> ...



The same, but a little shorter:

```
ifconfig_re0="SYNCDHCP"
```


----------



## moesasji (Feb 15, 2011)

wblock said:
			
		

> The same, but a little shorter:
> 
> ```
> ifconfig_re0="SYNCDHCP"
> ```



Many thanks Francis and WBlock. Switching to the synchronous DHCPClient indeed brings up the network and going back to setting it to DHCP only brings it down (after netif restart). So problem solved. Seeing that this behavior changed between RC2 and RC3 it must be the following patch that introduced it?

20110114 - Limit re(4) rx buffer size for certain chips (yongari@) (r217296, merged as r217647)


----------



## moesasji (Feb 15, 2011)

I don't see an edit button, hence the reply.

Is it worth flagging this problem up on the stable-mailing list?


----------



## SirDice (Feb 15, 2011)

Fix the cable issue first. "No carrier" means there's no connectivity. Without connectivity everything else will fail too.


----------



## moesasji (Feb 15, 2011)

SirDice said:
			
		

> Fix the cable issue first. "No carrier" means there's no connectivity. Without connectivity everything else will fail too.



*For clarity:* the issue has been fixed and has nothing to do with cabling and/or hardware (as demonstrated with the linux liveCD + the fact that switching to syncdhcp brings up the network). 

So the thread should be marked as solved, except for the question whether or not this is a bug in RC3 that should be reported as it wasn't present in RC2?


----------



## wblock@ (Feb 15, 2011)

moesasji said:
			
		

> I don't see an edit button, hence the reply.
> 
> Is it worth flagging this problem up on the stable-mailing list?



Maybe.  The problem is still a little fuzzy; the difference between DHCP and SYNCDHP in the startup is that the first keeps on booting while dhclient(8) runs in the background.  That can cause a problem if network services start before the network gets set up, so SYNCDHCP just stops and waits for dhclient to finish getting a lease.

Neither should affect manually running dhclient(8):
`# dhclient re0`

That should always get a lease.

I guess there could be some kind of timing bug introduced by a change in re(4) that affects /etc/rc.d/netif.


----------



## yongari@ (Feb 15, 2011)

No, there is no race you mentioned. I believe dhclient(8) should be taught to know whether it got a "resolved link" or not; dhclient used to rely on "link UP". The link UP does not necessarily mean it successfully established a valid link with link partner. For example, auto-negotiation may take several seconds to complete but dhclient thinks it can send or receive packets while the auto-negotiation is in progress once it sees link UP.


----------



## moesasji (Feb 15, 2011)

wblock said:
			
		

> Maybe.  The problem is still a little fuzzy; <snip>
> 
> Neither should affect manually running dhclient(8):
> `# dhclient re0`
> ...



Typing in this command indeed gives a lease when the network is down. Also `# ifconfig` brings up the network. It is purely `# /etc/rd.d/netif restart` which doesn't bring up the network 

On top, `# /etc/rc.d/netif restart` in fact takes down the network when a network connection was up and running. Weird :q


----------



## moesasji (Feb 15, 2011)

Ignore the bit about `# ifconfig` in my previous post...that's clearly nonsense as I misinterpreted the output. :r


----------

