如果vps有多个ip,只开一个firefox挂vagex未免有点浪费。下面是多开firefox(每个firefox不同出口ip)挂vagex的教程。。。
*本教程基于Debian,Windows直接看第五步,可以正常上分。CentOS第三步貌似要改成sockd,未实验。
1、搭建挂vagex的环境
随便一个桌面,安装好firefox即可。(不会装的话参考以下教程)
2、查看vps网卡
ifconfig
ifconfig
一般Xen的vps为eth0:x,openvz的为venet0:x
3、安装socks服务并配置
apt-get install dante-server -y rm -fr /etc/danted.conf vi /etc/danted.conf
apt-get install dante-server -y
rm -fr /etc/danted.conf
vi /etc/danted.conf
将下面的venet0:1改成你的第二个ip所在的网卡名称,把1.2.3.4改成你的vps ip
internal: venet0:1 port = 1919 external: venet0:1 method: username none
#user.privileged: root user.notprivileged: nobody #logoutput: stderr
logoutput: /var/log/danted.log client pass { from: 1.2.3.4/24 to:
1.2.3.4/24 log: connect disconnect } pass { from: 0.0.0.0/0 to: 0.0.0.0/0
port gt 1023 command: bind log: connect disconnect } pass { from:
0.0.0.0/0 to: 0.0.0.0/0 command: connect udpassociate log: connect
disconnect } block { from: 0.0.0.0/0 to: 0.0.0.0/0 log: connect error }
internal: venet0:1 port = 1919
external: venet0:1
method: username none
#user.privileged: root
user.notprivileged: nobody
#logoutput: stderr
logoutput: /var/log/danted.log
client pass {
from: 1.2.3.4/24 to: 1.2.3.4/24
log: connect disconnect
}
pass {
from: 0.0.0.0/0 to: 0.0.0.0/0 port gt 1023
command: bind
log: connect disconnect
}
pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
command: connect udpassociate
log: connect disconnect
}
block {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect error
}
4、重启并检测是否生效
reboot netstat -an|grep 1919
reboot
netstat -an|grep 1919
若有输出则生效。
5、登录vnc设置firefox。
在终端输入firefox -P ns -no-remote
添加一个名为no1的配置文件,配置完毕后关闭。再输入firefox -P ns -no-remote
添加no2,设置socks代理,ip和端口是之前netstat -an |grep
1919显示出来的,配置完毕后关闭。(貌似说的不太清楚,在最后配图说明)
6、修改vnc启动脚本(如果第五步的配置文件名修改过,这里也要对应修改)
vi ~/.vnc/xstartup firefox -P no1 -no-remote & sleep 1 firefox -P no2
-no-remote & sleep 1
vi ~/.vnc/xstartup
firefox -P no1 -no-remote &
sleep 1
firefox -P no2 -no-remote &
sleep 1
7、重启看是否正常
reboot
1
reboot
转载请注明:VPS驿站 » 多ip VPS 多开firefox挂vagex 说明