Damian writes:
> I assume its ifconfig thats used to set up virtual eth0:[0-??] How
> many can be set up? Are there any issues with doing this? Also what
> is the exact syntax to do this?
I've set up systems with hundreds of virtual interfaces - I don't know
whether there's a hard limit.
In general, you set up your interfaces in a file called "interfaces" -
on Debian, this is in /etc/network/interfaces; it may be somewhere
else under Red Hat or other peasant distributions.
If this file exists, it'll likely have a syntax something like this:
auto eth0
iface eth0 inet static
address 1.2.3.4
netmask 255.255.255.0
broadcast 1.2.3.255
gateway 1.2.3.1
auto eth1
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0
broadcast 192.168.192.255
This tells the system that "eth0" is your external interface, with an
IP address of 1.2.3.4 (and other parameters), and that "eth1" is your
internal interface, with an IP of 192.168.1.1 (etc).
To add a virtual interface, add the lines:
auto eth0:0
address 1.2.3.5
netmask 255.255.255.0
broadcast 1.2.3.255
... replacing 1.2.3.5 with the IP of the address you want to use, and
adjusting the other parameters accordingly. There then should be a
command to bring up all the interfaces in this file (on Debian, it's
"ifup -a").
If your system doesn't have this file, it's likely that it has a
similar one to set up the interfaces. If it doesn't seem to have
anything at all, you can add extra interfaces 'manually' using the
ifconfig command:
ifconfig eth0:0 1.2.3.5 netmask 255.255.255.0 broadcast 1.2.3.255
... but I would hope that all modern distros use a config-file format
for the interfaces.
Hope this helps,
Colm
--
Colm Buckley, NewWorld Commerce, 16 South Cumberland St., Dublin 2, Ireland.
Personal: +353 87 2469146 / colm at tuatha.org / http://www.tuatha.org/~colm/
Business: +353 1 4334334 / colm at nwcgroup.com / http://www.nwcgroup.com/
Fax is stranger than fiction.
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!