Can't connect to server 127.0.0.1

Eric Soroos Manila-Newbies@userland.com
Fri, 19 Apr 2002 08:43:06 -0700


Douglas,

> I've run netstat -a as suggested in that article. See output below.
> 
> I note Frontier should be run as root if portforwarding is not set up. 
> When I attempted to install Frontier, portforwarding failed.

> [localhost:~] admin% sudo ipfw list
> Password:
> 65535 allow ip from any to any

Port forwarding is not set up. 

> tcp        0      0  *.8080                 *.*                    LISTEN

But Frontier is listening. 
 
> And quick script:
> userland.portforward(80,8080,"127.0.0.1")
> --> "Setting forwarding failed"

That's the key. You're not getting port forwarding set up properly, 
probably because of an incorrect password or the user that frontier is 
running as doesn't have sudo privledges. 

Try the following commands from the command line, as admin:

<pre>
sudo /sbin/ipfw add 100 fwd 127.0.0.1,8080 tcp from any to any 80 in
sudo /usr/sbin/sysctl -w net.inet.ip.forwarding=1
</pre>

This will port forward anything from port 80 to port 8080.
If that works and you want that configuration to be set up on boot, 
down load this: http://gems.wiredfool.com/portForward8080.tgz

From the download directory: 

<pre>
tar -xvzf portForward8080.tgz
sudo mkdir /Library/StartupItems    # only if it doesn't already exist.
sudo mv Multihoming /Library/StartupItems
</pre>

You can take a look at the file 
/Library/StartupItems/Multihoming/Multihoming to make sure that it's 
not doing anything nasty. 

eric