LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 05-03-2011, 03:25 AM   #1
Sheriff Hobbes
LQ Newbie
 
Registered: Nov 2010
Location: Germany (GDR 2.0)
Distribution: RHEL 5.5 (x86_64)
Posts: 7

Rep: Reputation: 5
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
 
Old 05-03-2011, 06:19 AM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,220

Rep: Reputation: 307Reputation: 307Reputation: 307Reputation: 307
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.

Last edited by eSelix; 05-03-2011 at 06:27 AM.
 
Old 05-03-2011, 10:51 AM   #3
jefro
Guru
 
Registered: Mar 2008
Posts: 11,714

Rep: Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439
Some apps use local files to direct network while others allow use of a global proxy.
 
Old 05-03-2011, 11:44 AM   #4
Sheriff Hobbes
LQ Newbie
 
Registered: Nov 2010
Location: Germany (GDR 2.0)
Distribution: RHEL 5.5 (x86_64)
Posts: 7

Original Poster
Rep: Reputation: 5
@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).
 
Old 05-03-2011, 05:55 PM   #5
jefro
Guru
 
Registered: Mar 2008
Posts: 11,714

Rep: Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439
In firefox did you use a proxy setting in it's options?
 
Old 05-04-2011, 03:31 AM   #6
Sheriff Hobbes
LQ Newbie
 
Registered: Nov 2010
Location: Germany (GDR 2.0)
Distribution: RHEL 5.5 (x86_64)
Posts: 7

Original Poster
Rep: Reputation: 5
Quote:
Originally Posted by jefro View Post
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.
 
Old 05-04-2011, 03:49 AM   #7
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,220

Rep: Reputation: 307Reputation: 307Reputation: 307Reputation: 307
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.
 
Old 05-04-2011, 11:14 AM   #8
jefro
Guru
 
Registered: Mar 2008
Posts: 11,714

Rep: Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439
Is is possible that names are being resolved to the 10 net?
 
Old 05-05-2011, 02:13 AM   #9
Sheriff Hobbes
LQ Newbie
 
Registered: Nov 2010
Location: Germany (GDR 2.0)
Distribution: RHEL 5.5 (x86_64)
Posts: 7

Original Poster
Rep: Reputation: 5
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!
 
Old 05-06-2011, 01:47 PM   #10
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
Quote:
Originally Posted by Sheriff Hobbes View Post
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.
 
Old 05-07-2011, 07:56 AM   #11
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,220

Rep: Reputation: 307Reputation: 307Reputation: 307Reputation: 307
Code:
sudo netstat --tcp -c -n -p | grep firefox
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reuse socket fails "Address already in use" or "Connection refused" dec10 Programming 3 05-15-2010 12:14 PM
Occasionally-- "connected with self-assigned address," "deactivating device eth0" MaxIBoy Debian 4 10-04-2009 10:50 AM
Fonts in some GTK applications look "wrong" foucault Linux - General 13 06-21-2005 11:43 AM
difference between "Web server local URL" and "IPv4 address"? kpachopoulos Linux - General 2 09-17-2004 01:30 PM
"host" ok, but "ping" can't find ip address hardigunawan Linux - Networking 2 05-16-2002 05:41 PM


All times are GMT -5. The time now is 10:47 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration