{"id":30,"date":"2007-10-30T01:19:11","date_gmt":"2007-10-29T22:19:11","guid":{"rendered":"http:\/\/www.held.org.il\/blog\/?p=30"},"modified":"2007-10-30T01:19:11","modified_gmt":"2007-10-29T22:19:11","slug":"ip-linux-command-line-trick-or-is-ifconfig-obsolete","status":"publish","type":"post","link":"http:\/\/www.held.org.il\/blog\/2007\/10\/ip-linux-command-line-trick-or-is-ifconfig-obsolete\/","title":{"rendered":"&quot;ip&quot; Linux command line trick (or: is ifconfig obsolete?)"},"content":{"rendered":"<p>We all know how to add a virtual IP using ifconfig command line:<\/p>\n<blockquote><p>ifconfig eth0:1 192.168.1.5 up<\/p><\/blockquote>\n<p>Apparently Linux' <em>\/sbin\/ip<\/em> tool provides an alternative:<\/p>\n<blockquote><p>ip addr add 192.168.1.5\/24 dev eth0<\/p><\/blockquote>\n<p>This way we do not create a new interface at all: this is a secondary IP that belongs to <em>eth0<\/em>. Also, it's \"hidden\" from ifconfig (at least until someone fixes that..), which most people use. Cool, eh?<\/p>\n<p>Apparently RedHat cluster uses this method for adding a Virtual IP to a machine, while Linux-ha (version 1 at least), Veritas cluster and Oracle RAC use the traditional, eth0:1-like addresses.<\/p>\n<p>The <em>\/sbin\/ip<\/em> tool seems very powerful.. I should learn some more tricks =)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We all know how to add a virtual IP using ifconfig command line: ifconfig eth0:1 192.168.1.5 up Apparently Linux&#8217; \/sbin\/ip tool provides an alternative: ip addr add 192.168.1.5\/24 dev eth0 This way we do not create a new interface at all: this is a secondary IP that belongs to eth0. Also, it&#8217;s &#8220;hidden&#8221; from ifconfig [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[75],"tags":[],"_links":{"self":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts\/30"}],"collection":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/comments?post=30"}],"version-history":[{"count":0,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts\/30\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/media?parent=30"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/categories?post=30"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/tags?post=30"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}