# Trouble getting box connected



## Harley (Apr 28, 2013)

rc.conf

```
hostname="xxxxxxxxxxxxx.net"
sshd_enable="YES"
moused_enable="YES"
ifconfig_rl0="DHCP"
defaulrouter="192.168.1.1"
inetd_enable="YES"
```
resolv.conf

```
nameserver 192.168.1.1
nameserver 192.167.1.2
```
hosts

```
::1    localhost localhost.net
127.0.0.1 localhost localhost.net
```
hosts.conf

```
order   bind,hosts
multi on
nospoof on
dns
```
When I try to ping 8.8.8.8 all it says is "no route to host". During boot up I see it say "network is unreachable". I have been away from bsd FreeBSD for quite a while.


----------



## wblock@ (Apr 28, 2013)

Harley said:
			
		

> rc.conf
> 
> ```
> hostname="xxxxxxxxxxxxx.net"
> ...



Default router is one of the things autoconfigured by DHCP.  Don't set it manually when using DHCP.  Also, why are you running inetd(8)?



> resolv.conf
> 
> ```
> nameserver 192.168.1.1
> ...



Likewise, DNS is configured by DHCP.  /etc/resolv.conf is overwritten when dhclient(8) gets a lease.



> hosts.conf
> 
> ```
> order   bind,hosts
> ...



Why are you doing this?


----------



## Harley (Apr 28, 2013)

Running the inetd for FTP (this is the way I remember doing it).

I'm trying different things to try to get the box connected, on install I see it get the lease with DHCP but I never get a connection to the Internet. Fresh install `ifconfig` just shows 0.0.0.0. I can't figure out why it won't pull IP.


----------



## Harley (Apr 28, 2013)

rc.conf

```
hostname="xxxxxxxxxxxxx.net"
sshd_enable="YES"
moused_enable="YES"
ifconfig_rl0="DHCP"
inetd_enable="YES"
```
host.conf

```
hosts
dns
```
resolv.conf

```

```
Changed back to this.


----------



## Harley (Apr 28, 2013)

rc.conf

```
hostname="xxxxxxxxxxxxx.net"
sshd_enable="YES"
moused_enable="YES"
ifconfig_rl0="DHCP"
inetd_enable="YES"
```
resolv.conf

```

```
hosts.conf

```
hosts
dns
```
These are the current values.


----------



## wblock@ (Apr 28, 2013)

What does ifconfig(8) show?

Disable inetd(8), at least temporarily.  ftpd(8) can be run without it, but is preferably not run at all.


----------



## Harley (Apr 28, 2013)

Disabled inetd in rc.conf.

`ifconfig`

```
rl0: flags=8843<UP,RUNNING,BROADCAST,SIMPLEX,MULTICAST> METRIC 0 MTU 1500
options=2008<VLAN_MTU,WOL_MAGIC>
ETHER 00:08:A1:A2:be:0f
inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet Autoselect (100baseTX <full duplex>)
status: active
```


----------



## kpa (Apr 28, 2013)

Can you run `# dhclient rl0` and post the output here.


----------



## Harley (Apr 28, 2013)

`# dhclient rl0`

```
dhclient already running, pid:1860.
exiting
```


----------



## kpa (Apr 28, 2013)

Ok do this first:

`# service netif stop rl0`


----------



## Harley (Apr 28, 2013)

`# service netif stop rl0`

```
Stopping dhclient.
Stopping Network: rl0.
rl0: flags=8843<UP,RUNNING,BROADCAST,SIMPLEX,MULTICAST> METRIC 0 MTU 1500
options=2008<VLAN_MTU,WOL_MAGIC>
ETHER 00:08:A1:A2:be:0f
inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet Autoselect (100baseTX <full duplex>)
status: active
```


----------



## kpa (Apr 28, 2013)

And if you then run dhclient(8)?


----------



## Harley (Apr 28, 2013)

`dhclient rl0`

```
rl0 has a bad address
DHCPDISCOVER on rl0 to 255.255.255.255 port 67 interval 6
```


----------



## Harley (Apr 28, 2013)

`# dhclient rl0`

```
APR 28 16:52:52 mydomain.net routed[1992]: rl0 has a bad address
DHCPDISCOVER on rl0 to 255.255.255.255 port 67 interval 6
```

That was the full output, sorry.


----------



## Anonymous (Apr 29, 2013)

Harley said:
			
		

> Running the inetd for FTP (this is the way I remember doing it).
> 
> I'm trying different things to try to get the box connected, on install I see it get the lease with DHCP but I never get a connection to the Internet. Fresh install `ifconfig` just shows 0.0.0.0. I can't figure out why it won't pull IP.



By chance, is your internet service provider Comcast? Comcast requires a domain name in the DHCP request. Without that, DHCP won't get the IP and sets the interface to 0.0.0.0.

If YES (= Comcast), you need to somehow figure out the connection specific DNS-suffix, which is something like ????.mo.comcast.net. I cannot tell it exactly, since I am not in the US. Then edit the file /etc/dhclient.conf to the following:


```
interface "rl0"
{
    send host-name "????.mo.comcast.net";
    request subnet-mask, broadcast-address, time-offset, routers,
    domain-name, domain-name-servers, host-name;
    require host-name;
}
```

Replace ????.mo.comcast.net with the exact DNS suffix. I guess, .mo. in there may be the code of Missouri, but again I cannot figure this out from outside the US.


----------



## Harley (Apr 29, 2013)

I'm on sudden link, I've been connected with a FreeBSD box before, that's what's crazy. Never had a problem before.


----------



## Anonymous (Apr 29, 2013)

Harley said:
			
		

> I'm on sudden link, I've been connected with a BSD box before, that's what's crazy.
> Never had a problem before.



Can you connect from a PC with a different OS?


----------



## Harley (Apr 29, 2013)

Yep, *I'm* on my winblows Windows machine, same router, same connection etc*.*


----------



## wblock@ (Apr 29, 2013)

Harley said:
			
		

> `dhclient rl0`
> 
> ```
> [color="Red"]rl0 has a bad address[/color]
> ...



That's probably the problem.  But why is routed(8) running?  Have you restarted the machine?


----------



## Harley (Apr 29, 2013)

*O*k *I* rebooted and stopped rl0, then
`# dhclient rl0`

```
DHCPDISCOVER on rl0 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on rl0 to 255.255.255.255 port 67 interval 9
DHCPDISCOVER on rl0 to 255.255.255.255 port 67 interval 17
DHCPDISCOVER on rl0 to 255.255.255.255 port 67 interval 10
DHCPDISCOVER on rl0 to 255.255.255.255 port 67 interval 9
DHCPDISCOVER on rl0 to 255.255.255.255 port 67 interval 12
No DHCPOFFERS received.
No working leases in persistent database - sleeping
```


----------



## wblock@ (May 2, 2013)

Well, that's an improvement.  Your system is asking for a lease, but no DHCP server is responding.  Usually that is done by the router, although some people may get a DHCP lease from their ISP.  A firewall could be in the way, or maybe the DHCP server is configured to only respond to certain MAC addresses.


----------



## Harley (May 4, 2013)

Swapped the NIC and got it connected.


----------

