一.首先是要找linode要IP,要不到,都是扯淡.
以Centos为例
编辑eth0,网关和子网掩码可以通过ifconfig查看.
vi /etc/sysconfig/network-scripts/ifcfg-eth0
# Configuration for eth0
DEVICE=eth0
BOOTPROTO=none
# This line ensures that the interface will be brought up during boot.
ONBOOT=yes
# eth0 - This is the main IP address that will be used for most outbound connections.
# The address, netmask and gateway are all necessary.
IPADDR=12.34.56.78 (这里是你的第一个IP地址)
NETMASK=255.255.255.0 (这里是子网掩码)
GATEWAY=12.34.56.1 (网关)
添加第二个IP, File: /etc/sysconfig/network-scripts/ifcfg-eth0:0
vi /etc/sysconfig/network-scripts/ifcfg-eth0:0
# Configuration for eth0:0
DEVICE=eth0:0
BOOTPROTO=none
# This line ensures that the interface will be brought up during boot.
ONBOOT=yes
# eth0:0
IPADDR=34.56.78.90
NETMASK=255.255.255.0
GATEWAY=12.34.56.1
搞定
此时重启网络就可以了
service network restart
怎么才能保证能要到IP呢 很需要一个啊