SOCKS Proxy: Difference between revisions

From KlavoWiki
Jump to navigationJump to search
No edit summary
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 23: Line 23:
make install
make install
</pre>
</pre>
Start dante
<pre>
/usr/local/sbin/sockd &
</pre>


Configuration
Configuration
<pre>
<pre>
vi /etc/danted.conf
vi /etc/sockd.conf
</pre>
</pre>


Line 33: Line 39:


internal: eth0 port = 1080
internal: eth0 port = 1080
external: 10.9.10.6
external: tun0


socksmethod: username none
socksmethod: username none
Line 52: Line 58:
         log: connect disconnect error
         log: connect disconnect error
}
}
</pre>
Create PID file
<pre>
touch /var/run/sockd.pid
chmod 666  /var/run/sockd.pid
</pre>
Start at boot.
<pre>
vi /opt/socks-server
</pre>
<pre>
#!/bin/bash
touch /var/run/sockd.pid
chmod 666  /var/run/sockd.pid
COUNTER=0
while [ $(ifconfig | grep -c tun0) -eq 0 ]; do
            sleep 1
            let COUNTER++
            if [ $COUNTER -gt 60 ]
                then
                    exit 1
                  fi
  done
/usr/local/sbin/sockd &
</pre>
<pre>
chmod +x /opt/socks-server
</pre>
<pre>
vi /etc/rc.local
</pre>
Add the line
<pre>
/opt/socks-server &
</pre>
</pre>

Latest revision as of 03:18, 13 May 2019

Prerequisite

apt -y install libwrap0-dev

Download

cd /usr/src
wget http://www.inet.no/dante/files/dante-1.4.2.tar.gz

Extract

tar xvf dante-1.4.2.tar.gz
rm -f dante-1.4.2.tar.gz
cd dante-1.4.2

Build

./configure
make
make install

Start dante

/usr/local/sbin/sockd &


Configuration

vi /etc/sockd.conf
logoutput: /var/log/socks.log

internal: eth0 port = 1080
external: tun0

socksmethod: username none
clientmethod: none

user.privileged: proxy
user.notprivileged: nobody
user.libwrap: nobody

client pass {
        from: 0.0.0.0/0 port 1-65535 to: 0.0.0.0/0
        log: connect disconnect error
}

socks pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        protocol: tcp udp
        log: connect disconnect error
}

Create PID file

touch /var/run/sockd.pid
chmod 666  /var/run/sockd.pid

Start at boot.

vi /opt/socks-server
#!/bin/bash

touch /var/run/sockd.pid
chmod 666  /var/run/sockd.pid

COUNTER=0

while [ $(ifconfig | grep -c tun0) -eq 0 ]; do
            sleep 1

            let COUNTER++

            if [ $COUNTER -gt 60 ]
                 then
                     exit 1
                  fi
   done

/usr/local/sbin/sockd &
chmod +x /opt/socks-server


vi /etc/rc.local

Add the line

/opt/socks-server &