Linode 只以外网流出流量(outband)计费, 而内网流量均不计费,那么如何 添加内网IP 呢?下面就为你介绍。
首先在 Linode 后台面板 添加内网IP
配置服务器 添加内网IP
CentOS 6
/etc/sysconfig/network-scripts/ifcfg-eth0
# eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
# Your primary public IP address,填写外网 IP
IPADDR=198.51.100.5
NETMASK=255.255.255.0
GATEWAY=198.51.100.1
/etc/sysconfig/network-scripts/ifcfg-eth0:1
# eth0:1
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
# To add a private IP address, 填写内网 IP IPADDR=192.168.10.100 NETMASK=255.255.128.0
Debian / Ubuntu
/etc/network/interfaces
# Your primary public IP address,填写外网 IP.
iface eth0 inet static
address 198.51.100.5/24
gateway 198.51.100.1
# To add a private IP address,填写内网 IP:
iface eth0 inet static
address 192.168.100.100/17
最后关掉官方的网络助手(Network Helper)
重启服务器生效
本文完。