# Can't connect to network via wired connection



## Tatskaari (Nov 7, 2012)

I have been trying for some time now to connect to the internet via a Ethernet cable at my university.
When I first installed I uses sysinstall(8) and configured my adapter through there. ifconfig(8) reports the rl0 is active and up. I could connect to the internet. Downloaded sudo and lynx. I then restarted and now I cannot connect to the internet. I seem to be able to get my configuration through DHCP in sysinstall->network->configure adaptor which means I have some connectivity but I can't ping local servers on my universities network. 

/etc/rc.conf contains two lines of code:

```
ifconfig_rl0="DHCP"
hostname="jfp6"
```
I have uninstalled and reinstalled FreeBSD once and managed to get the internet working in till I rebooted by typing *dhclient rl0*. After reboot I had the same problem.

Any ideas?

Thanks,
Tatskaari


----------



## Tatskaari (Nov 7, 2012)

If you do post a reply, I would be very interested in your thought process and what is going on. The main reason I installed FreeBSD and didn't just stick with linux was to learn. So if you could help in that process I would appreciate it. I will still be very grateful for sorting the problem out though.


----------



## wblock@ (Nov 7, 2012)

First, change the entry in /etc/rc.conf:

```
ifconfig_rl0="SYNCDHCP"
```

This runs dhclient(8) synchronously, waiting for it to finish before continuing with startup.


----------



## Tatskaari (Nov 7, 2012)

Well, that hung for a while but I missed what it said. I still don't have a connection however running *dhclient rl0* results in the error 

```
"no DHCPOFFERS recieved.
trying recorded lease 129.12.155.235
bound renewal in 14408"
```


----------



## Tatskaari (Nov 7, 2012)

I'm pretty sure that my name server is correct if that helps. I checked with my professor.


----------



## wblock@ (Nov 7, 2012)

If a DHCP server isn't offering leases, then things aren't going to work.  And why it would have given you a public IP address in the first place is a question.

If that IP address is correct, you could set it up statically.  Also need to set nameservers in /etc/resolv.conf (note the spelling) and default gateway with defaultrouter="n.n.n.n" in /etc/rc.conf.


----------



## SirDice (Nov 7, 2012)

Tatskaari said:
			
		

> I checked with my professor.


Also ask him if using DHCP is correct and what IP addresses you should expect to get.


----------



## mamalos (Nov 7, 2012)

If you end up using a static IP address, then replace your interface's /etc/rc.conf entry to:


```
ifconfig_rl0="x.x.x.x"
```


Where x.x.x.x is the IP address that you have been assigned. Of course, you'll need to configure /etc/resolv.conf and your default gateway, as wblock already suggested.


----------



## Tatskaari (Nov 7, 2012)

I took my laptop to the computer room and plugged it into an Ethernet port there. It works there fine. I think that they have some weird security in the bedrooms that is stopping me being able to connect. Would my network allow me to have a static IP? I don't really understand it but a static IP would mean but it seams like it would be inconvenient for the network.


----------



## mamalos (Nov 7, 2012)

Despite the OS or device you running, in order to connect to the Internet you need an IP address. This can be either assigned to you automatically (via DHCP) or statically (by manually setting it yourself). 

If Internet access is provided in your bedroom, then there are two possible reasons for not being able to connect:


DHCP server is down
You have to configure your IP manually

*If your bedroom offers Internet connection*, ask the relevant personnel as to how you should connect to it. If they tell you that your IP should be assigned automatically, then tell them that you're unable to access their DHCP server from your laptop when inside your room. Otherwise, follow the guidelines provided in this thread in order to setup the static configuration they'll give you.


----------



## Tatskaari (Nov 7, 2012)

I should point out that I have had the same machine connect up on linux mint and have had another machine connect up on windows through the same plug. I went to the IT help desk and they just said keep trying things and it might work. Thanks for the help though.


----------



## wblock@ (Nov 7, 2012)

You have had FreeBSD connect through the same plug, also.  It's worth trying a different cable between the jack and the computer.


----------



## Tatskaari (Nov 8, 2012)

I have, same problem. Perhaps I should ask one of my house mates if I can test it in there socket. 
I am not at uni at the moment so I'm trying and set up wireless. I followed the handbook and I have come across a problem. sudo ifconfig wlan0 up scan returns no results. I also tried ifconfig wlan0 list scan as that worked or someone else. The results of ifconfig wlan0 ath0 is:

```
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
	ether 00:c0:a8:f6:aa:0b
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
	status: associated
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether 00:c0:a8:f6:aa:0b
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
	status: no carrier
	ssid "" channel 8 (2447 MHz 11g)
	regdomain ETSI indoor ecm authmode OPEN privacy OFF txpower 20
	bmiss 7 scanvalid 60 bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7
	roam:rate 5 protmode CTS wme burst bintval 0
```


----------



## Tatskaari (Nov 8, 2012)

I have not had freeBSD connect through the same plug just to clarify.


----------



## wblock@ (Nov 8, 2012)

What did you mean in your first post by


> When I first installed I uses sysinstall(8) and configured my adapter through there. ifconfig(8) reports the rl0 is active and up. I could connect to the internet.



Was that a different location?


----------



## Tatskaari (Nov 8, 2012)

I typed sysinstall, went to config, went to networking. I then selected set up adapter and told it to use dhcp. I then checked in resolv.conf and it had detected 2 name servers. The Internet worked until I restarted.


----------



## wblock@ (Nov 9, 2012)

That was a working connection.  Have you edited any other configuration files?


----------



## Tatskaari (Nov 9, 2012)

I kept a log starting from after installing. In the installer I asked it to configure rl0.

ifconfig list rl0 as up and active. Ethernet cable plugged in.
Typed dhclient. Seamed to work.
pkg_add -r sudo worked. Sudo installed. Internet working.
typed visudo and added jon ALL=(ALL) ALL
User jon is not a sudoer.
Installed lynx the same way. 
rebooted.
ifconfig lists rl0 as up and active. 
dhclient says: 
no DHCPOFFERS recieved. 
Trying recorded lease 129.12.155.235.
bound renewal in 14408.


----------



## wblock@ (Nov 9, 2012)

sudo is not a panacea.

Why are you manually running dhclient?  It should be started by rc.conf.


----------



## Tatskaari (Nov 9, 2012)

I use sudo because it is what I am used to from linux and seams to be like a useful tool. Do you recommend getting rid? It does seam to be implemented in a very hacky way on freeBSD. 

I ran dhclient so I could see a log of how it was connecting to the DHCP server. I missed it in startup. That series of events is exactly what happened after installation not what I usually do.


----------



## wblock@ (Nov 9, 2012)

These fragmentary details aren't really getting us anywhere.

With /etc/rc.conf containing only these lines, reboot:

```
ifconfig_rl0="SYNCDHCP"
hostname="jfp6"
```

Log in as your user (jon).  Then show the output of
`% ifconfig rl0`
and
`% ping -c4 8.8.8.8`


----------



## Tatskaari (Nov 13, 2012)

Just got back to uni and all seams to work now. Not sure what I/they did but it works fine. Thanks for the help. Now I just need to get my wireless working.


----------

