<?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</title>
	<atom:link href="http://iptables.gen.tr/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>SSH timeout</title>
		<link>http://iptables.gen.tr/2010/05/ssh-timeout/</link>
		<comments>http://iptables.gen.tr/2010/05/ssh-timeout/#comments</comments>
		<pubDate>Tue, 04 May 2010 11:03:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[gnu/linux]]></category>

		<guid isPermaLink="false">http://iptables.gen.tr/?p=162</guid>
		<description><![CDATA[If you have a problem of frequent disconnection from your SSH server, you can enable the following setting in your sshd_config file and restart SSHD.



ClientAliveInterval 60



The exact description of what this does is



ClientAliveInterval
Sets a timeout interval in seconds after which if no data has
been received from the client, sshd will send a message through
the encrypted [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a problem of frequent disconnection from your SSH server, you can enable the following setting in your sshd_config file and restart SSHD.</p>
<table style="background-color: #87cefa; width: 456px; height: 29px;" border="0">
<tbody>
<tr>
<td>ClientAliveInterval 60</td>
</tr>
</tbody>
</table>
<p>The exact description of what this does is</p>
<table style="background-color: #87cefa; width: 456px; height: 131px;" border="0">
<tbody>
<tr>
<td>ClientAliveInterval<br />
Sets a timeout interval in seconds after which if no data has<br />
been received from the client, sshd will send a message through<br />
the encrypted channel to request a response from the client.<br />
The default is 0, indicating that these messages will not be<br />
sent to the client.  This option applies to protocol version 2<br />
only.</td>
</tr>
</tbody>
</table>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;;">SPBCHSW81</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;;">SPBCHSW82</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;;">SPBCHSW91</span></p>
</div>
<p><span style="font-size: 10pt; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;;">SPBCHSW92</span></div>
]]></content:encoded>
			<wfw:commentRss>http://iptables.gen.tr/2010/05/ssh-timeout/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>Screen command</title>
		<link>http://iptables.gen.tr/2010/01/screen-command/</link>
		<comments>http://iptables.gen.tr/2010/01/screen-command/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 21:53:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[gnu/linux]]></category>

		<guid isPermaLink="false">http://iptables.gen.tr/?p=135</guid>
		<description><![CDATA[I hadn&#8217;t used screen much in the past but I see that it is a very handy tool. I just would like to add some tips about screen command.



Ctrl-a c : creates a new screen shell
Ctrl-a TAB: switches focues between upper and lower split terminal
Ctrl-a &#8220; : Display a list of managed windows. (This is [...]]]></description>
			<content:encoded><![CDATA[<p>I hadn&#8217;t used screen much in the past but I see that it is a very handy tool. I just would like to add some tips about screen command.</p>
<table style="background-color: #87cefa; width: 459px; height: 24px;" border="0">
<tbody>
<tr>
<td><strong>Ctrl-a c </strong>: creates a new screen shell<br />
<strong>Ctrl-a TAB</strong>: switches focues between upper and lower split terminal<br />
<strong>Ctrl-a &#8220;</strong> : Display a list of managed windows. (This is the most I like:)</td>
</tr>
</tbody>
</table>
<p>It is very useful to use the option &#8220;-t&#8221; in screen as it allows you to mark your instances. If you run a new screen sheel with the command;</p>
<table style="background-color: #87cefa; width: 463px; height: 24px;" border="0">
<tbody>
<tr>
<td><strong>screen -t /var/log/local6 1 tail -f /var/log/local6</strong></td>
</tr>
</tbody>
</table>
<p>Then when you run <strong>Ctrl-a &#8220;</strong> to list the windows, you will recognize your tailing window with the title &#8220;/var/log/local6&#8243;</p>
<p>This is a very short article about screen. I hope on the way I use this tool, I may improve this it.</p>
]]></content:encoded>
			<wfw:commentRss>http://iptables.gen.tr/2010/01/screen-command/feed/</wfw:commentRss>
		<slash:comments>0</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>sysconfig.txt</title>
		<link>http://iptables.gen.tr/2010/01/sysconfig-txt/</link>
		<comments>http://iptables.gen.tr/2010/01/sysconfig-txt/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 16:31:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[gnu/linux]]></category>

		<guid isPermaLink="false">http://iptables.gen.tr/?p=109</guid>
		<description><![CDATA[You can find quite a lot of files in /etc/sysconfig however in configuring them you may have trouble but there is a file that you can use to understand what attributes you can use for each file. It is sysconfig.txt. In my current Redhat 5.4 system the file is at the following location as it [...]]]></description>
			<content:encoded><![CDATA[<p>You can find quite a lot of files in /etc/sysconfig however in configuring them you may have trouble but there is a file that you can use to understand what attributes you can use for each file. It is sysconfig.txt. In my current Redhat 5.4 system the file is at the following location as it comes with the package initscripts.</p>
<table style="background-color: #87cefa; width: 371px; height: 24px;" border="0">
<tbody>
<tr>
<td><strong>/usr/share/doc/initscripts-8.45.30/sysconfig.txt</strong></td>
</tr>
</tbody>
</table>
<p>For example if you want to set ethernet options into your ifcfg-eth0 file below is the quote from this file;</p>
<table style="background-color: #87cefa; width: 485px; height: 24px;" border="0">
<tbody>
<tr>
<td><strong>ETHTOOL_OPTS</strong>=&#8230;<br />
Any device-specific options supported by ethtool. For example,<br />
if you wanted to force 100Mb full duplex:<br />
ETHTOOL_OPTS=&#8221;speed 100 duplex full autoneg off&#8221;<br />
Note that changing speed or duplex settings almost always<br />
requires disabling autonegotiation with &#8216;autoneg off&#8217;.</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://iptables.gen.tr/2010/01/sysconfig-txt/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing RPM file into a different root</title>
		<link>http://iptables.gen.tr/2010/01/installing-rpm-file-into-a-different-root/</link>
		<comments>http://iptables.gen.tr/2010/01/installing-rpm-file-into-a-different-root/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 14:59:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[gnu/linux]]></category>

		<guid isPermaLink="false">http://iptables.gen.tr/?p=101</guid>
		<description><![CDATA[One day you may have to install an RPM file into a different root folder. For example under rescue mode though you can chroot as an option. Here is the handy option for you to do it.



#rpm -ivh zip-2.31-2.el5.i386.rpm &#8211;root /mnt/sysimage



]]></description>
			<content:encoded><![CDATA[<p>One day you may have to install an RPM file into a different root folder. For example under rescue mode though you can chroot as an option. Here is the handy option for you to do it.</p>
<table style="background-color: #87cefa; width: 486px; height: 24px;" border="0">
<tbody>
<tr>
<td><strong>#rpm -ivh zip-2.31-2.el5.i386.rpm &#8211;root /mnt/sysimage</strong></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://iptables.gen.tr/2010/01/installing-rpm-file-into-a-different-root/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MBR recovery and grub reinstall</title>
		<link>http://iptables.gen.tr/2010/01/mbr-recovery-and-grub-reinstall/</link>
		<comments>http://iptables.gen.tr/2010/01/mbr-recovery-and-grub-reinstall/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 14:10:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[gnu/linux]]></category>
		<category><![CDATA[grub]]></category>

		<guid isPermaLink="false">http://iptables.gen.tr/?p=99</guid>
		<description><![CDATA[In the event that partition table is corrupted or boot loader has gone, here are some steps that you can take in order to boot the system as normal.
I hope that you have taken the backup of partition table previously with the command;



#sfdisk -d /dev/sda &#62; /root/sda_partition_table.out



Or if you also want to backup the whole [...]]]></description>
			<content:encoded><![CDATA[<p>In the event that partition table is corrupted or boot loader has gone, here are some steps that you can take in order to boot the system as normal.</p>
<p>I hope that you have taken the backup of partition table previously with the command;</p>
<table style="background-color: #87cefa; width: 422px; height: 24px;" border="0">
<tbody>
<tr>
<td>#<strong>sfdisk -d /dev/sda &gt; /root/sda_partition_table.out</strong></td>
</tr>
</tbody>
</table>
<p>Or if you also want to backup the whole MBR to a file do this;</p>
<table style="background-color: #87cefa; width: 423px; height: 24px;" border="0">
<tbody>
<tr>
<td><strong>#dd if=/dev/sda of=/tmp/mbr_sda.out bs=512 count=1</strong></td>
</tr>
</tbody>
</table>
<p>From now on, I assume that you have booted the system in rescue mode with networking support.</p>
<p>1) The first thing is to paste this partition table back into its original space. Presumably, you have copied the partition table from network and put it under /tmp/sda_partition_table.out</p>
<table style="background-color: #87cefa; width: 428px; height: 24px;" border="0">
<tbody>
<tr>
<td><strong>#sfdisk /dev/sda &lt;  /tmp/sda_partition_table.out</strong></td>
</tr>
</tbody>
</table>
<p>This will fix your partition table. Now time to fix MBR</p>
<p>2) As the MBR has gone, we have to write MBR again. Do the followings;</p>
<table style="background-color: #87cefa; width: 430px; height: 24px;" border="0">
<tbody>
<tr>
<td><strong>#grub</strong></p>
<p><strong>grub&gt; root (hd0,0)<br />
grub&gt;setup (hd0)<br />
grub&gt;quit</strong></td>
</tr>
</tbody>
</table>
<p>The root (hd0,0) command assumes that your boot partition is in /dev/sda1</p>
<p>After these commands, you should be able to boot your system as before.</p>
]]></content:encoded>
			<wfw:commentRss>http://iptables.gen.tr/2010/01/mbr-recovery-and-grub-reinstall/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to use LVM in rescue mode</title>
		<link>http://iptables.gen.tr/2010/01/how-to-use-lvm-in-rescue-mode/</link>
		<comments>http://iptables.gen.tr/2010/01/how-to-use-lvm-in-rescue-mode/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 13:55:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[storage]]></category>
		<category><![CDATA[lvm]]></category>

		<guid isPermaLink="false">http://iptables.gen.tr/?p=97</guid>
		<description><![CDATA[One day it may happen to you that either MBR is corrupted or partition table has gone then you will need rescue mode. However there is one problem,  what if you use LVM in your system. Because redhat does everything for us we don&#8217;t actually know what it does for initialization unless you have looked [...]]]></description>
			<content:encoded><![CDATA[<p>One day it may happen to you that either MBR is corrupted or partition table has gone then you will need rescue mode. However there is one problem,  what if you use LVM in your system. Because redhat does everything for us we don&#8217;t actually know what it does for initialization unless you have looked inside the init scripts.</p>
<p>In my rescue environment when I issue &#8220;lvm vgdisplay&#8221; , I was able to display the configuration but there was no device files under /dev. To overcome this problem do the followings:</p>
<table style="background-color: #87cefa; width: 436px; height: 24px;" border="0">
<tbody>
<tr>
<td><strong>#lvm vgscan</strong><br />
<strong>#lvm vgchange -ay</strong></td>
</tr>
</tbody>
</table>
<p>The first command &#8220;vgscan&#8221; scans all disks for volume groups and the second one &#8220;vgchange&#8221; makes the logical volumes known to the kernel. To deactivate you should but &#8220;n&#8221; instead of &#8220;y&#8221; on the command line.</p>
<p>Now you can access logical volumes.</p>
]]></content:encoded>
			<wfw:commentRss>http://iptables.gen.tr/2010/01/how-to-use-lvm-in-rescue-mode/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SELinux tools</title>
		<link>http://iptables.gen.tr/2010/01/selinux-tools/</link>
		<comments>http://iptables.gen.tr/2010/01/selinux-tools/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 18:34:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[security]]></category>
		<category><![CDATA[selinux]]></category>

		<guid isPermaLink="false">http://iptables.gen.tr/?p=95</guid>
		<description><![CDATA[As SELinux is a bit of complicated compared to the tools that we use currently, I have thought it is good to have some tips here.
1) seinfo: This is the selinux query tool to see statistics about your policy.



[root@rh54-3 ~]# seinfo 
Statistics for policy file: /etc/selinux/targeted/policy/policy.21
Policy Version &#38; Type: v.21 (binary, MLS)
Classes:            61    Permissions:       220
Types:            [...]]]></description>
			<content:encoded><![CDATA[<p>As SELinux is a bit of complicated compared to the tools that we use currently, I have thought it is good to have some tips here.</p>
<p>1) <strong>seinfo:</strong> This is the selinux query tool to see statistics about your policy.</p>
<table style="background-color: #87cefa; width: 505px; height: 24px;" border="0">
<tbody>
<tr>
<td>[root@rh54-3 ~]# <strong>seinfo </strong></p>
<p>Statistics for policy file: /etc/selinux/targeted/policy/policy.21<br />
Policy Version &amp; Type: v.21 (binary, MLS)</p>
<p>Classes:            61    Permissions:       220<br />
Types:            1710    Attributes:        161<br />
Users:               3    Roles:               6<br />
Booleans:          242    Cond. Expr.:       222<br />
Sensitivities:       1    Categories:       1024<br />
Allow:          116810    Neverallow:          0<br />
Auditallow:         41    Dontaudit:        6778<br />
Role allow:          5    Role trans:          0<br />
Type_trans:       1886    Type_change:         0<br />
Type_member:         0    Range_trans:       317<br />
Constraints:        47    Validatetrans:       0<br />
Fs_use:             18    Genfscon:           74<br />
Portcon:           323    Netifcon:</td>
</tr>
</tbody>
</table>
<p>2)<strong> sesearch:</strong> This is a very handy tool. When I started using SELinux, I was thinking that processes with a specific type are only allowed to make operations of the same type:) how stupid I am. Then I have seen by experience that policy can defines it and to see what a source can do, we can use sesearch. For example to search for httpd_t type source in order to see in which types it is associated with issue the following;</p>
<table style="background-color: #87cefa; width: 677px; height: 24px;" border="0">
<tbody>
<tr>
<td>[root@rh54-3 ~]#<strong> sesearch -s httpd_t -c file &#8211;allow</strong><br />
Found 103 av rules:<br />
allow httpd_t etc_runtime_t : file { ioctl read getattr lock };<br />
allow httpd_t httpd_var_lib_t : file { ioctl read write create getattr setattr lock append unlink link rename };<br />
allow httpd_t httpd_var_run_t : file { ioctl read write create getattr setattr lock append unlink link rename };<br />
allow httpd_t httpd_sys_content_t : file { ioctl read getattr lock };<br />
allow httpd_t public_content_rw_t : file { ioctl read getattr lock };<br />
allow httpd_t httpd_bugzilla_htaccess_t : file { ioctl read getattr lock };<br />
allow httpd_t mailman_data_t : file { ioctl read getattr lock };<br />
allow httpd_t httpd_cvs_htaccess_t : file { ioctl read getattr lock };<br />
allow httpd_t httpd_sys_htaccess_t : file { ioctl read getattr lock };<br />
allow httpd_t squirrelmail_spool_t : file { ioctl read write create getattr setattr lock append unlink link rename };<br />
allow httpd_t httpd_prewikka_htaccess_t : file { ioctl read getattr lock };<br />
allow httpd_t locale_t : file { ioctl read getattr lock };<br />
allow httpd_t var_auth_t : file { ioctl read write create getattr setattr lock append unlink link rename };<br />
allow httpd_t etc_t : file { ioctl read getattr lock };<br />
allow httpd_t fonts_t : file { ioctl read getattr lock };<br />
allow httpd_t ld_so_t : file { ioctl read getattr lock execute };<br />
allow httpd_t proc_t : file { ioctl read getattr lock };<br />
allow httpd_t sysfs_t : file { ioctl read getattr lock };<br />
allow httpd_t krb5_keytab_t : file { ioctl read getattr lock };<br />
allow httpd_t httpd_config_t : file { ioctl read getattr lock };<br />
allow httpd_t udev_tbl_t : file { ioctl read getattr lock };<br />
allow httpd_t httpd_tmp_t : file { ioctl read write create getattr setattr lock append unlink link rename };<br />
allow httpd_t shell_exec_t : file { ioctl read getattr lock execute execute_no_trans };<br />
allow httpd_t cvs_data_t : file { ioctl read getattr lock };<br />
allow httpd_t httpd_helper_exec_t : file { read getattr execute };<br />
allow httpd_t ld_so_cache_t : file { ioctl read getattr lock };<br />
allow httpd_t httpd_squirrelmail_t : file { ioctl read write create getattr setattr lock append unlink link rename };<br />
allow httpd_t httpd_php_exec_t : file { read getattr execute };<br />
allow httpd_t httpd_nagios_htaccess_t : file { ioctl read getattr lock };<br />
allow httpd_t net_conf_t : file { ioctl read getattr lock };<br />
&#8230;</p>
<p>&#8230;</td>
</tr>
</tbody>
</table>
<p>3)<strong> Restorecon</strong></p>
<p>This is a very useful utility that allows you to restore types configured statically in the system. The only thing you should do is</p>
<table style="background-color: #87cefa; width: 489px; height: 24px;" border="0">
<tbody>
<tr>
<td><strong>#restorecon -R -v /data</strong></td>
</tr>
</tbody>
</table>
<p>However if your type is in /etc/selinux/targeted/contexts/customizable_types file then you have to add &#8220;<strong>-F</strong>&#8221; flag into the command, if you don&#8217;t nothing happens:)  As I have quoted text from Dan Walsh&#8217;s blog (RH engineer) , restorecon ignores these types and -F must be added.</p>
<ul>
<li><em>customizable_types </em>
<ul>
<li><em>These are a list of file types that restorecon will ignore.  So if you want to relabel your entire system using restorecon, and a file is labeled with a context in this file, the context will not be changed.  This can be overridden with the -F flag.  This allows you to specify special directories on your system as being readable by apache.  So if you chcon -R -t httpd_sys_content_t  /var/myhtml, a relabel will not change this directory tree back to var_t.</em></li>
</ul>
</li>
</ul>
<p>Selinux User Guide: <a href="http://docs.fedoraproject.org/selinux-user-guide/f12/en-US/index.html" target="_blank">http://docs.fedoraproject.org/selinux-user-guide/f12/en-US/index.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://iptables.gen.tr/2010/01/selinux-tools/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
