Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.networking > #1874

Re: Adding 2nd network route

From Tauno Voipio <tauno.voipio@notused.fi.invalid>
Newsgroups comp.os.linux.networking
Subject Re: Adding 2nd network route
Date 2012-12-13 09:03 +0200
Organization A noiseless patient Spider
Message-ID <kabujj$3ba$1@dont-email.me> (permalink)
References <2b6999b6-a2d9-44ba-a784-f5157e32a42e@googlegroups.com> <f18a5399-abcf-43fc-be46-75c4de541cd3@googlegroups.com>

Show all headers | View raw


On 13.12.12 3:57 , herbert.burnswell@gmail.com wrote:
> Thank you for your reply.
>
>> Hi All,
>>
>> I've been reading about how to add a 2nd network connection on a different subnet but haven't been able to get it to work.
>
>
>>> Your lines are too long.
>
> I'm not sure what you mean.
>
>
>> I have a virtual machine (v-sphere 5.1) running RHEL 6.3 with the following set-up:
>>
>> # cat /etc/sysconfig/network-scripts/ifcfg-eth0
>> DEVICE="eth0"
>> ONBOOT="yes"
>> BOOTPROTO=none
>> NETMASK=255.255.254.0
>> IPADDR=10.10.11.8
>>
>> # cat /etc/sysconfig/network
>> NETWORKING=yes
>> NETWORKING_IPV6=no
>> HOSTNAME=host.domain
>> GATEWAY=10.10.10.1
>>
>> # route -n
>> Kernel IP routing table
>> Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
>> 10.10.10.0      0.0.0.0         255.255.254.0   U     0      0        0 eth0
>> 169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
>> 0.0.0.0         10.10.10.1      0.0.0.0         UG    0      0        0 eth0
>>
>> With the above set-up I can ping/communicate with any 10.10.10.0/23 system or any 10.10.12.0/23 system.
>
>
>>> There is no specific route to 10.10.12.0/23, so I suppose this network
>>> is reached through the default gateway 10.10.10.1.
>
> Yes, both reached through default gateway.
>
>
>> I add the 2nd interface:
>>
>> # cat /etc/sysconfig/network-scripts/ifcfg-eth1
>> DEVICE="eth1"
>> ONBOOT="yes"
>> BOOTPROTO=none
>> NETMASK=255.255.254.0
>> IPADDR=10.10.13.250
>>
>> # cat /etc/sysconfig/network-scripts/route-eth1
>> 10.10.12.0/23 via 10.10.12.1 dev eth1
>
>
>>> This route does not make any sense. The gateway belongs to the
>>> destination network ! Either the network is directly attached and there
>>> is no need to provide a gateway, or the network is not directly attached
>>> and you must provide a gateway which is on a directly attached network.
>
> Yes, I am not sure if I even need this file.
Nor am I sure what I need to put in the file.
If I do not use a route-<interface> file both eth0 and eth1 start properly
but I am unable to communicate with any 10.10.12.0/23 systems.
>
>> # route -n
>> Kernel IP routing table
>> Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
>> 10.10.12.0      0.0.0.0         255.255.254.0   U     0      0        0 eth1
>> 10.10.10.0      0.0.0.0         255.255.254.0   U     0      0        0 eth0
>
>> 0.0.0.0         10.10.10.1      0.0.0.0         UG    0      0        0 eth0
>
>
> The nonsensical route is absent.
>
>
>> After adding eth1, I can communicate with any 10.10.10.0/23 system but cannot commuicate with any 10.10.12.0/23 system.
>
>
>>> IIUC, you could communicate with 10.10.12.0/23 before (trough gateway
>>> 10.10.10.1 on eth0), but not after (directly on eth1) ?
>
> Yes, that is correct.
>
>>> What is eth1 connected to ?
>
> I'm not sure what you are referring to.

This is a perfectly valid question. If I may guess, you're running
a virtual machine and adding an interface (eth1) that is not
connected to anything at the host side.

> My goal, which I though was simple, is to add eth1 with the 10.10.13.250 IP address.
However as soon as I add it, I can no longer communicate with any 
10.10.12.0/23 systems.

If you want to set an extra IP address to the existing virtual
interface, use the Ethernet alias mechanism:

   ifconfig eth0:0 10.10.13.250/23

-- 

Tauno Voipio

Back to comp.os.linux.networking | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Adding 2nd network route herbert.burnswell@gmail.com - 2012-12-12 07:09 -0800
  Re: Adding 2nd network route Pascal Hambourg <boite-a-spam@plouf.fr.eu.org> - 2012-12-13 00:52 +0100
  Re: Adding 2nd network route herbert.burnswell@gmail.com - 2012-12-12 17:57 -0800
    Re: Adding 2nd network route Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2012-12-13 09:03 +0200
    Re: Adding 2nd network route Richard Kettlewell <rjk@greenend.org.uk> - 2012-12-13 09:12 +0000
    Re: Adding 2nd network route Pascal Hambourg <boite-a-spam@plouf.fr.eu.org> - 2012-12-14 00:00 +0100
    Re: Adding 2nd network route Gordon <Gordon@clear.net.nz> - 2012-12-19 06:33 +0000
      Re: Adding 2nd network route Aragorn <stryder@telenet.be.invalid> - 2012-12-19 07:52 +0100
        Re: Adding 2nd network route Ian Zimmerman <itz@buug.org> - 2012-12-19 12:48 -0800
        Re: Adding 2nd network route Ralph Spitzner <rasp@spitzner.org> - 2012-12-19 22:28 +0100

csiph-web