**This is an old revision of the document!**
Einrichtung ====== ===== Netwerk
Der kürzeste und schnellste Weg, Netzwerkeinstellungen vorzunehmen, ist wie immer über die Konsole.
Die Datei /etc/profile bzw. /etc/environment (Lubuntu)enthält systemweite Variablen (Systemvariablen), die beim booten initialisiert werden. Diese Datei wird modifiziert.
==== Proxy ==== Füge die folgenden Zeilen hinzu. Und ja: Die Variablen müssen doppelt geschrieben werden, da einige Programme nach den Variablennamen in Großbuchstaben, andere jedoch in Kleinbuchstaben suchen.
http_proxy=http://myproxy.server.com:8080/ https_proxy=http://myproxy.server.com:8080/ ftp_proxy=http://myproxy.server.com:8080/ no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com" HTTP_PROXY=http://myproxy.server.com:8080/ HTTPS_PROXY=http://myproxy.server.com:8080/ FTP_PROXY=http://myproxy.server.com:8080/ NO_PROXY="localhost,127.0.0.1,localaddress,.localdomain.com"
==== apt ==== Leider lesen diese Programme die Umgebungsvariablen auch nicht aus, so dass wir diese auf eine andere Weise bekannt machen müssen.
In /etc/apt/apt.conf.d/ erstelle die Datei 95proxies oder proxy.conf (ausprobieren) und schreibe folgende Zeilen: Acquire::http::proxy “http://myproxy.server.com:8080/”; Acquire::ftp::proxy “ftp://myproxy.server.com:8080/”; Acquire::https::proxy “https://myproxy.server.com:8080/”;
Achte hierbei genau auf die doppelten Doppelpunkte und Semikolon am Ende jeder Zeile.
=== Script zum Ein- und Ausschalten der Proxies === !!! Nur für Fortgeschrittene !!! Codeschnipsel
download
#!/usr/bin/env bash
====== gsettings list-recursively org.gnome.system.proxy ======
====== Change de ip address and port number accordingly. ======
function myProxyOn() { gsettings set org.gnome.system.proxy mode 'manual' # ' manual / nome / automatic ' gsettings set org.gnome.system.proxy.http host '10.0.0.1' gsettings set org.gnome.system.proxy.http port 8080 gsettings set org.gnome.system.proxy.https host '10.0.0.1' gsettings set org.gnome.system.proxy.https port 8080 gsettings set org.gnome.system.proxy.ftp host '10.0.0.1' gsettings set org.gnome.system.proxy.ftp port 8080
echo "Configuração do 'System Proxy' settada para 'manual', com host 10.0.0.1, port 8080."
}
function myProxyOff() { gsettings set org.gnome.system.proxy mode 'none' # ' manual / nome / automatic ' echo "Proxy cofigurado para 'none'." }
function proxyOn() { # {{{ #echo -n 'Username: ' #read -e username #echo -n 'Password: ' #read -es password #echo '' echo 'Setting variable "http_proxy"...' #export http_proxy="http://$username:$password@172.17.0.1:8080/" export http_proxy="http://10.0.0.1:8080/" echo 'Setting variable "https_proxy..."' export https_proxy="https://10.0.0.1:8080/" echo 'Setting variable "ftp_proxy"...' #export ftp_proxy="http://$username:$password@172.17.0.1:8080/" export ftp_proxy="ftp://10.0.0.1:8080/" echo 'Done!' }
function proxyOff() { unset HTTP_PROXY unset http_proxy unset FTP_proxy unset ftp_proxy echo -e "\nProxy environment variables removed!" }