号称永久免费的GCP免费小鸡 2核1G内存30GB硬盘200GB流量

invmy invmy #google-GCP#VPS

最新的GCP使用教程

免费额度按照google账户计算而非结算账户,所以只能开一台。开多就收费。并且出站到CDN的流量全部收费不在这200GB免费内。所以需要特殊的手段来配置和开通。

创建部署

使用非常牛逼的项目配置 https://github.com/fatekey/gcp_free 使用它来完成 配置实例、换源、防火墙、限流关机,配置dae一条龙。

上传自己的ssh密钥

在cloud shell中执行,修改内容中的地区zone和用户名和公钥,就可以使用自己的ssh工具链接了

gcloud compute instances add-metadata free-tier-vm \
--zone="us-west1-b" \
--metadata=ssh-keys="用户名:ssh-rsa AAAA....."

升级内核

dae 新版本要求新的内核,需要自己升级一次内核。问ai操作即可

dae配置修改

下面是dae的配置,如果你有其他机器作为落地,可以修改node填写其他机子的节点。否则还是需要xray

global {
log_level: info
wan_interface: auto
auto_config_kernel_parameter: true
allow_insecure: true
dial_mode: ip
}
node {
local_xray: 'socks5://127.0.0.1:10808'
}
dns {
upstream {
googledns: 'tcp+udp://8.8.8.8:53'
alidns: 'udp://223.5.5.5:53'
}
routing {
request {
qtype(aaaa) -> reject
fallback: alidns
}
}
}
group {
my_group {
policy: fixed(0)
}
}
routing {
# 基础私有网段直连
dip(127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16, '::1', 'fc00::/7', 'fe80::/10') -> direct
dip(224.0.0.0/3, 'ff00::/8') -> direct
dip(geoip:cdnip) -> my_group
# 兜底:其余所有流量(包括 Xray 连往远端的流量)全部直连
fallback: direct
}

xray 配置(可选)

  • local socks5 作为dae分流的入口 (仅本机用)

  • xhttp 80 作为cdn加速回源 (套CDN用)

  • xhttp 443 作为直连节点 (直连)

  • 本地入口SOCKS_IN分流到出口XHTTP_OUT了,这部分修改成自己的节点。或使用xray支持的协议出口就行

请自己使用xray x25519生成对应的公私密钥。使用哪个域名看这里 https://github.com/XTLS/Xray-core/issues/2005#issuecomment-1538294415

{
"log": {
"loglevel": "error",
"access": "none"
},
"inbounds": [
{
"tag": "SOCKS_IN",
"listen": "127.0.0.1",
"port": 10808,
"protocol": "socks",
"settings": {
"auth": "noauth",
"udp": true
}
},
{
"port": 443,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "23e7c672-181d-4a85-8b6d-4e0bacab2831"
}
],
"decryption": "none"
},
"streamSettings": {
"security": "reality",
"realitySettings": {
"target": "tsla.com:443",
"serverNames": [
"www.tsla.com"
],
"privateKey": "私钥",
"shortIds": [
"1688"
]
},
"network": "xhttp",
"xhttpSettings": {
"path": "/23e7c672-181d-4a85-8b6d-4e0bacab2831",
"mode": "auto"
}
}
},
{
"port": 80,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "23e7c672-181d-4a85-8b6d-4e0bacab2831"
}
],
"decryption": "none"
},
"streamSettings": {
"network": "xhttp",
"xhttpSettings": {
"path": "/23e7c672-181d-4a85-8b6d-4e0bacab2831",
"mode": "auto"
}
}
}
],
"outbounds": [
{
"tag": "direct",
"protocol": "freedom"
},
{
"tag": "XHTTP_OUT",
"protocol": "vless",
"settings": {
"vnext": [
{
"address": "域名或ip",
"port": 443,
"users": [
{
"id": "23e7c672-181d-4a85-8b6d-4e0bacab2831",
"encryption": "none"
}
]
}
]
},
"streamSettings": {
"security": "tls",
"tlsSettings": {
"allowInsecure": false,
"alpn": [
"h3",
"h2"
]
},
"sockopt": {
"mark": 255
},
"network": "xhttp",
"xhttpSettings": {
"path": "/23e7c672-181d-4a85-8b6d-4e0bacab2831",
"mode": "stream-one",
}
}
}
],
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type": "field",
"inboundTag": [
"SOCKS_IN"
],
"outboundTag": "XHTTP_OUT"
}
]
}
}

xray 配置 出口 Proton VPN (可选)

如果你没有其他的vps或者延迟很高。你可以使用 Proton VPN提供的wg节点,位置和服务器都可以自定义的。

修改address和peers到xray的配置文件中

{
"outbounds": [
{
"protocol": "wireguard",
"tag": "XHTTP_OUT",
"settings": {
"secretKey": "私钥",
"address": [
"10.2.0.2/32",
"Interface的Address",
],
"peers": [
{
"endpoint": "ip:51820",
"publicKey": "公钥"
},
{
"endpoint": "ip:51820",
"publicKey": "公钥"
}
],
"noKernelTun": true,
"domainStrategy": "ForceIP"
}
}
]
}

检测工具

https://ippure.com/

#检查链路是否有问题
curl -v --proxy socks5://127.0.0.1:10808 https://www.cloudflare.com/cdn-cgi/trace