Find the answer to your Linux question:
Results 1 to 5 of 5
Hi. How does one add an ip alias to an eth device using the ip command instead of the ifconfig command? I do not want the alias to be permanet....
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2006
    Posts
    17

    how to add an ip alias in opensuse?


    Hi.

    How does one add an ip alias to an eth device using the ip command instead of the ifconfig command?

    I do not want the alias to be permanet.

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,760
    Code:
    man ip
    ip addr { add | del } IFADDR dev STRING

  3. #3
    Just Joined!
    Join Date
    Apr 2006
    Posts
    17
    when I run

    Code:
    ip addr add 192.168.1.5 dev eth0:0
    The IP address is indeed added. But it is not added in the form eth0:0

    Does this matter?

    When I add a address alias through yast2 in opensuse, I see that the alias is added as eth0:0.

  4. $spacer_open
    $spacer_close
  5. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    You need to modify your ip command just a bit:
    Code:
    ip addr add 192.168.1.5 dev eth0 label eth0:0
    Then verify it, e.g.:
    Code:
    [root@host] ip addr show dev eth0
    2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
        link/ether 00:11:22:33:aa:bb brd ff:ff:ff:ff:ff:ff
        inet 10.1.1.4/24 brd 192.168.1.255 scope global eth0
        inet 192.169.1.5/32 scope global eth0:0
    Last edited by atreyu; 08-19-2011 at 02:33 PM. Reason: typo

  6. #5
    Just Joined!
    Join Date
    Apr 2006
    Posts
    17
    Awesome, thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •