我正在使用AWS VPC制作一个OpenVPN服务器。 我想创build一个只接受来自我的VPN的SSH连接的安全组。 我已经使用我的VPC CIDR(10.0.0.0/8),OpenVPN公共地址和OpenVPN CIDR(tun0 / 192.168.0.0/30),但不起作用。
这是我的OpenVPN服务器的ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9001 inet 10.0.0.116 netmask 255.255.255.0 broadcast 10.0.0.255 inet6 fe80::8f4:d5ff:fe76:1230 prefixlen 64 scopeid 0x20<link> ether 0a:f4:d5:76:12:30 txqueuelen 1000 (Ethernet) RX packets 8783395 bytes 5626116552 (5.2 GiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 6575989 bytes 5676746788 (5.2 GiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1 (Local Loopback) RX packets 64 bytes 5920 (5.7 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 64 bytes 5920 (5.7 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500 inet 192.168.0.1 netmask 255.255.255.255 destination 192.168.0.2 inet6 fe80::a316:dc9b:98b8:526 prefixlen 64 scopeid 0x20<link> unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 100
更新:
经过一些尝试和错误,我发现我可以连接到我的实例,如果安全组正在使用我的ISP地址,但不是我的VPN地址。 是关于NAT的问题?
经过一些故障排除,我知道我有一个错误,我应该连接的IP地址。 原因我无法连接SSH端口是我使用IP公众连接。 它应该使用IP私人。