G.Sagar's [sagarg at bol.net.in] 12 lines of dribble included:
:>Hiyall,
:>:>How do i assign 2 IP addresses to a single eth interface ??
:>
You might want to take a look at the Linux Networking HOWTO (should be on
linuxdoc.org or any of the other mirrors around). There should be stuff on IP
aliasing in that, but simply..
you must have IP Aliasing support compiled into your kernel by default (don't
ask me if it is, I rarely use generic kernels ;P)
Considering your local network is 192.168.1.*
ifconfig eth0 192.168.1.1 netmask
route add -net 192.168.1.0 netmask 255.255.255.0 eth0
That's pretty standard. Basically after that, your physical interface and
virtual interface are denoted as
<phys interface>:<virtual interface>
e.g.
eth0:0
eth0:1
..
There's more information in the Linux Networking HOWTO, documented better than
I could ever do it here, but the syntax for adding the alias is the exact same
as above except you reference it as something like
eth0:0 as your interface, instead of eth0 with a different address of course.
Phil.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!