FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 09-06-2012, 07:47 PM
Les Mikesell
 
Default Simple routing question

On Thu, Sep 6, 2012 at 2:04 PM, James B. Byrne <byrnejb@harte-lyne.ca> wrote:
>
> What I wanted to have happen was for all traffic destined for
> 192.168.anything to stay inside the LAN and attached to the specified
> address, while any traffic that originated from 192.168.anything
> destined to anywhere else would route through the gateway; where it is
> NAT mangled.

To make that happen on your C host, you need to make the netmask cover
the range of the LAN addresses. Otherwise it is going to source off
of the other interface and send to the default router.

> I just want to understand what is going on in this specific case
> without delving deeply into the subject of routing, for which I do not
> have the luxury of time. This not impacting anything of significance
> so I take it up on a time available basis. On the other hand, I am
> definitely gaining an education in the process.

There is nothing 'deep' about routing. Just convert the addresses and
netmasks to binary and line the bits up. Where there are 0's in the
netmask bit positions, the destination doesn't have to match; where
there are ones it does. If there are multiple route matches, the most
specific match wins - that will be the one with the most 1's in the
netmask. Every hop makes this decision independently.

But, it doesn't make sense that ifconfig would show an
interface/netmask that doesn't appear in the route table. Normally
the system does that automatically.

--
Les Mikesell
lesmikesell@gmail.com
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 09-06-2012, 08:54 PM
"James B. Byrne"
 
Default Simple routing question

Well, I seem to be getting somewhere, although where exactly is open
to question.

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.

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?


--
*** E-Mail is NOT a SECURE channel ***
James B. Byrne mailto:ByrneJB@Harte-Lyne.ca
Harte & Lyne Limited http://www.harte-lyne.ca
9 Brockley Drive vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada L8E 3C3

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 09-06-2012, 09:11 PM
Les Mikesell
 
Default Simple routing question

On Thu, Sep 6, 2012 at 3:54 PM, James B. Byrne <byrnejb@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@gmail.com
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 09-06-2012, 11:51 PM
Dennis Jacobfeuerborn
 
Default Simple routing question

On 09/06/2012 11:11 PM, Les Mikesell wrote:
> On Thu, Sep 6, 2012 at 3:54 PM, James B. Byrne <byrnejb@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....

It does.

The question is what does the config file for eth1 look like because when
you bring up an alias interface first the config file for the parent
interface is read and then those values are overwritten by the values in
the alias config file.
So it might be the case that there is a PREFIX=24 definition in the eth1
file and none in the eth1:192 file which so in the end PREFIX=24 would be
used for the alias interface.

Regards,
Dennis


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 02:14 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org