Loading ...
Sorry, an error occurred while loading the content.
 

Re: [blug-prog] Adding multiple IPv4 addresses for a port

Expand Messages
  • Shakthi Kannan
    Hi, ... You can setup virtual interfaces on eth0: http://www.shorewall.net/Shorewall_and_Aliased_Interfaces.html
    Message 1 of 3 , Dec 8, 2004
      Hi,

      --- "Nagarahalli, Honnappa"
      <honnappa.nagarahalli@...> wrote:
      > I have a requirement in which I need to
      > add multiple IPv4
      > addresses to the same interface such as "eth0".

      You can setup virtual interfaces on eth0:

      http://www.shorewall.net/Shorewall_and_Aliased_Interfaces.html

      http://www.ccp14.ac.uk/ccp14admin/linux-server/ip_aliases/

      Regards,

      K Shakthi


      =====
      --------------------------------------------------------------------------
      K Shakthi
      Specsoft (Hexaware Technologies), ASIC Design Center
      http://www.geocities.com/shakthimaan
      --------------------------------------------------------------------------

      __________________________________________________
      Do You Yahoo!?
      Tired of spam? Yahoo! Mail has the best spam protection around
      http://mail.yahoo.com
    • Sajith T S
      ... Well, sounds like what you re looking for is slightly different, but - will something like this do? for c in `seq 1 254`; do ifconfig eth0:$c 192.168.0.$c;
      Message 2 of 3 , Dec 8, 2004
        On Wednesday 08 December 2004 12:06, Nagarahalli, Honnappa wrote:

        > I have a requirement in which I need to add multiple IPv4
        > addresses to the same interface such as "eth0". Right now I am using
        > the "devinet_ioctl (SIOCSIFADDR, &ir) call in the linux kernel, where
        > "ir" is declared as "struct ifreq ir;". With this, everytime I add a
        > new IP address, the IP address of the "eth0" gets changed to the new
        > one and does not add the new one to the old list. So what I want is
        > when I execute the command "ifconfig eth0" it should show a list of
        > all the IPv4 addresses that I added.

        Well, sounds like what you're looking for is slightly different, but -
        will something like this do?

        for c in `seq 1 254`; do ifconfig eth0:$c 192.168.0.$c; done

        These IP addresses can be actually present on what is placed "on the
        wire." Please don't ask me how on earth multiple IPs on single NIC
        works, I am also looking for literature on this ;-) If you happen to
        know of any, or have an explanation, please let me know.

        Also see http://handsonhowto.com/virt.html

        Sajith.
        --
        http://www.livejournal.com/~sajith/
      Your message has been successfully submitted and would be delivered to recipients shortly.