在腾讯云购买了50GB系统盘,1GB内存的CVM。从腾讯云控制台可以看到这个CVM有一个内网IP和一个公网IP:
可用区
北京六区
配置
标准型SA2/1核/1GB/1Mbps
系统盘
高效云硬盘/50GB
网络类型
私有网络
IP地址
82.157.XX.XX(公)
172.21.X.X(内)
发现利用腾讯云提供的公网IP,可以在家直接利用xshell ssh到此机器,但是进入此CVM之后,其实是看不到公网IP的,只能看到内网IP:
ubuntu@VM-0-2-ubuntu:~$ ifconfig -a
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.21.0.2 netmask 255.255.240.0 broadcast 172.21.15.255
inet6 fe80::5054:ff:fe85:b117 prefixlen 64 scopeid 0x20<link>
ether 52:54:00:85:b1:17 txqueuelen 1000 (Ethernet)
RX packets 85288 bytes 60348511 (60.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 55615 bytes 9959998 (9.9 MB)
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 1000 (Local Loopback)
RX packets 1380 bytes 120356 (120.3 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1380 bytes 120356 (120.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
查看这个CVM的设备,可以发现此虚拟机的磁盘和网络控制器都是Virtio的。
ubuntu@VM-0-2-ubuntu:~$ lspci
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01)
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 VGA compatible controller: Cirrus Logic GD 5446
00:03.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge
00:04.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge
00:05.0 Ethernet controller: Red Hat, Inc. Virtio network device
00:06.0 SCSI storage controller: Red Hat, Inc. Virtio block device
00:07.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon
公网IP是通过DNAT实现的。
在腾讯云可可以正常运行tiny-proxy.
sudo apt-get update
sudo apt-get install tinyproxy
sudo service tinyproxy start
一开始使用8080端口不能用,可能是端口的问题,换了一个端口就能用了。
用chrom浏览器测试能用。