<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Adding two new nics and creaing the default gateway for each in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/adding-two-new-nics-and-creaing-the-default-gateway-for-each/m-p/4177493#M83485</link>
    <description>set iptables roules.</description>
    <pubDate>Thu, 10 Apr 2008 08:08:30 GMT</pubDate>
    <dc:creator>Jeeshan</dc:creator>
    <dc:date>2008-04-10T08:08:30Z</dc:date>
    <item>
      <title>Adding two new nics and creaing the default gateway for each</title>
      <link>https://community.hpe.com/t5/operating-system-linux/adding-two-new-nics-and-creaing-the-default-gateway-for-each/m-p/4177492#M83484</link>
      <description>I am using Redhat linux As4&lt;BR /&gt;&lt;BR /&gt;I already have Bond0 created with a defualy gateway, but I haave added two ned nics, eth2 and eth3.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This is the setup&lt;BR /&gt; Eth2  ip address 10.134.30.42 subnet 255.255.255.128 default gateway 10.134.30.1&lt;BR /&gt;&lt;BR /&gt; Eth2 ip address 10.134.30.170 submet mask 255.255.255.128 default gateway 10.134.30.129&lt;BR /&gt; &lt;BR /&gt;I would like to define a default gateway for each Nic.&lt;BR /&gt;&lt;BR /&gt;So all traffic going out from eth2 routes via 10.134.30.1 and all traffic going from eth3 routes via 10.134.30.129&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Apr 2008 07:42:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/adding-two-new-nics-and-creaing-the-default-gateway-for-each/m-p/4177492#M83484</guid>
      <dc:creator>Mike Hedderly</dc:creator>
      <dc:date>2008-04-10T07:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: Adding two new nics and creaing the default gateway for each</title>
      <link>https://community.hpe.com/t5/operating-system-linux/adding-two-new-nics-and-creaing-the-default-gateway-for-each/m-p/4177493#M83485</link>
      <description>set iptables roules.</description>
      <pubDate>Thu, 10 Apr 2008 08:08:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/adding-two-new-nics-and-creaing-the-default-gateway-for-each/m-p/4177493#M83485</guid>
      <dc:creator>Jeeshan</dc:creator>
      <dc:date>2008-04-10T08:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Adding two new nics and creaing the default gateway for each</title>
      <link>https://community.hpe.com/t5/operating-system-linux/adding-two-new-nics-and-creaing-the-default-gateway-for-each/m-p/4177494#M83486</link>
      <description>And when an outgoing packet has a destination of, say, 123.45.67.89, which NIC or bond should it use then? Is there only one good option, or might there be another gateway that is not as good but might be used if the primary gateway does not work?&lt;BR /&gt;&lt;BR /&gt;Remember that there are no such things as "connections" or "sessions" on the IP level: by default, each packet is routed using its own address information and nothing else.&lt;BR /&gt;&lt;BR /&gt;The "default gateway" is what is used if the routing table has no more specific instructions for a particular destination address. &lt;BR /&gt;&lt;BR /&gt;You have listed two new gateways, in addition to the old default gateway. Is the entire IP address space of the whole Internet truly reachable through all these three gateways? &lt;BR /&gt;&lt;BR /&gt;If yes, the destination IP address alone is insufficient for determining the correct outgoing network interface. This is where the traditional routing table and the "route" command become inadequate: you must use the advanced techniques of "policy routing", and the command for configuring it is "ip".&lt;BR /&gt;See:&lt;BR /&gt;&lt;A href="http://www.policyrouting.org/PolicyRoutingBook/ONLINE/TOC.html" target="_blank"&gt;http://www.policyrouting.org/PolicyRoutingBook/ONLINE/TOC.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If no, then some of these gateways are not really "default" gateways, but just "limited" gateways to some definable sub-sets of IP addresses. This can be handled using a traditional routing table: when setting up the route manually, instead of "route add default gw &lt;GATEWAY-IP&gt;", you specify one or more commands like "route add -net &lt;NETWORK&gt; netmask &lt;MASK&gt; gw &lt;GATEWAY-IP&gt;". To make these settings permanent, you should create files like /etc/sysconfig/network-scripts/route-&lt;INTERFACE&gt;.&lt;BR /&gt;&lt;BR /&gt;For example, if your eth2 has connectivity to 10.134.20.0/255.255.255.0 and 10.134.21.0/255.255.255.0 and eth3 to 10.133.0.0/255.255.0.0, you could write two files:&lt;BR /&gt;&lt;BR /&gt;/etc/sysconfig/network-scripts/route-eth2:&lt;BR /&gt;ADDRESS0="10.134.20.0"&lt;BR /&gt;NETMASK0="255.255.255.0"&lt;BR /&gt;GATEWAY0="10.134.30.1"&lt;BR /&gt;&lt;BR /&gt;ADDRESS1="10.134.21.0"&lt;BR /&gt;NETMASK1="255.255.255.0"&lt;BR /&gt;GATEWAY1="10.134.30.1"&lt;BR /&gt;&lt;BR /&gt;/etc/sysconfig/network-scripts/route-eth3:&lt;BR /&gt;ADDRESS0="10.133.0.0"&lt;BR /&gt;NETMASK0="255.255.0.0"&lt;BR /&gt;GATEWAY0="10.134.30.129"&lt;BR /&gt;&lt;BR /&gt;MK&lt;/INTERFACE&gt;&lt;/GATEWAY-IP&gt;&lt;/MASK&gt;&lt;/NETWORK&gt;&lt;/GATEWAY-IP&gt;</description>
      <pubDate>Mon, 14 Apr 2008 13:07:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/adding-two-new-nics-and-creaing-the-default-gateway-for-each/m-p/4177494#M83486</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2008-04-14T13:07:04Z</dc:date>
    </item>
  </channel>
</rss>

