Setup the loopback, eth0, and all the IP addresses beginning with the
main IP address for the eth0 interface:
/sbin/ifconfig lo 127.0.0.1
/sbin/ifconfig eth0 up
/sbin/ifconfig eth0 172.16.3.1
/sbin/ifconfig eth0:0 172.16.3.10
/sbin/ifconfig eth0:1 172.16.3.100
172.16.3.1 is the main IP address, while .10 and .100 are the aliases. The
magic is the eth0:x where x=0,1,2,...n for the different IP addresses. The
main IP address does not need to be aliased.
Setup the routes. First route the loopback, then the net, and
finally, the various IP addresses starting with the default (originally
allocated) one:
/sbin/route add -net 127.0.0.0
/sbin/route add -net 172.16.3.0 dev eth0
/sbin/route add -host 172.16.3.1 dev eth0
/sbin/route add -host 172.16.3.10 dev eth0:0
/sbin/route add -host 172.16.3.100 dev eth0:1
/sbin/route add default gw 172.16.3.200
That's it.
In the example IP address above, I am using the Private IP addresses (RFC 1918) for
illustrative purposes. Substitute them with your own official or private IP
addresses.
The example shows only 3 IP addresses. The max is defined to be 256 in
/usr/include/linux/net_alias.h. 256 IP addresses on ONE card is a lot :-)!