<?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>Unix Uptime</title>
	<atom:link href="http://unixuptime.com/forum/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://unixuptime.com/forum</link>
	<description>Unix is simple. It just takes a genius to understand its simplicity. - Dennis Ritchie</description>
	<lastBuildDate>Fri, 23 Mar 2012 13:27:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>exporting NFS shares behind firewall/iptables &#124; How to Methods.</title>
		<link>http://unixuptime.com/forum/?p=366</link>
		<comments>http://unixuptime.com/forum/?p=366#comments</comments>
		<pubDate>Tue, 03 Jan 2012 11:36:25 +0000</pubDate>
		<dc:creator>anuj</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://unixuptime.com/forum/?p=366</guid>
		<description><![CDATA[NFS daemon depends on portmapper which allocates random port to the nfs related daemons statd, mountd, lockd, and rquotad. Due to random allocation of ports (beside 2049/tcp,udp; 111/portmapper-sunrpc/tcp,udp) it&#8217;s not straight forward to have NFS server behind a firewall. However with new nfs-utils versions we can bind mountd,stad,lockd,rquotad to certain port numbers, on redhat we [...]]]></description>
			<content:encoded><![CDATA[<p>NFS daemon depends on portmapper which allocates random port to the nfs related daemons statd, mountd, lockd, and rquotad. Due to random allocation of ports (beside 2049/tcp,udp; 111/portmapper-sunrpc/tcp,udp) it&#8217;s not straight forward to have NFS server behind a firewall.</p>
<p>However with new nfs-utils versions we can bind mountd,stad,lockd,rquotad to certain port numbers, on redhat we can define port numbers in  /etc/sysconfig/nfs file and then simple iptables rules. For example, after modifying /etc/sysconfig/nfs I have</p>
<p><code>RQUOTAD_PORT=875<br />
LOCKD_TCPPORT=32803<br />
LOCKD_UDPPORT=32769<br />
MOUNTD_PORT=892</code></p>
<p>Other ports which needs to be opened on firewall are 111/tcp,udp for portmapper and 2049/tcp,udp for nfsd.</p>
<p>However this is not available with older version of nfs-utils, or different distributions of Linux. You can use the script below with small modifications in script starting the nfs daemon.</p>
<p>#!/bin/bash<br />
#script for adding iptables rules to support exporting NFS share<br />
#behind iptables firewall.</p>
<p>#get the port numbers<br />
PORTS=`rpcinfo -p | awk &#8216;$4 != &#8220;port&#8221; { print $4 }&#8217; | uniq | paste -sd,`</p>
<p>#function to check/create iptables chain NFS<br />
check_ipt () {<br />
	/sbin/iptables -L NFS >/dev/null 2>&#038;1 || /sbin/iptables -N NFS<br />
}</p>
<p>#function to insert iptables rules<br />
ins_rul () {<br />
/sbin/iptables -F NFS<br />
/sbin/iptables -I NFS 1 -m state &#8211;state NEW -p tcp -m multiport &#8211;dports $PORTS,2049,111 -j ACCEPT<br />
/sbin/iptables -I NFS 2 -m state &#8211;state NEW -p udp -m multiport &#8211;dports $PORTS,2049,111 -j ACCEPT<br />
#change below as per your need/iptables chain name.<br />
/sbin/iptables -R loc2fw 1 -j NFS<br />
}</p>
<p>check_ipt<br />
ins_rul</p>
<p>You can call this script from nfs startup script.</p>
<p><a href="http://www.unixuptime.com/nfs-iptables.sh">Download script</a></p>
<p>More options of securing NFS are available on <a href="http://www.tldp.org/HOWTO/NFS-HOWTO/security.html">TLDP</a> site.. </p>
<p>Anuj</p>
]]></content:encoded>
			<wfw:commentRss>http://unixuptime.com/forum/?feed=rss2&#038;p=366</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iptables &#8211; Unable to connect to remote host: No route to host &#8211; error &#124; how to fix.</title>
		<link>http://unixuptime.com/forum/?p=353</link>
		<comments>http://unixuptime.com/forum/?p=353#comments</comments>
		<pubDate>Tue, 03 Jan 2012 06:31:11 +0000</pubDate>
		<dc:creator>anuj</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://unixuptime.com/forum/?p=353</guid>
		<description><![CDATA[In case if you&#8217;ve selected to not not to disable firewall, and need allow some access on certain port, you quickly added one iptables rule to the firewall, for example allowing access to the portmapper port 111, or http port 80 etc, but when trying to get access of services on allowed port, you are [...]]]></description>
			<content:encoded><![CDATA[<p>In case if you&#8217;ve selected to not not to disable firewall, and need allow some access on certain port, you quickly added one iptables rule to the firewall, for example allowing access to the portmapper port 111, or http port 80 etc, but when trying to get access of services on allowed port, you are getting an error No route to host.<br />
For example, with the default iptables rules on redhat I have rules below:</p>
<pre>[root@node2 ~]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination        
RH-Firewall-1-INPUT  all  --  anywhere             anywhere            

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination        
RH-Firewall-1-INPUT  all  --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain RH-Firewall-1-INPUT (2 references)
target     prot opt source               destination        
ACCEPT     all  --  anywhere             anywhere           
ACCEPT     icmp --  anywhere             anywhere            icmp any
ACCEPT     esp  --  anywhere             anywhere           
ACCEPT     ah   --  anywhere             anywhere           
ACCEPT     udp  --  anywhere             224.0.0.251         udp dpt:mdns
ACCEPT     udp  --  anywhere             anywhere            udp dpt:ipp
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ipp
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited
[root@node2 ~]#</pre>
<p>Added one rule to allow access on port number 111(portmapper)</p>
<pre><code>iptables -I INPUT -p tcp --dport 111 -j ACCEPT</code></pre>
<p>After inserting rule in INPUT chain to allow access on port number 111, I have:</p>
<pre>[root@node2 ~]# iptables -L INPUT
Chain INPUT (policy ACCEPT)
target     prot opt source               destination        
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:sunrpc
RH-Firewall-1-INPUT  all  --  anywhere             anywhere           
[root@node2 ~]#</pre>
<p>It should allow access to port 111/tcp for all isn&#8217;t it? but still getting error of No Route to host error.</p>
<p>The reason behind is order or rules in iptables. Let&#8217;s check the line numbers of rules with:</p>
<pre>[root@node2 ~]# iptables -L --line-numbers
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination        
1    ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:sunrpc
2    RH-Firewall-1-INPUT  all  --  anywhere             anywhere            

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination        
1    RH-Firewall-1-INPUT  all  --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination         

Chain RH-Firewall-1-INPUT (2 references)
num  target     prot opt source               destination        
1    ACCEPT     all  --  anywhere             anywhere           
2    ACCEPT     icmp --  anywhere             anywhere            icmp any
3    ACCEPT     esp  --  anywhere             anywhere           
4    ACCEPT     ah   --  anywhere             anywhere           
5    ACCEPT     udp  --  anywhere             224.0.0.251         udp dpt:mdns
6    ACCEPT     udp  --  anywhere             anywhere            udp dpt:ipp
7    ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ipp
8    ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
9    ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh
10   REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited
[root@node2 ~]#</pre>
<p>To resolve this issue we have to insert our new rule in RH-Firewall-1-INPUT chain before rule number 10 (REJECT all  from anywhere to anywhere).</p>
<p>Let&#8217;s delete previously added rule to INPUT chain.</p>
<pre>[root@node2 ~]# iptables -D INPUT -p tcp --dport 111 -j ACCEPT</pre>
<p>And add a new rule to RH-Firewall-1-INPUT chain in correct order,</p>
<pre>[root@node2 ~]# iptables -I RH-Firewall-1-INPUT 10 -m state --state NEW -p tcp --dport 111 -j ACCEPT</pre>
<p>After adding new rule, listing of rules:</p>
<pre>[root@node2 ~]# iptables -L --line-numbers
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination        
1    RH-Firewall-1-INPUT  all  --  anywhere             anywhere            

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination        
1    RH-Firewall-1-INPUT  all  --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination         

Chain RH-Firewall-1-INPUT (2 references)
num  target     prot opt source               destination        
1    ACCEPT     all  --  anywhere             anywhere           
2    ACCEPT     icmp --  anywhere             anywhere            icmp any
3    ACCEPT     esp  --  anywhere             anywhere           
4    ACCEPT     ah   --  anywhere             anywhere           
5    ACCEPT     udp  --  anywhere             224.0.0.251         udp dpt:mdns
6    ACCEPT     udp  --  anywhere             anywhere            udp dpt:ipp
7    ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ipp
8    ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
9    ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh
10   ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:sunrpc
11   REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited
[root@node2 ~]#</pre>
<p>Note: in mangle state only NEW is sufficient as on rule line number 8 RELATED, ESTABLISHED is already added.  You should not get any error now,  you can change port number and protocol according to your needs.</p>
<p>There is an another method which is quite simple, you can use setup command on redhat and then select Firewall Configuration&gt; Customize&gt; Allow incoming and define ports you want to allow access on.</p>
<p><span>You can also use shorewall firewall which is an excellent tool of configuring iptables/gateway. (<a href="http://www.shorewall.net">http://www.shorewall.net</a>)</span></p>
<p>Anuj.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://unixuptime.com/forum/?feed=rss2&#038;p=353</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>gateway/firewall configuration GNU/Linux. (with VMWare and shorewall)</title>
		<link>http://unixuptime.com/forum/?p=343</link>
		<comments>http://unixuptime.com/forum/?p=343#comments</comments>
		<pubDate>Sun, 01 Jan 2012 20:13:52 +0000</pubDate>
		<dc:creator>anuj</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://unixuptime.com/forum/?p=343</guid>
		<description><![CDATA[Shorewall is a very nice tool for configuring iptables, and you can do many things easily such as port knocking, load balancing for your traffic among two ISP&#8217;s, fort forwarding, transparent proxy etc, for more information http://shorewall.net/shorewall_features.htm. There is no documentation yet for VMWare+shorewall, you may want to try the setup below. Usually big organizations [...]]]></description>
			<content:encoded><![CDATA[<p>Shorewall is a very nice tool for configuring iptables, and you can do many things easily such as port knocking, load balancing for your traffic among two ISP&#8217;s, fort forwarding, transparent proxy etc, for more information http://shorewall.net/shorewall_features.htm. There is no documentation yet for VMWare+shorewall, you may want to try the setup below.</p>
<p>Usually big organizations have hardware firewall and other measures, admin&#8217;s skip configuring firewall on servers, however we can follow individual firewall/device &#8211; a better practice.</p>
<p>Shorewall is available in binary packages (*.rpm, *.deb etc) as well as you can follow installation using source. To use installation using source you just have to run ./install.sh script from the extracted source tarball.</p>
<p>Here I am not going to run into all the setup&#8217;s, e.g. sharing traffic between two ISP&#8217;s, it would be just re-inventing the wheel, however the information here can give you enough fuel to have your own setup running, some port forwarding and masquerading of traffic as well.</p>
<p>So, what are the minimum files you need to have configured on the server? Files are /etc/shorewall/shorewall.conf (to start the shorewalll automatically at the boot time), and some files under /etc/shorewall directory (interfaces, zones, policy, rules and in case you want to masquerade traffic then masq).</p>
<p>In my setup, I want to forward traffic coming on network interfaces to different virtual machines(can be physical machines as well). I have one ethernet card eth0 (you should have two in case if you want to configure a gateway server), virtual network interface vmnet8 (should be replaced by eth1 in case of using physical server), and one more ISP (sometimes i use mobile phone to use internet).</p>
<p>Entries in configuration files:<br />
/etc/shorewall/interfaces (Define your interfaces)<br />
###############################################################################<br />
#ZONE	INTERFACE	BROADCAST	OPTIONS<br />
net 	         eth0         	detect<br />
nokia	         ppp0<br />
loc	        vmnet8	      172.16.249.255<br />
##############################################################################</p>
<p>File /etc/shorewall/zones<br />
###############################################################################<br />
#ZONE	TYPE		OPTIONS		IN			OUT<br />
#					OPTIONS			OPTIONS<br />
fw	        firewall<br />
loc	        ipv4<br />
nokia	        ipv4<br />
net	        ipv4<br />
##############################################################################</p>
<p>File /etc/shorewall/policy<br />
###############################################################################<br />
#SOURCE 	DEST	POLICY		LOG	        LIMIT:		CONNLIMIT:<br />
#				                                 LEVEL	BURST		MASK<br />
fw	                 all	        ACCEPT<br />
loc	                 nokia	ACCEPT<br />
loc	                 net	        ACCEPT<br />
loc	                 fw	         REJECT<br />
net	                 all	         REJECT<br />
all	                 all    	REJECT		info<br />
###############################################################################</p>
<p>File /etc/shorewall/masq<br />
#############################################################################################<br />
#INTERFACE:DEST		SOURCE		ADDRESS		PROTO	PORT(S)	IPSEC	MARK	USER/<br />
#											GROUP<br />
eth0			172.16.217.1/24<br />
ppp0			172.16.217.1/24<br />
#############################################################################################</p>
<p>And finally /etc/shorewall/rules file<br />
######################################################################################################################################################################################<br />
#ACTION		SOURCE		DEST		PROTO	DEST	SOURCE		ORIGINAL	RATE		USER/	MARK	CONNLIMIT	TIME         HEADERS         SWITCH<br />
#							PORT	PORT(S)		DEST		LIMIT		GROUP<br />
#SECTION BLACKLIST<br />
#SECTION ALL<br />
#SECTION ESTABLISHED<br />
#SECTION RELATED<br />
#SECTION NEW<br />
ACCEPT		loc		net		tcp	22,80,53,21,443<br />
ACCEPT		loc		net		udp	53<br />
DNAT		net		loc:172.16.217.128	tcp 22,80,443<br />
#########################################################################################	-	</p>
<p>Shorewall version i used is shorewall-4.4.27.tar.bz2, which is the current stable version while writing this post. It was observed that the VM&#8217;s getting IP with dhcp had default route set to 172.16.217.2, we have to change the default route of VM&#8217;s if DNAT is not working, i had to change default route to 172.16.217.1 on VMs to have port forwarding working.<br />
On debian lenny need to change one more parameter in /etc/default/shorewall file, which is &#8220;startup=1&#8243; and in /etc/shorewall/shorewall.conf &#8220;STARTUP_ENABLED=Yes&#8221;. Make sure that the net.ipv4.ip_forward is set to 1 (net.ipv4.ip_forward=1) in /etc/sysctlc.conf to allow packet forwarding (if you had to change this value then execute sysctl -p /etc/sysctl.conf) otherwise you can use echo 1 >/proc/sys/net/ipv4/ip_forward (for temporary purpose, after a reboot you again to set ip_forward to 1)</p>
<p>It&#8217;s time to start the shorewall, issue command &#8220;shorewall start&#8221; (it&#8217;s going to work on most of the linux distributions)</p>
<p>Shorewall is very nicely documented, available on http://www.shorewall.net/</p>
<p>Anuj, </p>
]]></content:encoded>
			<wfw:commentRss>http://unixuptime.com/forum/?feed=rss2&#038;p=343</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A New Year &#8211; 2012  &#8211; Jai Balaji Jai Ram Shri Ram Jai Jai Ram.</title>
		<link>http://unixuptime.com/forum/?p=331</link>
		<comments>http://unixuptime.com/forum/?p=331#comments</comments>
		<pubDate>Sun, 01 Jan 2012 13:20:47 +0000</pubDate>
		<dc:creator>anuj</dc:creator>
				<category><![CDATA[Anuj]]></category>

		<guid isPermaLink="false">http://unixuptime.com/forum/?p=331</guid>
		<description><![CDATA[Jai Hanuman!!]]></description>
			<content:encoded><![CDATA[<p>Jai Hanuman!!</p>
<p><iframe width="500" height="375" src="http://www.youtube.com/embed/pnsKYeSAs1U?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://unixuptime.com/forum/?feed=rss2&#038;p=331</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Forcefsck at boot time Linux with kernel parameter OR /forcefsck empty file. Fastboot options</title>
		<link>http://unixuptime.com/forum/?p=328</link>
		<comments>http://unixuptime.com/forum/?p=328#comments</comments>
		<pubDate>Fri, 30 Dec 2011 15:50:29 +0000</pubDate>
		<dc:creator>anuj</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://unixuptime.com/forum/?p=328</guid>
		<description><![CDATA[A usual way to force fsck at boot time is by creating an empty file &#8216;forcefsck&#8217; under root / [root@localhost ~]# touch /forcefsck Note: This option is going to force fsck only on those mount points which are having non-zero value set in the 6th filed of /etc/fstab file while skipping mount points which have [...]]]></description>
			<content:encoded><![CDATA[<p>A usual way to force fsck at boot time is by creating an empty file &#8216;forcefsck&#8217; under root /</p>
<p>[root@localhost ~]# touch /forcefsck</p>
<p>Note:<br />
This option is going to force fsck only on those mount points which are having non-zero value set in the 6th filed of /etc/fstab file while skipping mount points which have 6th field defined as 0.</p>
<p>What If you want to force fsck at the boot time without creating an empty file? Yes. there is an another method, at the boot time on grub screen pass kernel parameter forcefsck (the same way as you would have booted the server in run level 1 by passing S or 1)</p>
<p>How about skipping forcefsck? Sometimes you can get at login shell at fsck (not a good idea) while booting time, to skip you can pass kernel fastboot parameter at grub level, also you can skip forcefck by creating an empty file fastboot under the root /<br />
touch /fastboot</p>
<p>Anuj</p>
]]></content:encoded>
			<wfw:commentRss>http://unixuptime.com/forum/?feed=rss2&#038;p=328</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>extending space for root on LVM, IDE disk + scsi disk &#124; server not bootable issue</title>
		<link>http://unixuptime.com/forum/?p=310</link>
		<comments>http://unixuptime.com/forum/?p=310#comments</comments>
		<pubDate>Wed, 21 Dec 2011 07:27:25 +0000</pubDate>
		<dc:creator>anuj</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://unixuptime.com/forum/?p=310</guid>
		<description><![CDATA[In case of server was installed on IDE disk and root file system is on LVM, its not going to boot up after we add a new scsi disk to root LVM, Reason behind, disk driver for scsi device was not included (as during the installation no scsi disk) was added. Solution, create a new [...]]]></description>
			<content:encoded><![CDATA[<p>In case of server was installed on IDE disk and root file system is on LVM, its not going to boot up after we add a new scsi disk to root LVM,</p>
<p>Reason behind, disk driver for scsi device was not included (as during the installation no scsi disk) was added.</p>
<p>Solution,</p>
<p>create a new initial ram disk with,</p>
<p>mkinitrd /tmp/initrd-kernel-version kernel-version</p>
<p>(example: mkinitrd  -v  /tmp/initrd-2.6.18-194.el5 2.6.18-194.el5)<br />
Take a backup of existing initial ram disk.</p>
<p>cp -v /boot/initrd-2.6.18-194.el5.img{,.bak}</p>
<p>Now replace existing initial ram disk with newly created initrd image in tmp,</p>
<p>cp -v /tmp/initrd-2.6.18-194.el5 /boot/initrd-2.6.18-194.el5.img</p>
<p>In case if you already rebooted without creating a new initial ram disk, solution is to boot in resuce mode and follow above steps of modifying inital ram disk.</p>
<p>&nbsp;</p>
<p>Anuj</p>
]]></content:encoded>
			<wfw:commentRss>http://unixuptime.com/forum/?feed=rss2&#038;p=310</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sharing Laptop screen with TV/monitor &#8211; debian Linux &#8216;lenny(5.0.8)&#8217;</title>
		<link>http://unixuptime.com/forum/?p=302</link>
		<comments>http://unixuptime.com/forum/?p=302#comments</comments>
		<pubDate>Sun, 11 Dec 2011 14:38:47 +0000</pubDate>
		<dc:creator>anuj</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://unixuptime.com/forum/?p=302</guid>
		<description><![CDATA[To share laptop screen with some other monitor, install package lxrandr ( simple monitor config tool for LXDE). After connecting cables, check the available resolutions with: xrandr -q I got the information below on terminal: Screen 0: minimum 320 x 200, current 1280 x 800, maximum 2880 x 800 VGA connected 1280&#215;800+0+0 (normal left inverted [...]]]></description>
			<content:encoded><![CDATA[<p>To share laptop screen with some other monitor, install package lxrandr ( simple monitor config tool for LXDE).</p>
<p>After connecting cables, check the available resolutions with:<br />
xrandr -q</p>
<p>I got the information below on terminal:<br />
Screen 0: minimum 320 x 200, current 1280 x 800, maximum 2880 x 800<br />
VGA connected 1280&#215;800+0+0 (normal left inverted right x axis y axis) 0mm x 0mm<br />
1280&#215;800       60.0*+<br />
1280&#215;768       60.0<br />
1024&#215;768       60.0<br />
800&#215;600        60.3<br />
640&#215;480        59.9<br />
LVDS connected 1280&#215;800+0+0 (normal left inverted right x axis y axis) 331mm x 207mm<br />
1280&#215;800       60.0 +   60.0*<br />
1280&#215;768       60.0<br />
1024&#215;768       60.0<br />
800&#215;600        60.3<br />
640&#215;480        59.9<br />
TV disconnected (normal left inverted right x axis y axis)</p>
<p>Now the next step is to edit  /etc/X11/xorg.conf file (X Window System server configuration file), add the entries below under screen section:</p>
<p>SubSection &#8220;Display&#8221;<br />
Depth 24<br />
Modes &#8220;1280&#215;800&#8243; &#8220;1280&#215;768&#8243; &#8220;1440&#215;900&#8243; #the resolutions of your monitors<br />
Virtual 2880 800<br />
EndSubSection</p>
<p>Restart the X-server with alt+ctrl+back-space-key,</p>
<p>Now on terminal give command:<br />
xrandr &#8211;auto &#8211;output DVI-0 &#8211;mode 1280&#215;800 &#8211;right-of DVI-1</p>
<p>You should have display shared with an another monitor <img src='http://unixuptime.com/forum/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Anuj</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://unixuptime.com/forum/?feed=rss2&#038;p=302</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>increase swap space residing on LVM. or create a swap file.</title>
		<link>http://unixuptime.com/forum/?p=299</link>
		<comments>http://unixuptime.com/forum/?p=299#comments</comments>
		<pubDate>Fri, 09 Dec 2011 15:47:52 +0000</pubDate>
		<dc:creator>anuj</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://unixuptime.com/forum/?p=299</guid>
		<description><![CDATA[In case swap space is on LVM assuming we have enough free PE&#8217;s on our Volume Group VolGroup00, we can follow the method below. Let&#8217;s check the swap space in use: [root@localhost ~]# cat /proc/swaps Filename                                Type            Size    Used    Priority /dev/mapper/VolGroup00-LogVol00         partition       229368  0       1 [root@localhost ~]# Or use command &#8216;free -m&#8217; Disable the swap [...]]]></description>
			<content:encoded><![CDATA[<p>In case swap space is on LVM assuming we have enough free PE&#8217;s on our Volume Group VolGroup00, we can follow the method below.</p>
<ol>
<li>Let&#8217;s check the swap space in use:<br />
[root@localhost ~]# cat /proc/swaps<br />
Filename                                Type            Size    Used    Priority<br />
/dev/mapper/VolGroup00-LogVol00         partition       229368  0       1<br />
[root@localhost ~]#<br />
Or use command &#8216;free -m&#8217;</li>
<li>Disable the swap device with:<br />
[root@localhost ~]# swapoff /dev/VolGroup00/LogVol00<br />
[root@localhost ~]#</li>
<li>Increase the space of LVM with (depending on available Free PE&#8217;s and your choice).<br />
[root@localhost ~]# lvextend -L+352M /dev/VolGroup00/LogVol00<br />
Extending logical volume LogVol00 to 576.00 MB<br />
Logical volume LogVol00 successfully resized</li>
<li> Now we have to enable swap again, but before doing so we again need to format swap file system on extended lvm with:<br />
[root@localhost ~]# mkswap /dev/VolGroup00/LogVol00<br />
Setting up swapspace version 1, size = 603975 kB</li>
<li>Enable swap device with:<br />
swapon  -p 1 /dev/VolGroup00/LogVol00</li>
<li>Check swap space again with:<br />
[root@localhost ~]# cat /proc/swaps<br />
Filename                Type        Size    Used    Priority<br />
/dev/mapper/VolGroup00-LogVol00         partition    589816    0    1<br />
[root@localhost ~]#</p>
<p>in swapon command -p switch sets the priority of swap, higher the value, higher priority swap is used before using other lower priority swap space. Two swap devices or file can have same priority number (would be used in a round robin method). Every time we create a new swap file/device the priority allocated will be lower than previous(in case -p switch is not used).</li>
</ol>
<p>Other possible method which does not include lvm&#8217;s is to create a swap file, for example<br />
[root@localhost ~]# dd if=/dev/zero of=/var/swapspace bs=512 count=1048576<br />
1048576+0 records in<br />
1048576+0 records out<br />
536870912 bytes (537 MB) copied, 18.9145 seconds, 28.4 MB/s<br />
[root@localhost ~]# mkswap /var/swapspace<br />
Setting up swapspace version 1, size = 536866 kB<br />
[root@localhost ~]# swapon  -p 1 /var/swapspace<br />
[root@localhost ~]# cat /proc/swaps<br />
Filename                                Type            Size    Used    Priority<br />
/dev/mapper/VolGroup00-LogVol00         partition       589816  0       1<br />
/var/swapspace                          file            524280  0       1<br />
[root@localhost ~]#</p>
<p>Make persistent swap file availability with making an entry in /etc/fstab file:<br />
[root@localhost ~]# echo &#8216;/var/swapspace swap swap defaults 0 0 &#8216; &gt;&gt;/etc/fstab</p>
<p>Anuj <img src='http://unixuptime.com/forum/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://unixuptime.com/forum/?feed=rss2&#038;p=299</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>share internet access from a VM with host and all other VM&#8217;s</title>
		<link>http://unixuptime.com/forum/?p=295</link>
		<comments>http://unixuptime.com/forum/?p=295#comments</comments>
		<pubDate>Tue, 06 Dec 2011 15:46:43 +0000</pubDate>
		<dc:creator>anuj</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://unixuptime.com/forum/?p=295</guid>
		<description><![CDATA[Generally all VM&#8217;s can access Internet in case host is able to reach public IP&#8217;s, however i wanted to use some data card with my debian, a quick way to do the same is, have ubuntu guest running on your debian host. Disable dhcp and give static ip of same subnet to eth0 on ubuntu, [...]]]></description>
			<content:encoded><![CDATA[<p>Generally all VM&#8217;s can access Internet in case host is able to reach public IP&#8217;s, however i wanted to use some data card with my debian, a quick way to do the same is, have ubuntu guest running on your debian host.</p>
<p>Disable dhcp and give static ip of same subnet to eth0 on ubuntu, leave the gateway entry blank for eth0, it&#8217;s very very simple to have most of the data card running on ubuntu, attach USB port to the ubuntu VM after inserting data card (it&#8217;s a different topic, here i am just sharing information of using Internet access from a VM with other VM&#8217;s and host).</p>
<p>Once the data card is configured on Ubuntu VM, check default route/ping some external domain/ip etc to make sure that the VM is able to access Internet using data card. There are different methods such as check /var/log/messages, ifconfig -a, etc.</p>
<p>Ok once the Internet is working on Ubuntu VM, let&#8217;s do simple work of masqurading with iptables, however first we have to enable ip forwarding, either you can make it permanent with modifying /etc/sysctl.conf (uncomment net.ipv4.ip_forward=1) and give command sysctl -p /etc/sysctl.conf OR echo 1 &gt;/proc/sys/net/ipv4/ip_forward</p>
<p>Let&#8217;s configure iptables to forward packets from VMWare Host and other vm&#8217;s.</p>
<p>/sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE</p>
<p>now use ip of ubuntu vm as a gateway, modify /etc/resolv.conf if needed.</p>
<p> <img src='http://unixuptime.com/forum/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<pre><code>
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://unixuptime.com/forum/?feed=rss2&#038;p=295</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nokia E6 mobile phone on Linux &#8211; internet access using data cable &#8211; airtel</title>
		<link>http://unixuptime.com/forum/?p=290</link>
		<comments>http://unixuptime.com/forum/?p=290#comments</comments>
		<pubDate>Thu, 17 Nov 2011 07:31:50 +0000</pubDate>
		<dc:creator>anuj</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://unixuptime.com/forum/?p=290</guid>
		<description><![CDATA[How to use Nokia E6 mobile phone as a modem on Debian Linux? Requirement: Nokia E6 (:P indeed) Data cable Should have wvdial installed (on debian lenny) which  depends on: libuniconf libwvstreams libwvstreams libxplc ppp wvdial_1.60.1+nmu2_i386.deb&#160; If your debian is already on network then use tasksel to have dependencies resolved automatically. After connecting data cable [...]]]></description>
			<content:encoded><![CDATA[<p>How to use Nokia E6 mobile phone as a modem on Debian Linux?</p>
<ul>
<li>Requirement:</li>
</ul>
<ul>
<li>Nokia E6 (:P indeed)<br />
Data cable<br />
Should have wvdial installed (on debian lenny) which  depends on:<br />
libuniconf<br />
libwvstreams<br />
libwvstreams<br />
libxplc<br />
ppp<br />
wvdial_1.60.1+nmu2_i386.deb&nbsp;</p>
<p>If your debian is already on network then use tasksel to have dependencies resolved automatically.</li>
</ul>
<ul>
<li>After connecting data cable with Nokia E6, select Nokia Ovi Suite option from USB section</li>
<li>
<pre>List the USB devices with:</pre>
<pre>debian:~# lsusb</pre>
<pre>Bus 006 Device 019: ID 0421:032f Nokia Mobile Phones</pre>
<pre>Bus 006 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub</pre>
<pre>Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub</pre>
<pre>Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub</pre>
<pre>Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub</pre>
<pre>Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub</pre>
<pre>Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub</pre>
</li>
<li>From the listing of USB devices we have information of Nokia E6 phone, we are going to use two numbers 0421:032f to load the module into the Linux Kernel.<br />
0421 is the Vendor ID, and 032f is the Product ID.&nbsp;</p>
<p>debian:~# modprobe usbserial vendor=0&#215;421 product=0x32f</li>
<li>Verify with dmesg or checking /var/log/messages etc. From dmesg:<br />
[ 7698.253766] usb 6-1: bad CDC descriptors<br />
[ 7698.262285] usb 6-1: New USB device found, idVendor=0421, idProduct=032f<br />
[ 7698.262285] usb 6-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3<br />
[ 7698.262285] usb 6-1: Product: E6-00<br />
[ 7698.262285] usb 6-1: Manufacturer: Nokia<br />
[ 7698.262285] usb 6-1: SerialNumber: 1234565&#8230;</li>
<li>Now generate a wvdia configuration file using command wvdialconf</li>
<li>Edit /etc/wvdial.conf and change/add information below<br />
Phone = *99#<br />
Username= your phone number<br />
Password= your phone number<br />
Init3 = AT+CGDCONT=1,&#8221;IP&#8221;,&#8221;airtelgprs.com&#8221;    #added this line for my airtel connection&nbsp;</p>
<p>So my /etc/wvdial.conf after editing:<br />
[Dialer Defaults]<br />
Init2 = ATQ0 V1 E1 S0=0 &amp;C1 &amp;D2 +FCLASS=0<br />
Init3 = AT+CGDCONT=1,&#8221;IP&#8221;,&#8221;airtelgprs.com&#8221;<br />
Modem Type = USB Modem<br />
Phone = *99#<br />
ISDN = 0<br />
Username = my-phone-number-is-here<br />
Init1 = ATZ<br />
Password = my-phone-number-is-here<br />
Modem = /dev/ttyACM0<br />
Baud = 460800</li>
<li>Make sure that /etc/ppp/peers/wvdial has the entries below:<br />
noauth<br />
name wvdial<br />
usepeerdns</li>
<li>Now it&#8217;s time to connect to the internet, give command<br />
wvdial<br />
You should get similar message as below:&nbsp;</p>
<p>&#8211;&gt; WvDial: Internet dialer version 1.60<br />
&#8211;&gt; Cannot get information for serial port.<br />
&#8211;&gt; Initializing modem.<br />
&#8211;&gt; Sending: ATZ<br />
OK<br />
&#8211;&gt; Sending: ATQ0 V1 E1 S0=0 &amp;C1 &amp;D2 +FCLASS=0<br />
OK<br />
&#8211;&gt; Sending: AT+CGDCONT=1,&#8221;IP&#8221;,&#8221;airtelgprs.com&#8221;<br />
OK<br />
&#8211;&gt; Modem initialized.<br />
&#8211;&gt; Sending: ATDT*99#<br />
&#8211;&gt; Waiting for carrier.<br />
CONNECT<br />
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}&#8221;}&amp;} }*} } g}%~<br />
&#8211;&gt; Carrier detected.  Waiting for prompt.<br />
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}&#8221;}&amp;} }*} } g}%~<br />
&#8211;&gt; PPP negotiation detected.<br />
&#8211;&gt; Starting pppd at Thu Nov 17 12:18:30 2011<br />
&#8211;&gt; Pid of pppd: 11230<br />
&#8211;&gt; Using interface ppp0<br />
&#8211;&gt; pppd: �[07]� `[06]� �[07]�<br />
&#8211;&gt; pppd: �[07]� `[06]� �[07]�<br />
&#8211;&gt; pppd: �[07]� `[06]� �[07]�<br />
&#8211;&gt; pppd: �[07]� `[06]� �[07]�<br />
&#8211;&gt; local  IP address 223.176.85.113<br />
&#8211;&gt; pppd: �[07]� `[06]� �[07]�<br />
&#8211;&gt; remote IP address 10.6.6.6<br />
&#8211;&gt; pppd: �[07]� `[06]� �[07]�<br />
&#8211;&gt; primary   DNS address 202.56.230.5<br />
&#8211;&gt; pppd: �[07]� `[06]� �[07]�<br />
&#8211;&gt; secondary DNS address 202.56.230.6<br />
&#8211;&gt; pppd: �[07]� `[06]� �[07]�</li>
<li>Ping some external public ip, for example 4.2.2.2. If it&#8217;s not working check the default route.Should also work on RedHat/Fedora/Ubuntu and other Linux flavours.</li>
</ul>
<p>Anuj</p>
]]></content:encoded>
			<wfw:commentRss>http://unixuptime.com/forum/?feed=rss2&#038;p=290</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

