setting up network card

rtsiresy

Member

Reaction score: 1
Messages: 62

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
 

VladiBG

Aspiring Daemon

Reaction score: 224
Messages: 578

do you have ping to your gateway at 172.24.0.1
If you want to use DHCP the command is dhclient re0
 

VladiBG

Aspiring Daemon

Reaction score: 224
Messages: 578

is your DNS at 172.24.0.1 working? Can you try
drill google.com
ping google.com
 

VladiBG

Aspiring Daemon

Reaction score: 224
Messages: 578

then you have Internet connection. What is not working for you?
 

VladiBG

Aspiring Daemon

Reaction score: 224
Messages: 578

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
 

VladiBG

Aspiring Daemon

Reaction score: 224
Messages: 578

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 ?
 
OP
OP
R

rtsiresy

Member

Reaction score: 1
Messages: 62

I also have pfsense firewall which have freeradius on it with a mac filter ...
6380
 

VladiBG

Aspiring Daemon

Reaction score: 224
Messages: 578

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.
 

roccobaroccoSC

Well-Known Member

Reaction score: 84
Messages: 381

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.
 
OP
OP
R

rtsiresy

Member

Reaction score: 1
Messages: 62

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] ...
 
OP
OP
R

rtsiresy

Member

Reaction score: 1
Messages: 62

I have ipfw enabled on the freebsd system ... with:
myservices = 22,80,443
allowed service = any
 

balanga

Son of Beastie

Reaction score: 109
Messages: 2,671

Maybe try a different cable... Sometimes if your cable is loose or has been slightly moved it has become disconnected.
 
OP
OP
R

rtsiresy

Member

Reaction score: 1
Messages: 62

hey ... thanks for the advice ... but it tunred out some other computers took too many bandwith ... the time they were shutdown , ping worked perfectly ...
 

roccobaroccoSC

Well-Known Member

Reaction score: 84
Messages: 381

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.
 
OP
OP
R

rtsiresy

Member

Reaction score: 1
Messages: 62

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 ...
 

roccobaroccoSC

Well-Known Member

Reaction score: 84
Messages: 381

How will you know if somebody is trying to attack you? Firewall logging is quite essential for security and network debugging.
 
Top