LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 11-26-2007, 01:02 PM   #1
iAlta
Member
 
Registered: Oct 2005
Distribution: Ubuntu 7.10, OpenSUSE 10.3, Linux Mint, Arch
Posts: 92

Rep: Reputation: 15
How do I set a system wide proxy setting?


I need to set a system wide proxy setting, on my openSUSE 10.3 laptop.

Internet in my school is behind a proxy server.
Currently only Firefox's "Auto-detect proxy setting for this network" works. Which is great as Firefox is the mostly used web-required application I use, but fx. Pidgin, Lifera and Yast don't work.

I need to set a system-wide proxy setting, and be able to turn in of quickly, as I don't have a proxy at home.
 
Old 11-27-2007, 06:00 AM   #2
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Pure System wide mechanism is through the environment variable http_proxy.
(Gnome is also using gconf but will not talk about Window Manager specific)

This has to be set for all shells and all applications.
One way is to do the proxy detection when you initially login and then export the value to sub-shells (non login shells, normally what you get in a window manager)

Do It Yourself method:

If your interfaces go up during boot (before your login shell is started), then you can set this variable based on your ip adress:
Example, when you are at work (you have ip 1.2.3.4), connections through eth1 should go through a proxy.

In /etc/profile:

Code:
 cur_ip=`/sbin/ifconfig eth1 | sed -e '/inet\ adr/!d;s/.*inet adr:\([0-9\.]*\).*/\1/'`
if [ "$cur_ip" == "1.2.3.4" ]; then
        export http_proxy="http://1.2.3.251:3128"
fi
 
Old 11-27-2007, 11:46 AM   #3
iAlta
Member
 
Registered: Oct 2005
Distribution: Ubuntu 7.10, OpenSUSE 10.3, Linux Mint, Arch
Posts: 92

Original Poster
Rep: Reputation: 15
Wooow!
That's pretty cool, thanks, I don't quite get it, but thanks!!

The network connection goes through wlan0, and it's a ndiswrapper driver, which isn't really properly installed, I have to modprobe it after every boot.

Anyways, that piece of code, should I append it to the /etc/profile? And what if I use DHCP(which I am), will it still work?
 
Old 11-28-2007, 05:58 AM   #4
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Quote:
Originally Posted by iAlta View Post
Wooow!
That's pretty cool, thanks, I don't quite get it, but thanks!!
LOL you're welcome.
Quote:
The network connection goes through wlan0, and it's a ndiswrapper driver, which isn't really properly installed, I have to modprobe it after every boot.

Anyways, that piece of code, should I append it to the /etc/profile? And what if I use DHCP(which I am), will it still work?
This piece of code can be appended at the end of /etc/profile yes.
It will look what is your current ip and decide accordingly.

But if at this moment the connection has no ip, it can not check..
So you need to do the modprobe before login into your WM.
Then use your current tool to autoconfigure the network (Or are you starting dhcp manually or static ip?) which will give you an ip. If it's graphic tool, you have a problem here...
And then start your wm which will read /etc/profile, the export command and give it to all applications opened in the wm.

And then the services that you want to use (pidgin,..), you have to check if they really works through http... For example bittorent doesn't go through a proxy, pidgin and stuff no idea.

Last edited by nx5000; 11-28-2007 at 06:00 AM.
 
  


Reply



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
Set System Wide Proxy Address TomGibbons Linux - Security 9 08-24-2006 12:48 AM
how do I set a system wide enviroment variable? (not just bash) drkstr Linux - Newbie 11 04-19-2006 09:09 AM
"perl: warning: Setting locale failed." System wide problem Darek84CJ Debian 3 01-25-2006 05:22 PM
system wide setting of .emacs/.vimrc monkeyking Slackware 4 03-18-2005 05:30 AM
Setting ISO8859-15 as the system-wide default ; how? Megamieuwsel Linux - General 1 08-25-2004 02:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 08:53 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration