我用的conoha的linuxvps,追加两个IP后,按一般的linux的绑定域名教程,就是增加ifcfg-eth0:1,重启后显示Determining if ip address 157.x.x.x is already in use for device eth0...,IP也ping不通,ifconfig的页面是:
eth0 Link encap:Ethernet HWaddr FA:16:3E:3C:C2:50
inet addr:157.x.x.1 Bcast:157.x.x.255 Mask:255.255.254.0
[1] テーブルの設定
# vi /etc/iproute2/rt_tables
201 gw1 <= 適当に名前を付けます。
[2] 追加IP(eth1の場合)のgw設定
# vi /etc/sysconfig/network-scripts/route-eth1
default via 157.XXX.XXX.1 table gw1 <= 追加IPアドレスのデフォルトゲートウェイを入力
[3] 追加IPのstatic route設定
# vi /etc/sysconfig/network-scripts/rule-eth1
from 157.XXX.XXX.XX1 table gw1 <= 追加IPアドレスを入力(複数ある場合は複数行にわたって入力)
from 157.XXX.XXX.XX2 table gw1
# service network restart
按照这个教程重启后显示:
Shutting down interface eth0: [ OK ]
Shutting down interface eth1: Error: argument "gw1 " is wrong: invalid table ID
Error: argument "gw1 " is wrong: invalid table ID
[ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0:
Determining IP information for eth0... done.
Determining IPv6 information for eth0... done.
[ OK ]
Bringing up interface eth1: Determining if ip address 157.8.x.x is already in use for device eth1...
Error: argument "gw1 " is wrong: invalid table ID
[1] テーブルの設定
# vi /etc/iproute2/rt_tables
201 gw1 <= 適当に名前を付けます。
[2] 追加IP(eth1の場合)のgw設定
# vi /etc/sysconfig/network-scripts/route-eth1
default via 157.XXX.XXX.1 table gw1 <= 追加IPアドレスのデフォルトゲートウェイを入力
[3] 追加IPのstatic route設定
# vi /etc/sysconfig/network-scripts/rule-eth1
from 157.XXX.XXX.XX1 table gw1 <= 追加IPアドレスを入力(複数ある場合は複数行にわたって入力)
from 157.XXX.XXX.XX2 table gw1
# service network restart
按照这个教程重启后显示:
Shutting down interface eth0: [ OK ]
Shutting down interface eth1: Error: argument "gw1 " is wrong: invalid table ID
Error: argument "gw1 " is wrong: invalid table ID
[ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0:
Determining IP information for eth0... done.
Determining IPv6 information for eth0... done.
[ OK ]
Bringing up interface eth1: Determining if ip address 157.8.x.x is already in use for device eth1...
Error: argument "gw1 " is wrong: invalid table ID