<?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>iptables and more on Linux &#187; networking</title>
	<atom:link href="http://iptables.gen.tr/category/networking/feed/" rel="self" type="application/rss+xml" />
	<link>http://iptables.gen.tr</link>
	<description>networking, tools in Linux and more...</description>
	<lastBuildDate>Wed, 16 Jun 2010 15:37:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>GRE tünel nasıl oluşturulur</title>
		<link>http://iptables.gen.tr/2010/06/gre-tunel-nasil-olusturulur/</link>
		<comments>http://iptables.gen.tr/2010/06/gre-tunel-nasil-olusturulur/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 16:35:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[networking]]></category>

		<guid isPermaLink="false">http://iptables.gen.tr/?p=164</guid>
		<description><![CDATA[Bu yazıda bir örnekle Linux altında nasıl GRE tünel oluşturacağımızı anlatmaya çalışacağım.
Birbirine Internet üzerinden erişebilen iki Linux cihaz düşünelim. (IP adresleri yine de Internet üzerinde kullanılmayan bloktan verilmiştir)
IP TANIMLARI
node1 (eth0 internet, eth1 iç ağa bakan kısım olsun)
eth0 : 192.168.200.150/24
eth1:  10.1.1.1/24
tunel arayuzu (tonode2): 172.16.151.1/30
node2 (eth0 internet, eth1 iç ağa bakan kısım olsun)
eth0:  10.10.10.150/24
eth1:  10.2.1.1/24
tunnel arayuzu (tonode1): [...]]]></description>
			<content:encoded><![CDATA[<p>Bu yazıda bir örnekle Linux altında nasıl GRE tünel oluşturacağımızı anlatmaya çalışacağım.</p>
<p>Birbirine Internet üzerinden erişebilen iki Linux cihaz düşünelim. (IP adresleri yine de Internet üzerinde kullanılmayan bloktan verilmiştir)</p>
<p><strong>IP TANIMLARI</strong></p>
<p><strong>node1</strong> (eth0 internet, eth1 iç ağa bakan kısım olsun)<br />
eth0 : 192.168.200.150/24<br />
eth1:  10.1.1.1/24<br />
tunel arayuzu (tonode2): 172.16.151.1/30</p>
<p><strong>node2</strong> (eth0 internet, eth1 iç ağa bakan kısım olsun)<br />
eth0:  10.10.10.150/24<br />
eth1:  10.2.1.1/24<br />
tunnel arayuzu (tonode1): 172.16.151.2/30</p>
<p>node1 ve node2 cihazlarının birbirlerine eth0 arayüzleri üzerinde Interneti kullanarak erişebildiğini düşünelim. Sırasıyla cihazları yapılandıralım.</p>
<p><span id="more-164"></span></p>
<p><strong>TUNEL YAPILANDIRMASI</strong></p>
<p><strong>node1)</strong></p>
<p>#modprobe ip_gre<br />
#ip tunnel add tonode2 mode gre remote 10.10.10.150 local 192.168.200.150<br />
#ip link set tonode2 up<br />
#ip addr add 172.16.151.1/30 dev tonode2</p>
<p><strong>node2)</strong></p>
<p>#modprobe ip_gre<br />
#ip tunnel add tonode1 mode gre remote 192.168.200.150 local 10.10.10.150<br />
#ip link set tonode1 up<br />
#ip addr add 172.16.151.1/30 dev tonode1</p>
<p>node1 üzerinde yaptıklarımızı anlatırsak:</p>
<ul>
<li>ip_gre modülünü yükledik</li>
<li>tonode2 adında bir tünel arayüzü yaratıp uç noktaları (yerel ve uzaktaki adresler) belirledik</li>
<li>Tünel arayüzü ayağa kaldırdık</li>
<li>Tünelimize bir IP addresi verdik.</li>
</ul>
<p>Fakat henüz iç ağımıza giden trafiği tünele yönlendirmedik. Bunun için :</p>
<p><strong>node1)</strong></p>
<p>#ip route add 10.2.1.0/24 dev tonode2</p>
<p>Bu komutla 10.2.1.0/24 ağını tünelin diğer tarafına yönlendirmiş oluyoruz.</p>
<p><strong>node2)</strong></p>
<p>#ip route add 10.1.1.0/24 dev tonode1</p>
<p>Şimdi node2 üzerinden 10.1.1.1 adresine ping attığınızda cevap almanız gerekiyor. Alamıyorsanız bir yerde bir hata yapmış olmalı yada aradaki bağlantılarda bir sorun olması gerek.</p>
]]></content:encoded>
			<wfw:commentRss>http://iptables.gen.tr/2010/06/gre-tunel-nasil-olusturulur/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>vncserver configuration in redhat</title>
		<link>http://iptables.gen.tr/2010/01/vncserver-configuration-in-redhat/</link>
		<comments>http://iptables.gen.tr/2010/01/vncserver-configuration-in-redhat/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 22:51:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[networking]]></category>
		<category><![CDATA[vnc]]></category>

		<guid isPermaLink="false">http://iptables.gen.tr/?p=142</guid>
		<description><![CDATA[VNC server configuration is pretty straight forward in redhat. Here are the steps that you should complete in order to run a functional VNC server in a few minutes.
Our test user is : mert
1) Adjust /etc/sysconfig/vncservers config file as below:



VNCSERVERS=&#8221;2:mert&#8221;



2) Login to mert account and set vncpassword



[root@rh54-3 sysconfig]# su &#8211; mert
[mert@rh54-3 ~]$ vncpasswd
Password:
Verify:
[mert@rh54-3 ~]$



3) Start [...]]]></description>
			<content:encoded><![CDATA[<p>VNC server configuration is pretty straight forward in redhat. Here are the steps that you should complete in order to run a functional VNC server in a few minutes.</p>
<p><strong>Our test user is :</strong> mert</p>
<p><strong>1) </strong>Adjust /etc/sysconfig/vncservers config file as below:</p>
<table style="background-color: #87cefa; width: 336px; height: 24px;" border="0">
<tbody>
<tr>
<td>VNCSERVERS=&#8221;2:mert&#8221;</td>
</tr>
</tbody>
</table>
<p><strong>2)</strong> Login to mert account and set vncpassword</p>
<table style="background-color: #87cefa; width: 334px; height: 24px;" border="0">
<tbody>
<tr>
<td>[root@rh54-3 sysconfig]# <strong>su &#8211; mert</strong><br />
[mert@rh54-3 ~]$<strong> vncpasswd</strong><br />
Password:<br />
Verify:<br />
[mert@rh54-3 ~]$</td>
</tr>
</tbody>
</table>
<p><strong>3) </strong>Start vnc service and add it into the startup.</p>
<table style="background-color: #87cefa; width: 640px; height: 220px;" border="0">
<tbody>
<tr>
<td>[root@rh54-3 sysconfig]#<strong> /etc/init.d/vncserver start</strong><br />
Starting VNC server: 2:mert xauth:  creating new authority file /home/mert/.Xauthority</p>
<p>New &#8216;rh54-3.penguen.com:2 (mert)&#8217; desktop is rh54-3.penguen.com:2</p>
<p>Creating default startup script /home/mert/.vnc/xstartup<br />
Starting applications specified in /home/mert/.vnc/xstartup<br />
Log file is /home/mert/.vnc/rh54-3.penguen.com:2.log</p>
<p>[  OK  ]</p>
<p>[root@rh54-3 .vnc]# <strong>chkconfig vncserver on</strong></td>
</tr>
</tbody>
</table>
<p>However if you connect via VNC client now, you won&#8217;t see default GNOME but twm instead.</p>
<p>Open the file /home/mert/.vnc/xstartup and uncomment the following lines (remove the hash in front)</p>
<table style="background-color: #87cefa; width: 425px; height: 35px;" border="0">
<tbody>
<tr>
<td>#unset SESSION_MANAGER<br />
#exec /etc/X11/xinit/xinitrc</td>
</tr>
</tbody>
</table>
<p>Restart VNC server to have the new changes affected.</p>
<table style="background-color: #87cefa; width: 580px; height: 24px;" border="0">
<tbody>
<tr>
<td>[root@rh54-3 .vnc]# <strong>/etc/init.d/vncserver restart</strong><br />
Shutting down VNC server: 2:mert                           [  OK  ]<br />
Starting VNC server: 2:mert<br />
New &#8216;rh54-3.penguen.com:2 (mert)&#8217; desktop is rh54-3.penguen.com:2</p>
<p>Starting applications specified in /home/mert/.vnc/xstartup<br />
Log file is /home/mert/.vnc/rh54-3.penguen.com:2.log</p>
<p>[  OK  ]</td>
</tr>
</tbody>
</table>
<p><a href="http://iptables.gen.tr/wp-content/uploads/2010/01/vnc_connect.png"><br />
</a><strong>4) </strong>Below is a step by step login into VNC server from my windows OS</p>
<p>a) connection screen</p>
<p><a href="http://iptables.gen.tr/wp-content/uploads/2010/01/vnc_connect.png"><img class="alignnone size-full wp-image-144" title="vnc_connect" src="http://iptables.gen.tr/wp-content/uploads/2010/01/vnc_connect.png" alt="" width="342" height="129" /></a></p>
<p>b) Password screen</p>
<p><a href="http://iptables.gen.tr/wp-content/uploads/2010/01/vnc_pass.png"><img class="alignnone size-full wp-image-145" title="vnc_pass" src="http://iptables.gen.tr/wp-content/uploads/2010/01/vnc_pass.png" alt="" width="370" height="101" /></a></p>
<p>c) GNOME screen</p>
<p><a href="http://iptables.gen.tr/wp-content/uploads/2010/01/vnc_gnome.png"><img class="alignnone size-large wp-image-146" title="vnc_gnome" src="http://iptables.gen.tr/wp-content/uploads/2010/01/vnc_gnome-1024x787.png" alt="" width="567" height="435" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://iptables.gen.tr/2010/01/vncserver-configuration-in-redhat/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Interface bonding</title>
		<link>http://iptables.gen.tr/2010/01/interface-bonding/</link>
		<comments>http://iptables.gen.tr/2010/01/interface-bonding/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 20:40:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[networking]]></category>
		<category><![CDATA[bonding]]></category>

		<guid isPermaLink="false">http://iptables.gen.tr/?p=131</guid>
		<description><![CDATA[As network cards or links may fail, we may solve this problem by creating multiple links to our network devices. One way is interface bonding which we will configure one in our example.  I assume that your linux have three interfaces eth0,eth1 and eth2. We will use two of the interfaces;
Slave Interfaces : eth1 and [...]]]></description>
			<content:encoded><![CDATA[<p>As network cards or links may fail, we may solve this problem by creating multiple links to our network devices. One way is interface bonding which we will configure one in our example.  I assume that your linux have three interfaces eth0,eth1 and eth2. We will use two of the interfaces;</p>
<p>Slave Interfaces : eth1 and eth2<br />
Bonding interface: bond0</p>
<p><strong>1) </strong>First add the followings into /etc/modprobe.conf file to provide module paramaters:</p>
<table style="background-color: #87cefa; width: 410px; height: 24px;" border="0">
<tbody>
<tr>
<td><strong>alias bond0 bonding<br />
options bond0 mode=active-backup  miimon=100</strong></td>
</tr>
</tbody>
</table>
<p>With this configuration, we use active backup mode. By that, if the primary interface goes down for some reason, bonding system will fail over into the other interface. If you want to use round robin load balancing which will enable to use both interfaces actively use &#8220;<strong>balanced_rr</strong>&#8221; instead of &#8220;<strong>active-backup</strong>&#8221;</p>
<p><strong>2) </strong>Configure slave and bonding interfaces.</p>
<p><strong><br />
</strong></p>
<table style="background-color: #87cefa; width: 445px; height: 102px;" border="0">
<tbody>
<tr>
<td><strong>/etc/sysconfig/network-scripts/ifcfg-eth1</strong></p>
<p>DEVICE=eth1<br />
BOOTPROTO=static<br />
ONBOOT=yes<br />
HWADDR=00:0c:29:47:49:8d<br />
MASTER=bond0<br />
SLAVE=yes</td>
</tr>
</tbody>
</table>
<table style="background-color: #87cefa; width: 445px; height: 99px;" border="0">
<tbody>
<tr>
<td><strong>/etc/sysconfig/network-scripts/ifcfg-eth2</strong></p>
<p>DEVICE=eth2<br />
BOOTPROTO=static<br />
ONBOOT=yes<br />
HWADDR=00:0c:29:47:49:97<br />
MASTER=bond0<br />
SLAVE=yes</td>
</tr>
</tbody>
</table>
<p><strong>/etc/sysconfig/network-scripts/ifcfg-bond0</strong></p>
<table style="background-color: #87cefa; width: 437px; height: 93px;" border="0">
<tbody>
<tr>
<td>DEVICE=bond0<br />
BOOTPROTO=static<br />
ONBOOT=yes<br />
IPADDR=10.0.0.230<br />
NETMASK=255.255.255.0<br />
BROADCAST=10.0.0.255</td>
</tr>
</tbody>
</table>
<p><strong>3)</strong> Now bring up the bonding interface and look at &#8220;ip addr&#8221; output</p>
<p>#ifup bond0</p>
<table style="background-color: #87cefa; width: 681px; height: 220px;" border="0">
<tbody>
<tr>
<td>#ip addr</p>
<p>3: <strong>eth1</strong>: &lt;NO-CARRIER,BROADCAST,MULTICAST,SLAVE,UP&gt; mtu 1500 qdisc pfifo_fast master bond0 qlen 1000<br />
link/ether <strong>00:0c:29:47:49:8d</strong> brd ff:ff:ff:ff:ff:ff<br />
4: <strong>eth2:</strong> &lt;BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast master bond0 qlen 1000<br />
link/ether <strong>00:0c:29:47:49:8d </strong>brd ff:ff:ff:ff:ff:ff<br />
inet 10.0.10.129/24 brd 10.0.10.255 scope global eth3<br />
9:<strong> bond0:</strong> &lt;BROADCAST,MULTICAST,MASTER,UP,LOWER_UP&gt; mtu 1500 qdisc noqueue<br />
link/ether 00:0c:29:47:49:8d brd ff:ff:ff:ff:ff:ff<br />
inet 10.0.0.230/24 brd 10.0.0.255 scope global bond0</td>
</tr>
</tbody>
</table>
<p>You might have noticed that both eth1 and eth2 use the same MAC address which actually what we expect and how it works.</p>
<p>In order to see the bonding status and current active slave interface, issue the following;</p>
<table style="background-color: #87cefa; width: 495px; height: 24px;" border="0">
<tbody>
<tr>
<td>[root@rh54]# <strong>cat /proc/net/bonding/bond0</strong><br />
Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)</p>
<p>Bonding Mode: fault-tolerance (active-backup)<br />
Primary Slave: None<br />
Currently Active Slave: eth2<br />
MII Status: up<br />
MII Polling Interval (ms): 100<br />
Up Delay (ms): 0<br />
Down Delay (ms): 0</p>
<p>Slave Interface: eth1<br />
MII Status: down<br />
Link Failure Count: 1<br />
Permanent HW addr: <strong>00:0c:29:47:49:8d</strong></p>
<p>Slave Interface: eth2<br />
MII Status: up<br />
Link Failure Count: 0<br />
Permanent HW addr: <strong>00:0c:29:47:49:97</strong></td>
</tr>
</tbody>
</table>
<p>Here you can see the real mac addresseses of the interfaces.</p>
<p><strong>4) Fail over test</strong></p>
<p>You can actually test how fail over works. In my vmware test system, I have disconnected eth1 and active slave (eth1)  failed over into eth2 at around 3 secs. (I was pinging at the same time) It switches over quite fast but what I have realized is, system keeps the previous mac address even though the interface having that MAC failed. For example in my setup (according to the previous bond0 output), eth1 is failed and eth2 is active slave however other nodes in the network know my 10.0.0.230 IP of having 00:0c:29:47:49:8d MAC. It is quite reasonable indeed. We don&#8217;t have to change mac and send unnecessary gratitous arp requests. Once one of your interfaces goes down in your bonding you will see a similar output in your dmesg.</p>
<table style="background-color: #87cefa; width: 511px; height: 24px;" border="0">
<tbody>
<tr>
<td><strong>eth1: link down<br />
bonding: bond0: link status definitely down for interface eth1, disabling it<br />
bonding: bond0: making interface eth2 the new active one.</strong></td>
</tr>
</tbody>
</table>
<p>That is all for this article, please drop your comments if you have anything to add or questions.</p>
<p>You can find quite a lot of information about bonding at the following address. I recommend you to read it</p>
<p><a href="http://www.linuxfoundation.org/collaborate/workgroups/networking/bonding" target="_blank">http://www.linuxfoundation.org/collaborate/workgroups/networking/bonding</a></p>
]]></content:encoded>
			<wfw:commentRss>http://iptables.gen.tr/2010/01/interface-bonding/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Permanent routes in Redhat</title>
		<link>http://iptables.gen.tr/2010/01/permanent-routes-in-redhat/</link>
		<comments>http://iptables.gen.tr/2010/01/permanent-routes-in-redhat/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 11:31:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[networking]]></category>

		<guid isPermaLink="false">http://iptables.gen.tr/?p=78</guid>
		<description><![CDATA[I was trying to find out how I can add a permanent route into Redhat so that after the reboot routes should persist. I have found the way but I must say that I really didn&#8217;t like it:( I liked the way Gentoo does it or Slackware but Redhat&#8217;s way seems to be too simplistic [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to find out how I can add a permanent route into Redhat so that after the reboot routes should persist. I have found the way but I must say that I really didn&#8217;t like it:( I liked the way Gentoo does it or Slackware but Redhat&#8217;s way seems to be too simplistic but it causes more work. Here is how it works;</p>
<p>It is sufficient to add your routes into the file /etc/sysconfig/network-scripts/route-ethX. Replace X with your interface number. For example;</p>
<p>In /etc/sysconfig/network-scripts/route-eth0, I have added the following routes to make them permanent.</p>
<table style="background-color: #87cefa; width: 417px; height: 104px;" border="0">
<tbody>
<tr>
<td>ADDRESS0=10.0.0.222<br />
NETMASK0=255.255.255.255<br />
GATEWAY0=192.168.200.81</p>
<p>ADDRESS1=10.0.0.223<br />
NETMASK1=255.255.255.255<br />
GATEWAY1=192.168.200.79</td>
</tr>
</tbody>
</table>
<p>Each time you need another route, you must just increment each variable by one, then route will stay in routing table after the reboot.</p>
<p>You may be asking why we don&#8217;t/can&#8217;t add the route into rc.local or somewhere else. IMHO, it is best practice to use the tools provided by the distribution so that if another engineer needs to take a look into the system, he will know for sure where to look.</p>
]]></content:encoded>
			<wfw:commentRss>http://iptables.gen.tr/2010/01/permanent-routes-in-redhat/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
