Re: Multiple IP addresses (or hosts) on one LAN interface

From: /dev/rob0 (rob0_at_gmx.co.uk)
Date: 07/22/03


Date: Tue, 22 Jul 2003 08:35:45 -0700

In article <pan.2003.07.22.12.11.28.750607@cartel-securite.fr>,
  Cedric Blancher wrote:
>> But still there is a difference between 1) Adding the IP using "ifconfig
>> interface:id" 2) Adding the IP using "ip addr add" and the
>> route using "route add"
>
> Except the fact you do not create an aliased interface, I don't think
> there's any difference. I personaly prefer use ifconfig for I can see
> aliases as eth0:idx.

I use /sbin/ip to add my aliases, but I use the ethX:alias syntax. :) A
compromise, as it were. It's also necessary if you want to use the alias
interface with iptables. Well, I think you can only use the whole ethX
interface, which includes any :alias.

I use aliases for different services, so they're portable if I need to
move them to another machine (set up the service on B, stop the service
on A, cancel the alias on A, set up the alias on B, start the service on
B ... and everyone goes on as if nothing had happened.) If the alias is
in the same subnet no special routing is needed.

-- 
  /dev/rob0 - preferred_email=i$((28*28+28))@softhome.net
  or put "not-spam" or "/dev/rob0" in Subject header to reply


Relevant Pages

  • Re: kern/87506 : [PATCH] Fix alias support on vr interfaces
    ... >> setting an alias on a vr device with ifconfig the alias address ... Without the patch I ... > did just reproduce this on my laptop's rlinterface though. ...
    (freebsd-current)
  • Re: ip addr add vs. interface alias
    ... The label does not exist for kernel networking functions such as routing, ... Only the real interface and its addresses exist. ... I have not seen any operational difference between aliases created by ifconfig and addresses added by "ip addr". ... Also, alias handling in ifconfig is somehow inconsistant: you set the label DOWN to delete it. ...
    (comp.os.linux.networking)
  • Re: Multiple IP addresses (or hosts) on one LAN interface
    ... > Except the fact you do not create an aliased interface, ... I personaly prefer use ifconfig for I can see ... It's also necessary if you want to use the alias ... I use aliases for different services, so they're portable if I need to ...
    (comp.os.linux.networking)
  • Re: About insmod NIC modules?
    ... > I am using vmware to boot my linux system. ... I know we should add "alias ... If you've just loaded the module and havn't started the interface then ... plain "ifconfig" probably won't show it. ...
    (comp.os.linux.networking)
  • finding ethernet interfaces and IPs
    ... And several machines with aliases but only one interface. ... I've been using grep and awk on the output from ifconfig -a to get the ... Zebee Johnstone, proud holder of aus.motorcycles Poser Permit #1. ...
    (comp.lang.perl.misc)