How to connect to the internet?

Hi :D

I've decided to give FreeBSD a try after using different Linux distros for almost a year. But right now I'm having a very noob problem. I'm not able to connect to the internet via ethernet. I've only been able to find out how to configure it trough sysinstall but I'd like to configure it myself.

I'm not sure but I guess I need something like a deamon that automatically connects to the internet when it detects a plugged in 8P8C cable.

Right now that is my main problem, but later on I would also like to be able to connect to the internet using my Huawei E160 3G usb modem. Is this possible in FreeBSD?

Thanks in advance.
 
in /etc/rc.conf
Code:
ifconfig_re0="inet 1.2.3.4 netmask 255.255.255.0"
defaultrouter="1.2.3.1"

replace re0 with your interface (you can find available interfaces by running ifconfig)

in /etc/resolv.conf
Code:
nameserver 1.2.3.1
nameserver 1.2.3.6

reboot

for more detailed info
ifconfig(8)
rc.conf(5)
 
killasmurf86 said:
did you replace appropriate values ;)?
If you use DHCP

Code:
ifconfig_re0="DHCP"
Doesn't work either. Although I know that I use DHCP.

Just to be sure.
Code:
ping http://google.com
is okay to use when testing if my internet connection works?

aragon said:
Hmm... that doesn't help us help you any further. More information needed... ifconfig output, routing table, traceroutes, etc.
I'm not sure what information you want..
 
paldepind said:
Just to be sure.
Code:
ping http://google.com
is okay to use when testing if my internet connection works?

No. Use [cmd=]ping google.com[/cmd], and to be sure, also try [cmd=]ping 74.125.79.147[/cmd].
 
Pinging Google without http:// didn't work..

Honestly I can't understand why this is so hard to get running. In Arch Linux it was a piece of cake..
 
In freebsd it's peace of cake as well, when you know what you do.
We don't know what you do, we don't see any logs etc, so we have to guess

are you using wired network?
show output of
Code:
# ifconfig
# dmesg
and show /var/log/messages
 
killasmurf86 said:
In freebsd it's peace of cake as well, when you know what you do.
We don't know what you do, we don't see any logs etc, so we have to guess
Well, you're probably right..

killasmurf86 said:
are you using wired network?
show output of
Code:
# ifconfig
# dmesg
and show /var/log/messages
Yop, I'm using a wired connection.

Ifconfig = http://twistedpipedream.com/dropbox/ifconfig.JPG

Dmesg: http://twistedpipedream.com/dropbox/dmesg0.JPG and http://twistedpipedream.com/dropbox/dmesg1.JPG (it's a huge output but I got the relevant)

The messages file is HUGE. But if there's anything specific I will find it to you.

Btw, I hope it's that I just took some pictures instead of writing it all down..
 
DutchDaemon said:
No. Use [cmd=]ping google.com[/cmd], and to be sure, also try [cmd=]ping 74.125.79.147[/cmd].

To clarify, Dutch is recommending that you also try pinging the IP address because you might not have things correctly setup to work with your DNS server yet. If pinging 74.125.79.147 works but pinging google.com does not, then we'll know we need to focus our attention on your DNS configuration.

If neither ping works, we need to check what driver you're using, whether the interface is up, and whether you're getting an IP from your DHCP server. That's why killasmurf asked for the output from ifconfig.

The dmesg output will give us some related info about what happened during bootup.

Another thing that will help us troubleshoot your problem would be to show us what you have in /etc/rc.conf.
 
OK, I see from your ifconfig screenshot that your wired connection is using the re driver and that interface is up. But you haven't received an IP from the DHCP server.

Do you have the following line in /etc/rc.conf? If not, add it, then reboot.

Code:
ifconfig_re0="DHCP"


Added later: I see you've already been asked this. Sorry.

Can you ping the DHCP server?

Is there anything in /etc/dhclient.conf other than comments?
 
ckester said:
OK, I see from your ifconfig screenshot that your wired connection is using the re driver and that interface is up. But you haven't received an IP from the DHCP server.
I found this in my /var/log/messages file:
Code:
re0: Ethernet adress: 00:1e:68:d2:70:59
I guess that means that I actually got an IP from the server..

When I pinged Google's IP I got this:
Code:
74.125.79.147 (74.125.79.147): 56 data bytes
but after that it just repeated printing out:
Code:
ping: sendto: No route to host

ckester said:
Do you have the following line in /etc/rc.conf? If not, add it, then reboot.

Code:
ifconfig_re0="DHCP"
Yes. My rc.conf looks like this:
Code:
keymap="danish.iso"
ifconfig_re0="HDCP"
defaultroute="1.2.3.1"
 
lol,
ifconfig_re0="[red]HD[/red]CP" << should be DHCP
defaultroute="1.2.3.1" << remove if you use DHCP (btw, 1.2.3.1 was supposed to be default route IP, not just random example number that I gave)
 
paldepind said:
I found this in my /var/log/messages file:
Code:
re0: Ethernet adress: 00:1e:68:d2:70:59
I guess that means that I actually got an IP from the server..
Not at all. That's a MAC address not an IP address, and it's stored inside the adapter not assigned from the outside.

paldepind said:
When I pinged Google's IP I got this:
Code:
74.125.79.147 (74.125.79.147): 56 data bytes
but after that it just repeated printing out:
Code:
ping: sendto: No route to host
Remove the defaultroute line. Your ISP should hopefully get you one.
When you fix the "HDCP" typo, don't forget to reboot.
 
Ethernet address is your MAC address, not your IP. When running # ifconfig, your IP will be the value next to inet.

Can I increase the quality of YouTube videos when using HDCP instead of DHCP? :p
 
set it to DHCP and reboot, see if that works, then change it to HDCP, it's first time I hear about HDCP, maybe it's some linux stuff?
 
paldepind said:
I found this in my /var/log/messages file:
Code:
re0: Ethernet adress: 00:1e:68:d2:70:59
I guess that means that I actually got an IP from the server..

Nope. That's the MAC address for your NIC, not an IP address from DHCP.

Assuming the HDCP typo killasmurf caught was a transciption error and not actually in your rc.conf, the thing you need to focus on now is your defaultroute. What's the topology of your network? If this is a home network, are you using a cable modem or firewall/router?

I type too slow! Someone already explained the MAC address. ;)
 
killasmurf86 said:
change it to HDCP, it's first time I hear about HDCP, maybe it's some linux stuff?
High-bandwidth Digital Content Protection is "quite" different from the Dynamic Host Configuration Protocol. ;)
 
killasmurf86 said:
lol,
ifconfig_re0="[red]HD[/red]CP" << should be DHCP
defaultroute="1.2.3.1" << remove if you use DHCP (btw, 1.2.3.1 was supposed to be default route IP, not just random example number that I gave)
OMFG! It was just typo.

I'm so sorry that I took your guys time just because of a stupid typo. Thanks a lot for your help anyway.. There's clearly a lot of stuff about networking that I know nothing about.

Btw, it works perfectly now :D Thanks again!
 
To learn more about networking and other configuration details with FreeBSD, I highly recommend Michael Lucas's book Absolute FreeBSD. It's gotten me out a tight spot more often than I can count. :e
 
Back
Top