Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a wireless internet connection setup on my Mac. (v10.5.6) Am connected to the internet and everything is running smoothly. I recently discovered a quirky behaviour while setting up apache web server. When i typed in my dynamic ip ( in the webbrowser to visit my site pages it just timed out. In terminal i tried pinging localhost and it worked.

$ ping localhost

PING localhost ( 56 data bytes

64 bytes from icmp_seq=0 ttl=64 time=0.063 ms

64 bytes from icmp_seq=1 ttl=64 time=0.056 ms

64 bytes from icmp_seq=2 ttl=64 time=0.044 ms

But if i pinged my ip it would just time out.

$ ping

PING ( 56 data bytes


--- ping statistics ---

10 packets transmitted, 0 packets received, 100% packet loss

Pinging any other site works though.

I am completely stumped. Any help would be greatly appreciated.

share|improve this question
Is address listed in ifconfig -a? If it is not, then it is probably the external IP of the router and you have to configure on your router a port forwarding rule for port TCP/80 and may be also for TCP/443 and redirect them to the IP configured on the enternet interface of your MAC. –  Mircea Vutcovici Mar 15 '10 at 14:53
it does list when i do ifconfig -a. This is what i get: > ppp0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500 inet --> netmask 0xff000000 Still i am not able to ping –  user35526 Mar 15 '10 at 15:48

4 Answers 4

up vote 0 down vote accepted
  1. Make sure that Apache is listening on your WLAN card's IP address: LISTEN ... (where ... is the address from Network Preferences -> AirPort -> Advanced... -> TCP/IP -> IPv4 Address). You can configure this in Apache's config files - their location in the file system depends on your Apache installation (search for httpd.conf, the config files should be in that directory and its subdirectories).

  2. Is the dynamic ip of your router or the dynamic ip of your Mac? If it's the one from your router, you'll have to configure NAT to forward to your Mac.

share|improve this answer
Unfortunately i don't use a WLAN card. Mine is a USB dongle based hispeed wireless connection. I made no ip configurations at all but instead installed few kexts to get it working. I checked if my port 80 is open and it is. Can you please tell me how i can configure NAT to forward to my Mac? –  user35526 Mar 15 '10 at 15:43
First you should somehow find out the IP of your USB WLAN stick. I'd personally use ifconfig on the terminal. It should usually have an IP starting with either 10. or starting with 192.168. Then try to connect to that instead of Only when that works, you should continue to configure NAT. –  Chris Lercher Mar 15 '10 at 15:59
This is what i get with ifconfig: ppp0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500 inet --> netmask 0xff000000. ................................................................ Even doesn't ping. Its so weird. –  user35526 Mar 15 '10 at 16:04
Ah, so it's not an USB WLAN stick either, but rather something like an UMTS or GPRS stick? (Probably that's what you meant in your previous comment - hispeed wireless connection can mean several things :-) Unfortunately, I have no experience with those, and I don't know enough about PPP - but in that case, you sure won't have to do NAT on your router - since there probably is no such router on your home network then :-) –  Chris Lercher Mar 15 '10 at 17:28
Yes you got me right! its an EVDO setup. Dint know if everyone was familiar with the term so was more generic. As theres no way i can think of to port forward or configure a static ip. But one thing though.. i had windows running on the same machine before and everything was running smoothly. With the same damn setup! :( Had to migrate to Mac cos i m into Rails and most gem support is on Mac and not on Windows. I love Mac but not having a public web server running makes me feel completely paralyzed! –  user35526 Mar 15 '10 at 17:39

Make sure the OSX firewall is disabled

share|improve this answer
I am a newbie to mac. How do i disable the firewall? if it is as the one found in "System Preferences" i have done that already. –  user35526 Mar 15 '10 at 13:41
The default firewall rules include Block LocalNetworks to/from 172.0.0.x. You're trying to ping from –  Chris S Mar 15 '10 at 14:36

Silly question, but where are you getting the IP address from? The network control panel? You double and triple checked it's not a typo?

That address doesn't look like a typical internal address. Check the Mac's network settings to double check what the interface's IP address is. If that's an external address you'll need to have port forwarding enabled for it to work.

share|improve this answer
Saw I had a downvote earlier (and no comment why) but wondered if this is an external router address, he needs his port forwarding enabled. His preference panel should give him his IP address within his network, and if he can connect to that (192.168.x.x) then the problem lays with his router, most likely. –  Bart Silverstrim Mar 15 '10 at 14:31

You run into one of the most popular network issues called 'packet loop'. There is few options for You:

  • Set up routing tables on your gateway (requires skills)
  • Add couple of entries in /etc/hosts for Linux or c:\windows\system32\drivers\etc\hosts for Windows or /private/etc/hosts for OSX for every workstation that will connect to your server using domain name: xxx.com www.xxx.com

    , where is local address of your server (replace if service running on local machine). This way your workstation will translate domain name into the local address (and not query the DNS and get external one).

share|improve this answer
How to edit the hosts file in Mac OS X – Leopard : decoding.wordpress.com/2009/04/06/… –  Andrejs Cainikovs Mar 15 '10 at 13:54
This is what /etc/hosts reads in my mac system: > ## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## localhost broadcasthost ::1 localhost fe80::1%lo0 localhost By the way i don't have a static ip. Only dynamic ip. –  user35526 Mar 15 '10 at 13:55
Just add the new line www.whatever.com and try to ping it. –  Andrejs Cainikovs Mar 15 '10 at 13:57
OK. Can i map my dynamic ip to a DDNS hostname? But i have to change it manually everytime i suppose. –  user35526 Mar 15 '10 at 13:57
Ok thanks. Will try that. –  user35526 Mar 15 '10 at 13:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.