Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

At the moment I have following IPv4 addresses associated with eth0 interface:

T60:~ # ip -V
ip utility, iproute2-ss110629
T60:~ # ip addr show dev eth0
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether 00:15:58:2a:84:3e brd ff:ff:ff:ff:ff:ff
    inet 10.11.12.2/24 scope global eth0
    inet 10.11.12.3/24 scope global secondary eth0
    inet 10.11.12.4/24 scope global secondary eth0
    inet6 fe80::215:58ff:fe2a:843e/64 scope link 
       valid_lft forever preferred_lft forever
T60:~ # 

I would like to replace or change 10.11.12.3/24 address to 10.11.12.6/24. How to do this? If I execute ip addr change 10.11.12.6/24 dev eth0 or ip addr replace 10.11.12.6/24 dev eth0 then 10.11.12.6 is just added to eth0. In addition, in case of change/replace, shouldn't the syntax be change/replace from 10.11.12.3/24 to 10.11.12.6/24? I know that I can use ip addr del command, but how to achieve this with ip addr change or ip addr replace?

share|improve this question

1 Answer 1

Change and replace aren't arguments for addr

They are used for routes

share|improve this answer
4  
On the other hand, if I type in $ ip addr help then usage of the ip addr command is ip addr {add|change|replace} IFADDR dev STRING [ LIFETIME ] [ CONFFLAG-LIST ] –  Martin Feb 9 '13 at 1:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.