<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>static &#8211; SMsoft &#8211; informatica e dintorni</title>
	<atom:link href="https://blog.smsoft.it/tag/static/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.smsoft.it</link>
	<description>consigli settimanali su MacOS, GNU/Linux ed Open Source</description>
	<lastBuildDate>Tue, 20 Dec 2016 08:30:48 +0000</lastBuildDate>
	<language>it-IT</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=61802</generator>
	<item>
		<title>Debian Jessie: aggiungere una rotta statica</title>
		<link>https://blog.smsoft.it/2016/12/20/debian-jessie-aggiungere-rotta-statica/</link>
					<comments>https://blog.smsoft.it/2016/12/20/debian-jessie-aggiungere-rotta-statica/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 20 Dec 2016 08:30:48 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[rotta]]></category>
		<category><![CDATA[route]]></category>
		<category><![CDATA[static]]></category>
		<guid isPermaLink="false">http://blog.smsoft.it/?p=3591</guid>

					<description><![CDATA[Su Debian Jessie, per aggiungere una rotta statica (static route), ovvero inoltrare le richieste verso alcuni IP ad un gateway differente da quello di default, si può intervenire nel file /etc/network/interfaces. Se ad esempio la configurazione è: allow-hotplug eth0 #iface eth0 inet dhcp iface eth0 inet static address 10.109.70.60 netmask 255.255.255.0 network 10.109.70.0 dns-nameservers 10.109.70.100 ... <a title="Debian Jessie: aggiungere una rotta statica" class="read-more" href="https://blog.smsoft.it/2016/12/20/debian-jessie-aggiungere-rotta-statica/" aria-label="Per saperne di più su Debian Jessie: aggiungere una rotta statica">Leggi tutto</a>]]></description>
										<content:encoded><![CDATA[<p>Su Debian Jessie, per aggiungere una rotta statica (static route), ovvero inoltrare le richieste verso alcuni IP ad un gateway differente da quello di default, si può intervenire nel file <strong>/etc/network/interfaces</strong>.</p>
<p>Se ad esempio la configurazione è:<br />
<code lang="bash">allow-hotplug eth0<br />
#iface eth0 inet dhcp<br />
iface eth0 inet static<br />
  address 10.109.70.60<br />
  netmask 255.255.255.0<br />
  network 10.109.70.0<br />
  dns-nameservers 10.109.70.100 10.109.70.200<br />
  brodcast 10.109.70.255</p>
<p>auto eth1<br />
allow-hotplug eth1<br />
iface eth1 inet static<br />
        address 34.23.14.132<br />
        netmask 255.255.255.248<br />
        network 34.23.14.128<br />
        gateway 34.23.14.129<br />
        broadcast 34.23.14.135<br />
        dns-nameservers 8.8.8.8</code></p>
<p>Si vede che il <strong>gateway di default</strong> è <strong>34.23.14.129</strong> e quindi quello che non è diretto verso la rete <strong>10.109.70.x</strong> andrà sul gateway di default.<br />
Se si vuole che qualsiasi richiesta verso la rete 10.x.x.x.x passi per il gateway <strong>10.109.70.1</strong> e quello diretto verso la rete <strong>10.109.67.x</strong> passi per il gateway <strong>10.109.70.249</strong>, basterà aggiungere <strong>sotto la definizione della relativa eth</strong>, le direttive <strong>post-up</strong>.</p>
<p>Avremo quindi una cosa del genere:</p>
<p><code lang="bash">allow-hotplug eth0<br />
#iface eth0 inet dhcp<br />
iface eth0 inet static<br />
  address 10.109.70.60<br />
  netmask 255.255.255.0<br />
  network 10.109.70.0<br />
  dns-nameservers 10.109.70.100 10.109.70.200<br />
  brodcast 10.109.70.255<br />
  post-up /sbin/route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.109.70.1 dev eth0<br />
# oppure, nel vecchio formato<br />
  post-up /sbin/route add -net 10.109.67.0 netmask 255.255.255.0 gw 10.109.70.249 dev eth0</p>
<p>auto eth1<br />
allow-hotplug eth1<br />
iface eth1 inet static<br />
        address 34.23.14.132<br />
        netmask 255.255.255.248<br />
        network 34.23.14.128<br />
        gateway 34.23.14.129<br />
        broadcast 34.23.14.135<br />
        dns-nameservers 8.8.8.8</code></p>
<p>enjoy!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.smsoft.it/2016/12/20/debian-jessie-aggiungere-rotta-statica/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Static route e Persistent static route su Debian</title>
		<link>https://blog.smsoft.it/2011/10/28/static-route-e-persistent-static-route-su-debian/</link>
					<comments>https://blog.smsoft.it/2011/10/28/static-route-e-persistent-static-route-su-debian/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Fri, 28 Oct 2011 08:09:40 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[persistent]]></category>
		<category><![CDATA[persistent static route]]></category>
		<category><![CDATA[route]]></category>
		<category><![CDATA[static]]></category>
		<guid isPermaLink="false">http://blog.smsoft.it/?p=1553</guid>

					<description><![CDATA[La creazione di una rotta statica (static route) è una procedura che permette di instradare i pacchetti destinati ad una serie di IP, identificati con rete e netmask, tramite un gateway. Questa procedura viene generalmente fatta quando si hanno diversi gateway per diverse reti. Aggiungere manualmente una rotta (static route) è possibile con: [crayon-6a41e569464f0200344858/] dove ... <a title="Static route e Persistent static route su Debian" class="read-more" href="https://blog.smsoft.it/2011/10/28/static-route-e-persistent-static-route-su-debian/" aria-label="Per saperne di più su Static route e Persistent static route su Debian">Leggi tutto</a>]]></description>
										<content:encoded><![CDATA[<p>La creazione di una rotta statica (static route) è una procedura che permette di instradare i pacchetti destinati ad una serie di IP, identificati con rete e netmask, tramite un gateway.<br />
Questa procedura viene generalmente fatta quando si hanno diversi gateway per diverse reti. Aggiungere manualmente una rotta (<strong>static route</strong>) è possibile con:</p><pre class="urvanov-syntax-highlighter-plain-tag">~# route add -net 10.0.0.0 netmask 255.0.0.0 gw 192.168.0.2</pre><p>dove si inoltrano i pacchetti destinati alla rete <strong>10.0.0.0/255.0.0.0</strong> verso il gateway <strong>192.168.0.2</strong>. </p>
<p>Un altro esempio è quello di forzare l&#8217;uso di un&#8217;interfaccia di rete per una determinata classe IP/singolo IP, es:</p><pre class="urvanov-syntax-highlighter-plain-tag">~# route add -net 10.19.27.15 netmask 255.255.255.255 dev eth1:1</pre><p>facendo si che tutte le richieste verso l&#8217;IP <strong>10.19.27.15</strong> vengano fatte passare per l&#8217;interfaccia virtuale <strong>eth1:1<br />
</strong></p>
<p>Bisogna notare bene che le impostazioni attivate con questo comando, al riavvio vengono perse. Per far si che il sistema ricordi la rotta (<strong>persistent static route</strong>), basterà aggiungere un&#8217;opportuna direttiva nel file di configurazione delle interfacce di rete <strong>/etc/network/interfaces</strong>. Per ricreare la rotta di cui sopra, basterà inserire alla fine del file interfaces le righe:</p><pre class="urvanov-syntax-highlighter-plain-tag">up /sbin/route add -net 10.0.0.0 netmask 255.0.0.0 gw 192.168.0.2
down /sbin/route del -net 10.0.0.0 netmask 255.0.0.0</pre><p></p>
<p>Il file interfaces sarà quindi un qualcosa del genere:</p><pre class="urvanov-syntax-highlighter-plain-tag">auto eth0
iface eth0 inet static
  address 192.168.0.7
  netmask 255.255.255.0
  gateway 192.168.0.1
  up /sbin/route add -net 10.0.0.0 netmask 255.0.0.0 gw 192.168.0.2
  down /sbin/route del -net 10.0.0.0 netmask 255.0.0.0</pre><p>dove ovviamente il gateway predefinito è il 192.168.0.1 e per la sola rete 10.0.0.0/255.0.0.0 sarà il 192.168.0.2</p>
<p>Infine, per verificare che la rotta sia stata correttamente creata, oltre che un test con traceroute, si può usare il comando route come segue:</p><pre class="urvanov-syntax-highlighter-plain-tag">~# route -n</pre><p>e si vedrà qualcosa del genere:</p><pre class="urvanov-syntax-highlighter-plain-tag">Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
10.0.0.0        192.168.0.2     255.0.0.0       UG    0      0        0 eth0
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0</pre><p>enjoy!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.smsoft.it/2011/10/28/static-route-e-persistent-static-route-su-debian/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
