i got a new IP for my server from my host. the server is already hosting one site.
i got a range of IP. like 220.127.116.11~18.104.22.168
how can i add these ?
You update your
/etc/network/interfaces file. Something like this is probably close to what you want.
auto eth0 iface eth0 inet static address 22.214.171.124 netmask 255.255.255.192 gateway 126.96.36.199 dns-nameservers 192.168.1.1 192.168.1.2 dns-search example.com # add secondary ip address up ip addr add 188.8.131.52/26 brd + dev eth0 down ip addr del 184.108.40.206/26 brd + dev eth0
Beneath your regular iface lines for your default interface, add:
up ip addr add 220.127.116.11/32 dev eth0 up ip addr add 18.104.22.168/32 dev eth0 up ip addr add 22.214.171.124/32 dev eth0 up ip addr add 126.96.36.199/32 dev eth0 up ip addr add 188.8.131.52/32 dev eth0
This will add each IP individually.
Alternatively you can add the network via CIDR in one line:
up ip addr add 184.108.40.206/29 dev eth0
Both will work if the network was added as a proper CIDR network.
You could create some ethernet aliases, like this:
ifconfig eth0:1 192.168.0.1/24 ifconfig eth0:2 192.168.0.2/24 ifconfig eth0:3 192.168.0.3/24 ifconfig eth0:4 192.168.0.4/24