搭建代理服务器的完整步骤

腾讯云的规定是一个账号一个地区只能有20个公网IP:

1)点击实例名

2)添加辅助网卡

3)绑定弹性公网ip

4)为辅助网卡绑定安全组

5)修改网卡配置文件

 
  1. ### 复制eth0的网卡文件 ###

  2. [root@VM_1_62_centos ~]# cp /etc/sysconfig/network-scripts/ifcfg-eth{0,1}

  3. ### 修改eth1文件 ###

  4. [root@VM_1_62_centos ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth1

  5. # Created by cloud-init on instance boot automatically, do not edit.

  6. #

  7. #第一张网卡信息

  8. # Created by cloud-init on instance boot automatically, do not edit.

  9. #

  10. BOOTPROTO=static

  11. DEVICE=eth0

  12. HWADDR=52:54:00:88:ed:94

  13. # 配置主ip

  14. IPADDR=172.18.1.10

  15. # # # # 配置辅助ip1

  16. IPADDR1=172.18.1.11

  17. # # # 配置辅助iP2

  18. IPADDR2=172.18.1.12

  19. IPADDR3=172.18.1.13

  20. IPADDR4=172.18.1.14

  21. IPADDR5=172.18.1.15

  22. IPADDR6=172.18.1.16

  23. IPADDR7=172.18.1.17

  24. IPADDR8=172.18.1.18

  25. IPADDR9=172.18.1.19

  26. # # # 配置子网掩码

  27. NETMASK=255.255.255.0

  28. # #

  29. # #

  30. # # # # 配置网关

  31. GATEWAY=172.18.1.1

  32. NM_CONTROLLED=no

  33. ONBOOT=yes

  34. PERSISTENT_DHCLIENT=yes

  35. TYPE=Ethernet

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是 CentOS 8 双网卡搭建代理服务器步骤: 1. 确认双网卡的配置,可使用 `ifconfig` 命令查看。 2. 安装 Squid 代理服务器,可以使用以下命令: ``` sudo dnf install squid ``` 3. 修改 Squid 的配置文件 `/etc/squid/squid.conf`,将以下配置添加到文件末尾: ``` # 定义代理服务器监听的网卡和端口 http_port 3128 http_port 192.168.1.100:3128 # 允许所有客户端访问 acl all src all # 允许本地网络访问 acl localnet src 192.168.1.0/24 # 允许连接到所有网站 acl SSL_ports port 443 acl Safe_ports port 80 # http acl Safe_ports port 21 # ftp acl Safe_ports port 443 # https acl Safe_ports port 70 # gopher acl Safe_ports port 210 # wais acl Safe_ports port 1025-65535 # unregistered ports acl Safe_ports port 280 # http-mgmt acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemaker acl Safe_ports port 777 # multiling http # 允许访问所有网站 http_access allow all ``` 注意修改 `http_port` 配置中的 IP 地址为代理服务器所在网卡的 IP 地址。 4. 启动 Squid 服务并设置开机启动: ``` sudo systemctl start squid sudo systemctl enable squid ``` 5. 在客户端浏览器中配置代理服务器,将代理服务器地址设置为 `192.168.1.100`,端口设置为 `3128`。 6. 测试代理服务器是否正常工作,可以在客户端访问任意网站进行测试。 以上就是 CentOS 8 双网卡搭建代理服务器步骤,希望能对你有所帮助。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值