{"id":3217,"date":"2014-10-28T13:50:14","date_gmt":"2014-10-28T13:50:14","guid":{"rendered":"http:\/\/www.deuzebranaweb.com.br\/?p=3217"},"modified":"2014-10-28T13:50:14","modified_gmt":"2014-10-28T13:50:14","slug":"add-uma-tota-default-gateway-com-comando","status":"publish","type":"post","link":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/2014\/10\/28\/add-uma-tota-default-gateway-com-comando\/","title":{"rendered":"Add uma tota default gateway com comando"},"content":{"rendered":"<p>Um comando show. rota e \/ ou manipular a tabela de roteamento IP em Linux e UNIX oses.<\/p>\n<p>&nbsp;<\/p>\n<p>Rota manipula tabelas de roteamento IP do kernel. Seu principal uso \u00e9 para configurar rotas est\u00e1ticas para hosts ou redes espec\u00edficas atrav\u00e9s de uma interface depois de ter sido configurado com o programa ifconfig. Quando o add ou del op\u00e7\u00f5es s\u00e3o usadas, rota modifica as tabelas de roteamento. Sem essas op\u00e7\u00f5es, route exibe o conte\u00fado atual das tabelas de roteamento.<\/p>\n<p>&nbsp;<\/p>\n<h3>Display default route<\/h3>\n<p>Following three-command display the current routing table:<br \/>\n<code># route<\/code><br \/>\nOutput:<\/p>\n<pre>Kernel IP routing table\nDestination     Gateway         Genmask         Flags Metric Ref    Use Iface\n192.168.1.0     *               255.255.255.0   U     0      0        0 ra0\ndefault         dsl-router      0.0.0.0         UG    0      0        0 ra0\n<\/pre>\n<p><code>$ \/sbin\/route<\/code><br \/>\nOutput:<\/p>\n<pre>Kernel IP routing table\nDestination     Gateway         Genmask         Flags Metric Ref    Use Iface\n191.255.255.0   *               255.255.255.0   U     0      0        0 eth0\n169.254.0.0     *               255.255.0.0     U     0      0        0 eth0\ndefault         191.255.255.1   0.0.0.0         UG    0      0        0 eth0\n<\/pre>\n<p>You can use -n option, to display numerical addresses instead of trying to determine symbolic host names (via dns or \/etc\/hosts file). This is useful if you are trying to determine why the route to your nameserver has vanished.<code>$ \/sbin\/route -n<\/code>Output:<\/p>\n<pre>Kernel IP routing table\nDestination     Gateway         Genmask         Flags Metric Ref    Use Iface\n191.255.255.0   0.0.0.0         255.255.255.0   U     0      0        0 venet0\n169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 venet0\n0.0.0.0         191.255.255.1   0.0.0.0         UG    0      0        0 venet0\n<\/pre>\n<p>Please note that a destionation entry 0.0.0.0 (or default) is the default gatway. In above example 191.255.255.1 is a default gatway.<\/p>\n<h3>Add \/ setup a new route<\/h3>\n<p>The syntax is as follows:<br \/>\n<strong>route add default gw {IP-ADDRESS} {INTERFACE-NAME}<\/strong><\/p>\n<p>Where,<\/p>\n<ul>\n<li>IP-ADDRESS: Specify router IP address<\/li>\n<li>INTERFACE-NAME: Specify interface name such as eth0<\/li>\n<\/ul>\n<p>For example if your router IP address is 192.168.1.254 type the following command as the root user:<br \/>\n<code># route add default gw 192.168.1.254 eth0<\/code>OR use hostname such as dsl-router:<code># route add default gw dsl-router eth0<\/code><\/p>\n<h3>Setting route using GUI tools\/command under Linux<\/h3>\n<p>If you find above command hard to use, consider using GUI tools. If your are using Red Hat\/CentOS\/Fedora core Linux type following command:<code># redhat-config-network<\/code>OR If you are using other Linux distribution use command:<code># network-admin<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>http:\/\/www.cyberciti.biz\/faq\/linux-setup-default-gateway-with-route-command\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Um comando show. rota e \/ ou manipular a tabela de roteamento IP em Linux e UNIX oses. &nbsp; Rota manipula tabelas de roteamento IP do kernel. Seu principal uso \u00e9 para configurar rotas est\u00e1ticas para hosts ou redes espec\u00edficas atrav\u00e9s de uma interface depois&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_angie_page":false,"page_builder":"","footnotes":""},"categories":[18,20],"tags":[],"class_list":["post-3217","post","type-post","status-publish","format-standard","hentry","category-comandos-linux","category-linux"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/posts\/3217","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=3217"}],"version-history":[{"count":0,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/posts\/3217\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=3217"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=3217"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=3217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}