LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Applications use the "wrong" IP address (https://www.linuxquestions.org/questions/linux-networking-3/applications-use-the-wrong-ip-address-878499/)

Sheriff Hobbes 05-03-2011 03:25 AM

Applications use the "wrong" IP address
 
Hello,

I have a weird problem. My system has two network adapters, one with a 192.x address and one with a 10.x address. I connect to the Internet over a proxy that also has one 192.x address and one 10.x address. The name of this proxy is added to /etc/hosts with the 10.x address. Additionally, the network settings for the 10.x adapter include the proxy as gateway. The 192.x adapter has no gateway. If I ping the proxy, it is correctly resolved over the 10.x address.

All my applications are set to "directly connect to the Internet".
Some apps (the "good" ones) use the 10.x address to connect to the proxy, while some others (e.g. Firefox, the "bad" ones) use the 192.x address. The latter fail to connect to the Internet because the proxy is configured to let traffic through the 10.x adapter only.

Any ideas why some apps try the 192.x-way? I don't see any reason they should do this, see network config above.

Thanks,
Hobbes

P.S.: system is RHEL 5.5

eSelix 05-03-2011 06:19 AM

Show your "route -n" output. That the 192.x adapter has no gateway, does not mean that this interface cannot be used by applications. It only means that through this interface you can not reach other networks.

jefro 05-03-2011 10:51 AM

Some apps use local files to direct network while others allow use of a global proxy.

Sheriff Hobbes 05-03-2011 11:44 AM

@eSelix: this is my routing table:

Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 seth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 seth1
10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 seth0
0.0.0.0 10.0.0.100 0.0.0.0 UG 0 0 0 seth0

@jefro: the global proxy is also set to "direct connect" (KDE control center).

jefro 05-03-2011 05:55 PM

In firefox did you use a proxy setting in it's options?

Sheriff Hobbes 05-04-2011 03:31 AM

Quote:

Originally Posted by jefro (Post 4345576)
In firefox did you use a proxy setting in it's options?

No proxy, direct connection.
I've also set the 10.0.0.100 in Firefox as proxy, but even then there came a pop-up window from the proxy asking for credentials and the pop-up shows the address 192.168.0.100!! This is very strange. Maybe the initial connection to the proxy is correctly done with 10.x, but the proxy itself answers with 192.x?? That would also be strange because the client is added to the proxy's hosts file with the 10.x address.

eSelix 05-04-2011 03:49 AM

When you are connecting to proxy by Firefox, check with netstat which address is used or use some sniffer. Popup information from your proxy server can be misleading. You can also check it on the proxy/router if you have access to shell.

jefro 05-04-2011 11:14 AM

Is is possible that names are being resolved to the 10 net?

Sheriff Hobbes 05-05-2011 02:13 AM

With netstat I get a long list, but I can't find anything firefox-related. Is it possible to filter the output so that only FF connections will be displayed?

I found out another weird thing: When I use FF as root with the same settings - it works!

Nominal Animal 05-06-2011 01:47 PM

Quote:

Originally Posted by Sheriff Hobbes (Post 4344792)
Some apps (the "good" ones) use the 10.x address to connect to the proxy, while some others (e.g. Firefox, the "bad" ones) use the 192.x address.

What do you have in /etc/hosts for those addresses? The order is also important.

An application can either let the kernel bind the socket to all local addresses (INADDR_ANY), or the application can use gethostbyname() or getnameinfo() to find out the IP addresses of the workstation, and bind the socket explicitly.

I suspect you have the 192.x.y.z address named first in /etc/hosts, so applications that bind to a specific IP address get that address (instead of the 10.a.b.c address) when they look for the address of the host. Making sure the 10.a.b.c address is named first should solve your problem.

eSelix 05-07-2011 07:56 AM

Code:

sudo netstat --tcp -c -n -p | grep firefox


All times are GMT -5. The time now is 02:59 PM.