[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Localhost port connection problem



Hello, all:

	On one of my machines, which I call "lear", I am running 
Apache with the Jserv module.  The Jserv module works by accepting 
requests on port 8007 on localhost.  And it works -- sometimes.  
This machine is connected via a hub to another Linux box 
(called "router") acting as a masquerading host between the local 
network and my ADSL connection.  It uses ipchains, and has a basic
masquerading setup, as follows:

/sbin/ipchains -M -S 7200 10 160
/sbin/ipchains -A input -j ACCEPT -i eth1 -s 0/0 67 -d 0/0 68 -p udp
/sbin/ipchains -P forward DENY
/sbin/ipchains -A forward -s 192.168.0.0/24 -j MASQ

	I use an ISP that requires the use of PPPoE, so I use the
Roaring Penguin PPPoE client, which takes packets from eth1 and
forwards them to a ppp0 device that it creates.  The machine
running Apache is connected to eth0 of the masquerading machine
via a hub.  This means that my connection to the Internet can
be taken down or brought up at will, just like a regular ppp
connection, except that the ppp packets are sent over an Ethernet
connection to the DSL modem.
	This is what the routing table of "router" looks like
when there is a connection up:

Destination		Gateway	Genmask		Flags	Metric	Ref	Use	Iface
64.xxx.xxx.xxx	*		255.255.255.255	UH	0	0	0	ppp0
192.168.0.0		*		255.255.255.0		U	0	0	0	eth0
192.168.0.0		*		255.255.255.0		U	0	0	0	eth1
0.0.0.0		64.xxx.xxx.xxx	0.0.0.0	UG	0	0	0	ppp0
	  		
	The 64.xxx.xxx.xxx IP addresses are dynamically assigned IP address that are
received when the connection to the Internet is made.

	When this connection is up, I can, from the Apache box, 
successfully connect to localhost port 8007, which means that 
Jserv works properly.  However, if I shut off the connection to
the Internet, making the routing table on "router" look like this:

Destination		Gateway	Genmask		Flags	Metric	Ref	Use	Iface
192.168.0.0		*		255.255.255.0		U	0	0	0	eth0
192.168.0.0		*		255.255.255.0		U	0	0	0	eth1

	Now I suddenly cannot connect to localhost port 8007 on "lear".  And
so Jserv fails.  When I reconnect to the Internet, however, I can once again
connect to port 8007.

	The routing table on "lear" looks like this:

Destination		Gateway	Genmask		Flags	Metric	Ref	Use	Iface
192.168.0.0		*		255.255.255.0		U	0	0	0	eth0
0.0.0.0		192.168.0.1	0.0.0.0		UG	0	0	0	eth0

	As you can see, the default gateway is to 192.168.0.1, 
which is the address of eth0 on "router".  To make things more 
interesting, when I delete the static default
route on "lear", I can once again connect to localhost port 8007.
	As far as I can tell, this only affects port 8007 -- I 
can connect to other well-known ports (80, 25, 23, 21) regardless 
of whether the Internet link is up or not.  Only 8007 is mysteriously 
refused -- until I restore the link or remove the
gateway entry in the routing tables.
	I would appreciate any insights into the problem.  I know I 
may not have provided enough information, so if there is anything 
else you need to know, please ask.

Gauthaman Ravindran
gauth@myna.com



Reply to: