<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="es">
	<id>https://manuais.iessanclemente.net/index.php?action=history&amp;feed=atom&amp;title=Linux_como_router</id>
	<title>Linux como router - Historial de revisiones</title>
	<link rel="self" type="application/atom+xml" href="https://manuais.iessanclemente.net/index.php?action=history&amp;feed=atom&amp;title=Linux_como_router"/>
	<link rel="alternate" type="text/html" href="https://manuais.iessanclemente.net/index.php?title=Linux_como_router&amp;action=history"/>
	<updated>2026-10-22T13:05:53Z</updated>
	<subtitle>Historial de revisiones de esta página en la wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://manuais.iessanclemente.net/index.php?title=Linux_como_router&amp;diff=64111&amp;oldid=prev</id>
		<title>Bruno en 22:27 10 mar 2018</title>
		<link rel="alternate" type="text/html" href="https://manuais.iessanclemente.net/index.php?title=Linux_como_router&amp;diff=64111&amp;oldid=prev"/>
		<updated>2018-03-10T22:27:05Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nueva&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Para conigurar un equipo con Debian/Ubuntu como router se ten máis dun interface de rede, basta con habilitar o &amp;#039;&amp;#039;ip forwarding&amp;#039;&amp;#039; ou reenvio de paquetes.&lt;br /&gt;
&lt;br /&gt;
Isto consíguese poñendo un 1 en vez do 0 que hai no ficheiro &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;/proc/sys/net/ipv4/ip_forward&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
O principal problema é que cando reiniciamos a máquina volve a estar un 0 onde escribimos un 1, e deshabilita o reenvío de paquetes.&lt;br /&gt;
&lt;br /&gt;
Para facer eses cambios permanentes, editamos o ficheiro &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;/etc/sysctl.conf&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039; e descomentamos a seguinte liña:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; highlight=&amp;quot;28&amp;quot;&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# /etc/sysctl.conf - Configuration file for setting system variables&lt;br /&gt;
# See /etc/sysctl.d/ for additional system variables.&lt;br /&gt;
# See sysctl.conf (5) for information.&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#kernel.domainname = example.com&lt;br /&gt;
&lt;br /&gt;
# Uncomment the following to stop low-level messages on console&lt;br /&gt;
#kernel.printk = 3 4 1 3&lt;br /&gt;
&lt;br /&gt;
##############################################################3&lt;br /&gt;
# Functions previously found in netbase&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
# Uncomment the next two lines to enable Spoof protection (reverse-path filter)&lt;br /&gt;
# Turn on Source Address Verification in all interfaces to&lt;br /&gt;
# prevent some spoofing attacks&lt;br /&gt;
#net.ipv4.conf.default.rp_filter=1&lt;br /&gt;
#net.ipv4.conf.all.rp_filter=1&lt;br /&gt;
&lt;br /&gt;
# Uncomment the next line to enable TCP/IP SYN cookies&lt;br /&gt;
# See http://lwn.net/Articles/277146/&lt;br /&gt;
# Note: This may impact IPv6 TCP sessions too&lt;br /&gt;
#net.ipv4.tcp_syncookies=1&lt;br /&gt;
&lt;br /&gt;
# Uncomment the next line to enable packet forwarding for IPv4&lt;br /&gt;
net.ipv4.ip_forward=1&lt;br /&gt;
&lt;br /&gt;
# Uncomment the next line to enable packet forwarding for IPv6&lt;br /&gt;
#  Enabling this option disables Stateless Address Autoconfiguration&lt;br /&gt;
#  based on Router Advertisements for this host&lt;br /&gt;
#net.ipv6.conf.all.forwarding=1&lt;br /&gt;
&lt;br /&gt;
###################################################################&lt;br /&gt;
# Additional settings - these settings can improve the network&lt;br /&gt;
# security of the host and prevent against some network attacks&lt;br /&gt;
# including spoofing attacks and man in the middle attacks through&lt;br /&gt;
# redirection. Some network environments, however, require that these&lt;br /&gt;
# settings are disabled so review and enable them as needed.&lt;br /&gt;
#&lt;br /&gt;
# Do not accept ICMP redirects (prevent MITM attacks)&lt;br /&gt;
#net.ipv4.conf.all.accept_redirects = 0&lt;br /&gt;
#net.ipv6.conf.all.accept_redirects = 0&lt;br /&gt;
# _or_&lt;br /&gt;
# Accept ICMP redirects only for gateways listed in our default&lt;br /&gt;
# gateway list (enabled by default)&lt;br /&gt;
# net.ipv4.conf.all.secure_redirects = 1&lt;br /&gt;
#&lt;br /&gt;
# Do not send ICMP redirects (we are not a router)&lt;br /&gt;
#net.ipv4.conf.all.send_redirects = 0&lt;br /&gt;
#&lt;br /&gt;
# Do not accept IP source route packets (we are not a router)&lt;br /&gt;
#net.ipv4.conf.all.accept_source_route = 0&lt;br /&gt;
#net.ipv6.conf.all.accept_source_route = 0&lt;br /&gt;
#&lt;br /&gt;
# Log Martian Packets&lt;br /&gt;
#net.ipv4.conf.all.log_martians = 1&lt;br /&gt;
#&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Para aplicar a configuración nova, podemos reiniciar o equipo, ou executar&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sysctl -p&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Como probablemente, as redes as que está conectado o router, son redes privadas, necesitaremios, activar a tradución de enderezos (NAT) mediante &amp;#039;&amp;#039;iptables&amp;#039;&amp;#039;. Supoñendo que eth0 é o interface de rede que conecta o router co exterior.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Para gardar todo isto, instalamos o paquete &amp;#039;&amp;#039;&amp;#039;iptables-persistent&amp;#039;&amp;#039;&amp;#039; e indicamos que queremos gardar as regras actuais.&lt;/div&gt;</summary>
		<author><name>Bruno</name></author>
	</entry>
</feed>