If you want to have different ip’s pointing to the same machine over only one network interface (ex. eth0) try this:
- ip addr add 82.103.xxx.xxx/20 dev eth0
verify the info with:
- ip addr show dev eth0
/20 is the ip subnet (CIDR notation). It’s the same like 255.255.240.0 To get a better idea, here a quote from the smoothwall forum:
There are 2 different notations for mask specification. The older one is the a.b.c.d notation. Ex.: 255.255.255.0 for a 24 bits mask. The newer notation makes it simpler as you only write down the number of bits in the mask and don’t have to do fancy calculations in binary. Some examples:
- 10.0.0.0/255.0.0.0 or 10.0.0.0/8
- 172.16.0.0/255.255.0.0 or 172.16.0.0/16
- 192.168.1.0/255.255.255.0 or 192.168.1.0/24
Also try the command line tool “ipcalc” for deeper insight.
Don’t forget, that the secondary ip applied to the virutal nic will be lost upon a reboot. Edit your /etc/network-scripts/ifcfg-eth0 and add the following two lines to also map those secondary ip’s (increment the numbers for new ones):
- IPADDR1=82.103.xxx.xxx
NETMASK1=255.255.240.0
No Comments
Leave a Reply