Kasam saugų tunelį iki proxy serverio


Turiu tokią situaciją: interneto tiekėjas duoda mažą greitį Lietuvoje ir dvigubai mažesnį greitį užsienyje. Tačiau turiu serverį kuris turi 100mbps į visur. Taigi serveryje įdiegiame squid

sudo apt-get install squid

SSH konfiguracijoje (debian 5.0: /etc/ssh/sshd_config) nurodome tokius parametrus:

PermitTunnel yes
AllowTcpForwarding yes
GatewayPorts yes


Įvedame vieną komandą į kosolę savo kompiuteryje (SSH susijungimams naudoju SSH-AGENT raktus, tad mano pavyzdys nenaudoja slaptažodžių):

sudo ssh -C -L 8080:localhost:3128 remote_user@remote_server_host.lt

Narsyklės nustatymuose nurodome, kad naudotų proxy serverį kuris yra 127.0.0.1:8080 (ubuntu 10.10 chrome netgi pasiūlo nustatyti proxy serverį „system-wide“). Galiausia džiaugemės galėdami išvystyti didesnį greitį nei maksimalus galimas, tai įvyksta dėl to, kad tuneliui nurodome naudoti kompresiją su parametru -C. http://speedtest.net/ kartais parodo iš ties neįtikėtinus rezultatus, tai yra squid nuopelnas, bet kita vertus – toks ir buvo tikslas.

Greitis Lietuvoje


Greitis užsienyje


Greitis Lietuvoje per SSH tunelį


Greitis užsienyje per SSH tunelį

Smagaus naudojimo!

Žygimantas

Lead developer at Soundest. Zend Certified Engineer.

More Posts - Website

Žymos: , ,

1 komentaras

  1. Prie to paties. Kaip instaliuoti squid su Centos 4.*


    # yum install squid


    Setting up Install Process
    Setting up repositories
    epel 100% |=========================| 3.7 kB 00:00
    update 100% |=========================| 951 B 00:00
    base 100% |=========================| 1.1 kB 00:00
    addons 100% |=========================| 951 B 00:00
    extras 100% |=========================| 1.1 kB 00:00
    Reading repository metadata in from local files
    81d26ada35b74de74ebc6e715 100% |=========================| 1.7 MB 00:01
    epel : ################################################## 5169/5169
    primary.xml.gz 100% |=========================| 643 kB 00:00
    sqlite cache needs updating, reading in metadata
    update : ################################################## 1498/1498
    Excluding Packages in global exclude list
    Finished
    Parsing package install arguments
    Resolving Dependencies
    --> Populating transaction set with selected packages. Please wait.
    ---> Downloading header for squid to pack into transaction set.
    squid-2.5.STABLE14-4.el4. 100% |=========================| 134 kB 00:00
    ---> Package squid.i386 7:2.5.STABLE14-4.el4 set to be updated
    --> Running transaction check
    --> Processing Dependency: logrotate for package: squid
    --> Processing Dependency: perl(URI::URL) for package: squid
    --> Restarting Dependency Resolution with new changes.
    --> Populating transaction set with selected packages. Please wait.
    ---> Package perl-URI.noarch 0:1.30-4 set to be updated
    ---> Downloading header for logrotate to pack into transaction set.
    logrotate-3.7.1-11.RHEL4. 100% |=========================| 8.2 kB 00:00
    ---> Package logrotate.i386 0:3.7.1-11.RHEL4 set to be updated
    --> Running transaction check

    Dependencies Resolved

    =============================================================================
    Package Arch Version Repository Size
    =============================================================================
    Installing:
    squid i386 7:2.5.STABLE14-4.el4 base 1.1 M
    Installing for dependencies:
    logrotate i386 3.7.1-11.RHEL4 update 36 k
    perl-URI noarch 1.30-4 base 79 k

    Transaction Summary
    =============================================================================
    Install 3 Package(s)
    Update 0 Package(s)
    Remove 0 Package(s)
    Total download size: 1.2 M
    Is this ok [y/N]: y
    Downloading Packages:
    (1/3): perl-URI-1.30-4.no 100% |=========================| 79 kB 00:00
    (2/3): logrotate-3.7.1-11 100% |=========================| 36 kB 00:00
    (3/3): squid-2.5.STABLE14 100% |=========================| 1.1 MB 00:00
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
    Installing: logrotate ######################### [1/3]
    Installing: perl-URI ######################### [2/3]
    Installing: squid ######################### [3/3]

    Installed: squid.i386 7:2.5.STABLE14-4.el4
    Dependency Installed: logrotate.i386 0:3.7.1-11.RHEL4 perl-URI.noarch 0:1.30-4
    Complete!


    # nano /etc/squid/squid.conf


    acl our_networks src 192.168.1.0/24 192.168.2.0/24
    http_access allow our_networks


    # chkconfig squid on
    # /etc/init.d/squid start


    init_cache_dir /var/spool/squid... Starting squid: . [ OK ]


    # netstat -tulpn | grep 3128
    tcp 0 0 0.0.0.0:3128 0.0.0.0:* LIST EN 13641/(squid)

    Firewall:


    # nano /etc/sysconfig/iptables


    -A RH-Firewall-1-INPUT -m state --state NEW,ESTABLISHED,RELATED -m tcp -p tcp --dport 3128 -j ACCEPT


    # /etc/init.d/iptables restart


    Flushing firewall rules: [ OK ]
    Setting chains to policy ACCEPT: filter [ OK ]
    Unloading iptables modules: [ OK ]
    Applying iptables firewall rules: [ OK ]
    Loading additional iptables modules: ip_conntrack_netbios_n[ OK ]

    Rezultatas:

    squid Rezultatas

Parašykite komentarą

El. pašto adresas nebus skelbiamas. Būtini laukeliai pažymėti *

Galite naudoti šias HTML žymas ir atributus: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>