[CentOS] Simple routing question

Les Mikesell lesmikesell at gmail.com
Thu Sep 6 17:11:08 EDT 2012


On Thu, Sep 6, 2012 at 3:54 PM, James B. Byrne <byrnejb at harte-lyne.ca> wrote:
>
> I did this.  I put the virtual interface address 192.168.0.1 back onto
> eth1 of the gateway host and restarted the network services.  The
> ifcfg file looked like this:
>
> BOOTPROTO=none
> BROADCAST=192.168.255.255
> DEVICE=eth1:192
> IPADDR=192.168.0.1
> IPV6INIT=no
> MTU=""
> NAME="LAN - Non-routable"
> NETMASK=255.255.0.0
> NETWORK=192.168.0.0
> ONBOOT=yes
> ONPARENT=yes
>
> After the restart ip addr showed this:
>
> 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
> state UP qlen 1000
>     link/ether 00:25:90:60:11:8d brd ff:ff:ff:ff:ff:ff
>     inet aaa.bbb.ccc.1/24 brd aaa.bbb.ccc.255 scope global eth1
>     inet 192.168.0.1/24 brd 192.168.255.255 scope global eth1:192
>     inet6 fe80::225:90ff:fe60:118d/64 scope link
>        valid_lft forever preferred_lft forever
>
> Note the cidr suffix on 192.168.0.1 = 24
>
> That is not what I expected.  Restarting with the same config did not
> change the initially observed outcome.
>
> SO, I edited ifcfg-eth1:192 and added exactly one line:
>
> PREFIX="16"
>
> and restarted the network.  ip addr now shows this:
>
> 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
> state UP qlen 1000
>     link/ether 00:25:90:60:11:8d brd ff:ff:ff:ff:ff:ff
>     inet aaa.bbb.ccc.1/24 brd aaa.bbb.ccc.255 scope global eth1
>     inet 192.168.0.1/16 brd 192.168.255.255 scope global eth1:192
>     inet6 fe80::225:90ff:fe60:118d/64 scope link
>        valid_lft forever preferred_lft forever
>
>
> Note that the cidr suffix is now 16.

I thought it would figure that out from the NETMASK, but OK....


>
> Now, when I try and ping an address on the 192.168 netblock from host
> C I see this:
>
> # ping 192.168.209.43
> PING 192.168.209.43 (192.168.209.43) 56(84) bytes of data.
> >From 216.185.71.1: icmp_seq=2 Redirect Host(New nexthop: 192.168.209.43)
> >From 216.185.71.1: icmp_seq=3 Redirect Host(New nexthop: 192.168.209.43)
> >From 216.185.71.1: icmp_seq=4 Redirect Host(New nexthop: 192.168.209.43)
> >From 216.185.71.1: icmp_seq=5 Redirect Host(New nexthop: 192.168.209.43)
> >From 216.185.71.1: icmp_seq=6 Redirect Host(New nexthop: 192.168.209.43)
>
>
> My question now is how do I get to 192.168.209.43?

This is your router telling the source box that it can send directly
to the destination (which it knows because netmasks really are
supposed to be global for the subnet and routers don't like to route
back the inbound interface).   However, it should also have routed the
packet.

-- 
  Les Mikesell
    lesmikesell at gmail.com


More information about the CentOS mailing list