{"id":436,"date":"2019-04-30T19:32:27","date_gmt":"2019-04-30T22:32:27","guid":{"rendered":"http:\/\/greenoperations.com.br\/greenblog\/?p=436"},"modified":"2019-04-30T19:32:27","modified_gmt":"2019-04-30T22:32:27","slug":"nova-configuracao-de-ip-do-linux-ubuntu-e-derivados","status":"publish","type":"post","link":"https:\/\/greenoperations.com.br\/greenblog\/index.php\/2019\/04\/30\/nova-configuracao-de-ip-do-linux-ubuntu-e-derivados\/","title":{"rendered":"Nova configura\u00e7\u00e3o de IP do Linux (Ubuntu e Derivados)"},"content":{"rendered":"<p style=\"text-align: justify;\"><span style=\"color: #333333;\">Recentemente o Ubuntu fez algumas altera\u00e7\u00f5es no modo como se configura as conex\u00f5es de rede, sempre tudo foi feito alterando o arquivo <span class=\"\"><span style=\"color: #993300;\">\/etc\/network\/interfaces<\/span><\/span><em><span class=\"\">, <\/span><\/em><span class=\"\">que ap\u00f3s editado para ip est\u00e1tico tinha essa cara:<\/span><\/span><\/p>\n<blockquote>\n<pre><span style=\"color: #993300;\"><span class=\"\">\r\n<\/span>auto eth0\u00a0<\/span>\r\n<span style=\"color: #993300;\">iface eth0\u00a0<\/span>\r\n<span style=\"color: #993300;\">inet static <\/span>\r\n<span style=\"color: #993300;\"> address 192.168.1.30 <\/span>\r\n<span style=\"color: #993300;\"> netmask 255.255.255.0 <\/span>\r\n<span style=\"color: #993300;\"> gateway 192.168.1.1 <\/span>\r\n<span style=\"color: #993300;\"> dns-nameservers 8.8.8.8,8.8.4.4<\/span><\/pre>\n<\/blockquote>\n<p style=\"text-align: justify;\"><span class=\"\" style=\"color: #333333;\">e depois reiniciando as interfaces afetadas, executando os comandos abaixo como root:<\/span><\/p>\n<blockquote>\n<pre><span style=\"color: #333333;\"><span style=\"color: #993300;\">\/etc\/init.d\/networking restart<\/span> ou <span style=\"color: #993300;\">systemctl restart networking<\/span><\/span><\/pre>\n<\/blockquote>\n<p style=\"text-align: justify;\"><span style=\"color: #333333;\"><span class=\"\">Mas agora o assunto \u00e9 diferente, vamos destrinchar o passo a passo para configura\u00e7\u00e3o de rede nas novas vers\u00f5es do Ubuntu e seus derivados. <\/span>Primeiro passo \u00e9 abrir um terminal e executar o comando:<\/span><\/p>\n<blockquote>\n<pre><span style=\"color: #333333;\"> $<span style=\"color: #993300;\">ip a<\/span><\/span><\/pre>\n<\/blockquote>\n<p style=\"text-align: justify;\"><span style=\"color: #333333;\">Com esse comando \u00e9 poss\u00edvel listar e ver as configura\u00e7\u00f5es das interfaces de rede no computador, use esse comando para ver o nome da conex\u00e3o que deseja alterar, a nomenclatura ser\u00e1 algo parecido com enp0s3 ou algo assim. Logo na sequencia acesse o diret\u00f3rio <span style=\"color: #993300;\">\/etc\/netplan<\/span> e dentro dele procure um arquivo com a extens\u00e3o <span style=\"color: #993300;\">yaml<\/span> esse arquivo receber\u00e1 nossas configura\u00e7\u00f5es manuais de ip, seguindo o exemplo abaixo:<\/span><\/p>\n<blockquote>\n<pre><span style=\"color: #993300;\">network:\r\n    version: 2\r\n    renderer: networkd\r\n    ethernets:\r\n       enp0s3:\r\n       dhcp4: no\r\n       addresses: [192.168.1.30\/24]\r\n       gateway4: 192.168.1.1\r\n       nameservers:\r\n          addresses: [8.8.4.4,8.8.8.8]<\/span><\/pre>\n<\/blockquote>\n<p style=\"text-align: justify;\">A indenta\u00e7\u00e3o no arquivo deve ser respeitada podendo inclusive gerar erros ao tentar conectar com as novas configura\u00e7\u00f5es. Para poder testar as configura\u00e7\u00f5es indicadas \u00e9 preciso executar o comando abaixo como root:<\/p>\n<blockquote>\n<pre><span style=\"color: #993300;\">netplan try<\/span><\/pre>\n<\/blockquote>\n<p style=\"text-align: justify;\">Se tudo estiver okay, ser\u00e1 preciso executar o \u00faltimo comando (tamb\u00e9m como root):<\/p>\n<blockquote>\n<pre><span style=\"color: #993300;\">netplan apply<\/span><\/pre>\n<\/blockquote>\n<p style=\"text-align: justify;\">E, pronto! Voc\u00ea est\u00e1 apto a acessar a internet, ou continuar a configura\u00e7\u00e3o do seu servidor, a primeira inst\u00e2ncia parece complicado, mas com o tempo \u00e9 poss\u00edvel ir se acostumando. Espero que voc\u00ea tenha gostado dessa dica e, at\u00e9 a pr\u00f3xima! \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recentemente o Ubuntu fez algumas altera\u00e7\u00f5es no modo como se configura as conex\u00f5es de rede, sempre tudo foi feito alterando o arquivo \/etc\/network\/interfaces, que ap\u00f3s editado para ip est\u00e1tico tinha essa cara: auto eth0\u00a0 iface eth0\u00a0 inet static address 192.168.1.30 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers 8.8.8.8,8.8.4.4 e depois reiniciando as interfaces afetadas, executando os comandos [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":437,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[22,56,46,17],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/greenoperations.com.br\/greenblog\/index.php\/wp-json\/wp\/v2\/posts\/436"}],"collection":[{"href":"https:\/\/greenoperations.com.br\/greenblog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/greenoperations.com.br\/greenblog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/greenoperations.com.br\/greenblog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/greenoperations.com.br\/greenblog\/index.php\/wp-json\/wp\/v2\/comments?post=436"}],"version-history":[{"count":3,"href":"https:\/\/greenoperations.com.br\/greenblog\/index.php\/wp-json\/wp\/v2\/posts\/436\/revisions"}],"predecessor-version":[{"id":440,"href":"https:\/\/greenoperations.com.br\/greenblog\/index.php\/wp-json\/wp\/v2\/posts\/436\/revisions\/440"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/greenoperations.com.br\/greenblog\/index.php\/wp-json\/wp\/v2\/media\/437"}],"wp:attachment":[{"href":"https:\/\/greenoperations.com.br\/greenblog\/index.php\/wp-json\/wp\/v2\/media?parent=436"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/greenoperations.com.br\/greenblog\/index.php\/wp-json\/wp\/v2\/categories?post=436"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/greenoperations.com.br\/greenblog\/index.php\/wp-json\/wp\/v2\/tags?post=436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}