<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:series="http://unfoldingneurons.com/"
		>
<channel>
	<title>Comments on: Red Hat / CentOS Linux Setting a Default Gateway</title>
	<atom:link href="http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/</link>
	<description>Every answer asks a more beautiful question.</description>
	<lastBuildDate>Mon, 22 Mar 2010 04:38:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: MadMac66</title>
		<link>http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/comment-page-1/#comment-46093</link>
		<dc:creator>MadMac66</dc:creator>
		<pubDate>Mon, 22 Feb 2010 09:10:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/#comment-46093</guid>
		<description>Hi,
if possible, simply edit /etc/rc.local and add all the routings you want. 
There you can setup specific routings for specific NICs and of course also the Default Gateway. example:
route add -net  netmask  gw  eth0
route add -net  netmask  gw  eth1
route add default gw  eth0

this way you can setup are more complex routing.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
if possible, simply edit /etc/rc.local and add all the routings you want.<br />
There you can setup specific routings for specific NICs and of course also the Default Gateway. example:<br />
route add -net  netmask  gw  eth0<br />
route add -net  netmask  gw  eth1<br />
route add default gw  eth0</p>
<p>this way you can setup are more complex routing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bobby</title>
		<link>http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/comment-page-1/#comment-45819</link>
		<dc:creator>bobby</dc:creator>
		<pubDate>Thu, 04 Feb 2010 04:23:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/#comment-45819</guid>
		<description>How to add specific route for another network</description>
		<content:encoded><![CDATA[<p>How to add specific route for another network</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bobby</title>
		<link>http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/comment-page-1/#comment-45807</link>
		<dc:creator>bobby</dc:creator>
		<pubDate>Wed, 03 Feb 2010 09:31:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/#comment-45807</guid>
		<description>Dear Vivek,can u please more brief on Nics,i have 2 networks and 2 lans total 4 lan ports,
 now i have 2 difrnt n/w coming from single cable,(IT N/w,signaling N/w),and both n/w have diffrent Gateways.i can not add gateways in /etc/sysconfig/network-script/ifcfg-eth0 and eth1,in /etc/sysconfig/network i have added gateway of signaling..

now i can ping at signaling n/w  but not IT network?how to add gateway for another network</description>
		<content:encoded><![CDATA[<p>Dear Vivek,can u please more brief on Nics,i have 2 networks and 2 lans total 4 lan ports,<br />
 now i have 2 difrnt n/w coming from single cable,(IT N/w,signaling N/w),and both n/w have diffrent Gateways.i can not add gateways in /etc/sysconfig/network-script/ifcfg-eth0 and eth1,in /etc/sysconfig/network i have added gateway of signaling..</p>
<p>now i can ping at signaling n/w  but not IT network?how to add gateway for another network</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DunxD</title>
		<link>http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/comment-page-1/#comment-44171</link>
		<dc:creator>DunxD</dc:creator>
		<pubDate>Wed, 21 Oct 2009 10:36:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/#comment-44171</guid>
		<description>You don&#039;t want multiple default gateways, else you will get intermittent networking problems! 

What you want is one default gateway, then if you need specific routes for specific subnets you should set those up as required.

Restart network is also available on RHEL and CentOS by &lt;code&gt;services network restart&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>You don&#8217;t want multiple default gateways, else you will get intermittent networking problems! </p>
<p>What you want is one default gateway, then if you need specific routes for specific subnets you should set those up as required.</p>
<p>Restart network is also available on RHEL and CentOS by <code>services network restart</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raghavan alias Saravanan M</title>
		<link>http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/comment-page-1/#comment-43710</link>
		<dc:creator>Raghavan alias Saravanan M</dc:creator>
		<pubDate>Wed, 16 Sep 2009 14:42:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/#comment-43710</guid>
		<description>Hi there,

 Yours is a good site and have found useful at various places and searches. 

 Thanks for the efforts and keep up the good work :)

  The way you restart the service, should NOT it be &#039;/etc/init.d/network&#039; instead of &#039;networking&#039;? Just check that out.

Cheers,
Raghavan alias Saravanan M.</description>
		<content:encoded><![CDATA[<p>Hi there,</p>
<p> Yours is a good site and have found useful at various places and searches. </p>
<p> Thanks for the efforts and keep up the good work :)</p>
<p>  The way you restart the service, should NOT it be &#8216;/etc/init.d/network&#8217; instead of &#8216;networking&#8217;? Just check that out.</p>
<p>Cheers,<br />
Raghavan alias Saravanan M.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jamie</title>
		<link>http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/comment-page-1/#comment-41282</link>
		<dc:creator>jamie</dc:creator>
		<pubDate>Tue, 21 Apr 2009 14:54:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/#comment-41282</guid>
		<description>route add -net 192.168.60.0 netmask 255.255.255.0 gw 192.168.30.1
route add -net 192.168.30.0 netmask 255.255.255.0 gw 192.168.30.1   

This forces all traffic through my 30 subnets gateway, which is 192.168.30.1.</description>
		<content:encoded><![CDATA[<p>route add -net 192.168.60.0 netmask 255.255.255.0 gw 192.168.30.1<br />
route add -net 192.168.30.0 netmask 255.255.255.0 gw 192.168.30.1   </p>
<p>This forces all traffic through my 30 subnets gateway, which is 192.168.30.1.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: spiderik</title>
		<link>http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/comment-page-1/#comment-41269</link>
		<dc:creator>spiderik</dc:creator>
		<pubDate>Mon, 20 Apr 2009 18:59:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/#comment-41269</guid>
		<description>But I have eth0 and eth1 under DHCP and I need the eth0 to be the default gw / any hints?</description>
		<content:encoded><![CDATA[<p>But I have eth0 and eth1 under DHCP and I need the eth0 to be the default gw / any hints?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rudy</title>
		<link>http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/comment-page-1/#comment-40034</link>
		<dc:creator>Rudy</dc:creator>
		<pubDate>Thu, 29 Jan 2009 01:13:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/#comment-40034</guid>
		<description>BiOg is right in that if you have multiple interfaces it will pick the last one. The fix to that is pretty much what vivek said.
Set your default gateway in the /etc/sysconfig/network and make sure none of the interface /etc/sysconfig/network-scripts/ifcfg- files have a &quot;GATEWAY&quot; line in them. That will force the system to pick the default GW from the network file. You can set static routes in the /etc/sysconfig/network-scripts/route- files</description>
		<content:encoded><![CDATA[<p>BiOg is right in that if you have multiple interfaces it will pick the last one. The fix to that is pretty much what vivek said.<br />
Set your default gateway in the /etc/sysconfig/network and make sure none of the interface /etc/sysconfig/network-scripts/ifcfg- files have a &#8220;GATEWAY&#8221; line in them. That will force the system to pick the default GW from the network file. You can set static routes in the /etc/sysconfig/network-scripts/route- files</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vivek</title>
		<link>http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/comment-page-1/#comment-39229</link>
		<dc:creator>vivek</dc:creator>
		<pubDate>Sat, 15 Nov 2008 04:18:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/#comment-39229</guid>
		<description>Open /etc/sysconfig/network and append
&lt;code&gt;GATEWAY=eth0.gateway.IP.address&lt;/code&gt;

Open /etc/sysconfig/network-scripts/route-eth1 and add routing for eth1 and restart it. For example:
&lt;code&gt;202.54.1.2/29 via 202.54.2.254&lt;/code&gt;

Also, set static route for /etc/sysconfig/network-scripts/route-eth0:
&lt;code&gt;10.1.2.3/8 via 10.10.38.95&lt;/code&gt;

Do not add gateway entries to 
/etc/sysconfig/network-scripts/ifcfg-eth1 and /etc/sysconfig/network-scripts/ifcfg-eth0</description>
		<content:encoded><![CDATA[<p>Open /etc/sysconfig/network and append<br />
<code>GATEWAY=eth0.gateway.IP.address</code></p>
<p>Open /etc/sysconfig/network-scripts/route-eth1 and add routing for eth1 and restart it. For example:<br />
<code>202.54.1.2/29 via 202.54.2.254</code></p>
<p>Also, set static route for /etc/sysconfig/network-scripts/route-eth0:<br />
<code>10.1.2.3/8 via 10.10.38.95</code></p>
<p>Do not add gateway entries to<br />
/etc/sysconfig/network-scripts/ifcfg-eth1 and /etc/sysconfig/network-scripts/ifcfg-eth0</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BiOg</title>
		<link>http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/comment-page-1/#comment-39228</link>
		<dc:creator>BiOg</dc:creator>
		<pubDate>Fri, 14 Nov 2008 21:39:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/howto-rhel-fedora-linux-setup-default-gateway/#comment-39228</guid>
		<description>With 2 (or more) NIC I notice that the default gateway is always set to the last NIC.

I.E: if you have eth0 and eth1 and configure you default gateway via /etc/sysconfig/network, /etc/sysconfig/network-scripts/ifcfg-eth* and event tweak the routes via /etc/sysconfig/network-scritps/route-eth* and /etc/sysconfig/static-routes to have the default be on eth0

It still end up being the eth1 network used as the default route (shown by the route command). 

The script executed during the boot just goes through all the interface configuration and then set the default route on the last visited interface; trashing previous settings (go figure why).

Somebody suggested to me that there is a way to select the default device (or interface) but I am yet to find a good hit on Google.</description>
		<content:encoded><![CDATA[<p>With 2 (or more) NIC I notice that the default gateway is always set to the last NIC.</p>
<p>I.E: if you have eth0 and eth1 and configure you default gateway via /etc/sysconfig/network, /etc/sysconfig/network-scripts/ifcfg-eth* and event tweak the routes via /etc/sysconfig/network-scritps/route-eth* and /etc/sysconfig/static-routes to have the default be on eth0</p>
<p>It still end up being the eth1 network used as the default route (shown by the route command). </p>
<p>The script executed during the boot just goes through all the interface configuration and then set the default route on the last visited interface; trashing previous settings (go figure why).</p>
<p>Somebody suggested to me that there is a way to select the default device (or interface) but I am yet to find a good hit on Google.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.110 seconds -->
