Cannot connect the net. FreeBSD 9.1

I have been working on a web server some days and I am really tired that always have this error, after restart, the server doesn't connect to the net.

I have modified /etc/rc.conf, /etc/hosts, /etc/resolv.conf but I couldn't solve my problem. Notably, I'm working on a Realtek 8111E, but I have already added the line
Code:
if_re_load="YES"
to /boot/loader.conf.

Can someone help me?. :(

Mistakes:
Code:
Ping 192.168.1.1 (gateway): No route to host.

The first time after install, the net runs perfectly.
 
Unfortunately, you do not show the contents of any of the files mentioned. The error suggests that there is no defaultrouter entry in /etc/rc.conf, or maybe an incorrect one.
 
I'm sorry,

/etc/rc.conf
Code:
hostname="server"
ifconfig_re0="inet 192.168.1.2 netmask 255.255.255.0"
defaultrouter="192.168.1.1"
sshd_enable="YES"
apache22_enable="YES"

/etc/hosts
Code:
::1 localhost localhost.my.com
127.0.0.1 localhost localhost.my.com
192.168.1.2 server server.my.com
192.168.1.1 gateway gateway.my.com

/etc/resolv.conf
Code:
domain my.com
nameserver 192.168.1.1
 
AFAIK resolv.conf needs an actual nameserver (not a local lan address), (but I've not enough experience with webservers to qualify that as the best answer...)
 
Code:
root@server:/root# route show default
route to: default
designation: default
mask: default
gateway: gateway
interface: re0
flags: <UP,GATEWAY,DONE,STATIC>
rcvpipe sendpipe ssthresh rtt,msec mtu weight expire
 
jb_fvwm2 said:
AFAIK resolv.conf needs an actual nameserver (not a local lan address), (but I've not enough experience with webservers to qualify that as the best answer...)

It's set to the router, which typically is a nameserver also.
 
wblock@ said:
It's set to the router, which typically is a nameserver also.

Yes, that gateway runs as a packet filter, router and DHCP server. And other PC's can navigate perfectly.
 
You did add a default gateway right?

route add default <ip address of gateway>
 
Maicol said:
Code:
root@server:/root# route show default
route to: default
designation: default
mask: default
gateway: gateway
interface: re0
flags: <UP,GATEWAY,DONE,STATIC>
rcvpipe sendpipe ssthresh rtt,msec mtu weight expire

There should be one more line at the end, showing the MTU. I can't think of the next thing to check right now, but surely someone else will.
 
The default route should be set by the entry in /etc/rc.conf. Wait, I did think of something else: to check DNS, please show the output of these commands:
ping gateway
ping 192.168.1.1
 
Code:
root@server:/ # route add default 192.168.1.1
route: writing to routing socket: File exists
add net default: gateway 192.168.1.1: route already in table

Code:
root@server:/ # ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
ping: sendto: Host is down
 
Code:
root@server:/root# route show default
route to: default
designation: default
mask: default
gateway: gateway
interface: re0
flags: <UP,GATEWAY,DONE,STATIC>
rcvpipe sendpipe ssthresh rtt,msec  mtu    weight  expire
   0         0       0         0     1500     1      0
 
@Maicol, please stop making me edit every one of these posts.

Please do that ping again, after a reboot, without manually setting the default router.

Can your other systems ping the router?
 
Last edited by a moderator:
Yes, my other systems ping the router, no problems.

The server startup without problems, but I can't ping the router.
At startup, the server says:
Code:
re0: watchdog timeout
 
Maicol said:
Yes, my other systems ping the router, no problems.

The server startup without problems, but I can't ping the router.

Right, but what is the error message? So far there have been two, pointing at different problems.

At startup, the server says:
Code:
re0: watchdog timeout

Hmm. I don't think mine do that, but it may not be a problem.
 
wblock@ said:
Right, but what is the error message? So far there have been two, pointing at different problems.

This is my problem, after restart:
Code:
root@server:/ # ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
ping: sendto: Host is down

I can't send or receive packets. The server says that all computers on my net are off. The other computers neither can connect the server.
 
Too many variables, and they are multiplying. First, ping(8) can be problematic because Windows systems are terrified of ICMP packets. Some routers might also not transfer ICMP. Then there is DNS.

So... can you use some real network protocol to connect to somewhere out on the net? Can you download and install ports or packages?

For the local network, can the other machines see your server web page if you just use the IP address?
 
wblock@ said:
Too many variables, and they are multiplying. First, ping(8) can be problematic because Windows systems are terrified of ICMP packets. Some routers might also not transfer ICMP. Then there is DNS.

Net Schema:
942987_382141745238494_1408926385_n.jpg


So... can you use some real network protocol to connect to somewhere out on the net? Can you download and install ports or packages?

From the server? I can't. Only before the first restart I could install ports.

For the local network, can the other machines see your server web page if you just use the IP address?

No, only before the first restart. I think that I have some hardware problem, only after the first restart begin my problems, before I can install ports and ping without problems...
 
As @wblock@ says, this question is quickly getting out of control.

You say you can ping the router, 192.168.1.1, from other computers on the same network, but you are getting 'Host is down' on the FreeBSD box.

I'm pretty sure the re device is part of the GENERIC kernel so you don't need to load it in /boot/loader.conf but that shouldn't really cause a problem. I've seen watchdog timeouts on lots of machines and never had any obvious networking problems so I don't think that is the issue.

Can you reboot the server, then without loading or changing anything else, show the output of the following:

Code:
# ifconfig re0
# netstat -rn
# ping 192.168.1.1

The Host is down message kind of suggests you have more basic networking problems, like a dodgy network cable or a switch that's gone awry.
 
Last edited by a moderator:
Maicol said:
At startup, the server says:
Code:
re0: watchdog timeout
For some reason I get these too on one of my machines. re(4) keeps generating watchdog errors and dropping off the network.

This seems to work for me (I have a gigabit network, adjust where needed):
# ifconfig re0 media 1000baseT mediaopt full-duplex mtu 1500

That will fix it on 1000baseT (gigabit) and full-duplex.
 
It works!

SirDice said:
For some reason I get these too on one of my machines. re(4) keeps generating watchdog errors and dropping off the network.

This seems to work for me (I have a gigabit network, adjust where needed):
# ifconfig re0 media 1000baseT mediaopt full-duplex mtu 1500

That will fix it on 1000baseT (gigabit) and full-duplex.

Thanks for the replies, I'm grateful. :)
 
Back
Top