必须使用新版protal,经典无法配置。

azure配置多IP地址,在azue虚拟机中增加ip地址,公网ip选动态,内网选静态。

https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-multiple-ip-addresses-portal

1
2
# cd /etc/sysconfig/network-scripts
# vi ifcfg-eth0:0

内容如下:

1
2
3
4
5
6
7
8
9
DEVICE=eth0:0
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.0.0.5
NETMASK=255.255.255.0

# vi ifcfg-eth0:1 依次类推

/etc/init.d/network restart

Linux(以Ubuntu为例)配置单机多IP地址还是很简单的,编辑/etc/netword/interfaces文件即可:

http://blog.csdn.net/apoxlo/article/details/8148226

1
2
3
4
5
6
7
8
auto eno1:90iface eno1:0 inet static
        address 192.168.8.90
        netmask 255.255.255.0
        gateway 192.168.8.1
auto eno1:91iface eno1:91 inet static
        address 192.168.8.91
        netmask 192.168.8.255
        gateway 192.168.8.1

以上配置中,eno1是网卡的名字,eno1:90是配置在该网卡的一个虚拟网卡的名字,并给该虚拟网卡配置了IP:192.168.8.90。按照这个规则,可以给eno1这个网卡绑定很多IP,如果这些IP都是公网IP,就可以把它当配置成爬虫的多代理服务。

配置squid3多IP出口

机器有了多IP,如果不对squid做相应的配置,出口IP还只能是一个,其他IP都不能用得上。 编辑/etc/squid/squid.conf配置文件,做相应配置

1
2
3
acl ip_90 myip 192.168.8.90 tcp_outgoing_address 192.168.8.90 ip_90

acl ip_91 myip 192.168.8.91 tcp_outgoing_address 192.168.8.91 ip_91

以上配置就是对每个进来的IP的请求设置出口IP,从而达到一机多IP代理的实现。