setting up network card

Hello,

I have a freebsd sys installed in a HP desktop machine ... but the thing is it refuse to connect to internet.
I configured it statically by
ifconfig re0 inet 172.24.0.15 netmask 255.255.255.0

I have also set defaultrouter in /etc/rc.conf and did it on time with
route add default 172.24.0.1

and finally I also set the nameserver in /etc/resolv.conf
nameserver 172.24.0.1


the thing is still it has not internet ...
I tried to use dhcp by ifconfig re0 dhcp but it says ifconfig :dhcp :bad value
and when i run ifconfig it shows:
6374


please help
 
Sit in front of your FreeBSD machine and repeat all steps from above to verify if it's has ping to the gateway and if it can resolve addresses using host or drill
 
You don't provide any info, don't work doesn't help...

can you ping the gateway?
can you ping 8.8.8.8?
what is the output of the ifconfig re0 ?
what is the output of netstat -rn ?
what is the output of the drill google.com ?
what is the output resolvconf -v ?
what is the output of traceroute -n 8.8.8.8 ?
 
Your configuration is looking good. Your resolver is working and you resolve google.com if you don't have ping to it you need to check your firewall on your router.
 
I use this checklist when debugging a network issue:
Code:
Network problems?
(1) Does the interface have an IP address?
(2) Is IP forwarding enabled on the router?
(3) Check your firewall/NAT settings: router's and jail's.
    All deny rules should log!
    Firewall logs land in /var/log/security.
(4) Are routes configured properly?
    List routes on jail and router.
    Test routes: netstat -rn; traceroute; etc.
(5) Are DNS settings correct?
    What is in /etc/resolv.conf?
    Is the DNS server reachable (routes, etc.)
    Does the firewall allow packets to DNS on port 53?

Tools
* tcpdump
* ipfw: list, table all list, nat show 1 config
* nc / telnet
* netstat -rn
* traceroute
* dig, drill, nslookup
First make sure you have set the IP addresses and masks properly - in your case I believe you have.
Check if all machines on the network have the same mask (24 bits).

Then make sure your router has IP forwarding enabled and does NAT properly. It's firewall should pass the packets.
Validate IP works without involving DNS (just use -n switches).
Try this from the router and then from the box: traceroute -n 8.8.8.8 - it should pass correctly on all levels. Also: ping -n 8.8.8.8
If this does not work - again, IP forwarding on router, firewalls on router and box.
Don't forget to check the routing. Do on router and box: netstat -4nr . The box must have your router as default gateway. The router must also have a default gateway.

When ping works, try with DNS. if DNS does not work, check your nameserver setting in /etc/resolv.conf.
 
what's the contents of /etc/resolv.conf

It's all shown in the above messages ... everything is correct but it just refuse to connect ... want to know why ... ??
It is a physical desktop ... i don't use jail ...
I tryed to do same with a freeBSD virtualbox guest on my windows pC ... first I set the network mode into bridged networking then I started the VM .... once again all configs are good but have no ping to outside [internet] ...
 
Maybe try a different cable... Sometimes if your cable is loose or has been slightly moved it has become disconnected.
 
hey ... thanks for the advice ... but it tunred out some other computers took too many bandwith ... the time they were shutdown , ping worked perfectly ...
 
Make sure you have firewall logging on:
sysrc firewall_logging="YES"

And also - all deny rules need to have log keyword.

Then the denied packets will be logged in /var/log/security. Show us the log and your IPFW rules and we could take a look. Otherwise it's just speculation.
 
Make sure you have firewall logging on:
sysrc firewall_logging="YES"

And also - all deny rules need to have log keyword.

Then the denied packets will be logged in /var/log/security. Show us the log and your IPFW rules and we could take a look. Otherwise it's just speculation.
Now I have ping ...
I use firewall quiet all the long so no log message were kept ... sorry ...
 
How will you know if somebody is trying to attack you? Firewall logging is quite essential for security and network debugging.
 
Back
Top