{"id":519,"date":"2012-06-01T08:35:43","date_gmt":"2012-06-01T06:35:43","guid":{"rendered":""},"modified":"2018-11-01T00:50:03","modified_gmt":"2018-10-31T23:50:03","slug":"setting-ip-address-using-ip-linux-command","status":"publish","type":"post","link":"https:\/\/nil.uniza.sk\/en\/setting-ip-address-using-ip-linux-command\/","title":{"rendered":"Setting an IP address using the ip linux command"},"content":{"rendered":"<p>1) First, we&#39;ll check our current status and linux names of interfaces<\/p>\n<pre>\r\nip a<\/pre>\n<p>or<\/p>\n<pre>\r\nip link<\/pre>\n<p>where commands lists our&#39; machine network interfaces, for example:<\/p>\n<p>&nbsp;<\/p>\n<p>2) Next, using the subcommand <em>addr <\/em>we will add an IP address with a proper nework mask length<\/p>\n<pre>\r\nip addr add 192.168.1.10\/24 dev [INTERFACE_NAME]\r\n<\/pre>\n<p>for example:<\/p>\n<pre>\r\nip addr add 192.168.1.10\/24 dev eth1\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>3) No we will add default gateway&#39;s IP address&nbsp;&nbsp;for correct routing<\/p>\n<pre>\r\nip route add default via [GATEWAY_ADDRESS]\r\n<\/pre>\n<p>in our case for example:<\/p>\n<pre>\r\nip route add default via 192.168.1.1\r\n<\/pre>\n<p>4) and finally start up the interface&nbsp;<\/p>\n<pre>\r\nip link set [INTERFACE_NAME] up\r\n<\/pre>\n<p>for example for eth1 interface:<\/p>\n<pre>\r\nip link set eth1 up\r\n<\/pre>\n<p>5) And at last, check of corectness:<\/p>\n<pre>\r\nip a<\/pre>\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>1) First, we&#39;ll check our current status and linux names of interfaces<\/p>\n<pre>\r\nip a<\/pre>\n<p>or<\/p>\n<pre>\r\nip link<\/pre>\n<p>where commands lists our&#39; machine network interfaces, for example:<\/p>\n<p>&nbsp;<\/p>\n<p>2) Next, using the subcommand <em>addr <\/em>we will add an IP address with a proper nework mask length<\/p>\n<pre>\r\nip addr add 192.168.1.10\/24 dev [INTERFACE_NAME]\r\n<\/pre>\n<p>for example:<\/p>\n<pre>\r\nip addr add 192.168.1.10\/24 dev eth1\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>3) No we will add default gateway&#39;s IP address&nbsp;&nbsp;for correct routing<\/p>","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[685],"tags":[],"class_list":["post-519","post","type-post","status-publish","format-standard","hentry","category-linux_-_howto-en"],"taxonomy_info":{"category":[{"value":685,"label":"Linux - HOWTO"}]},"featured_image_src_large":false,"author_info":{"display_name":"admin","author_link":"https:\/\/nil.uniza.sk\/en\/author\/admin\/"},"comment_info":8,"category_info":[{"term_id":685,"name":"Linux - HOWTO","slug":"linux_-_howto-en","term_group":0,"term_taxonomy_id":683,"taxonomy":"category","description":"","parent":0,"count":71,"filter":"raw","cat_ID":685,"category_count":71,"category_description":"","cat_name":"Linux - HOWTO","category_nicename":"linux_-_howto-en","category_parent":0}],"tag_info":false,"_links":{"self":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/519","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/comments?post=519"}],"version-history":[{"count":0,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/519\/revisions"}],"wp:attachment":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/media?parent=519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/categories?post=519"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/tags?post=519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}