Networking Forums

Networking Forums > Computer Networking > Linux Networking > Simple routing question about my setup

Reply
Thread Tools Display Modes

Simple routing question about my setup

 
 
Ken Williams
Guest
Posts: n/a

 
      06-29-2004, 09:30 PM
When I bootup this is what sets up my network/eth0.

# Network Block: 49.90.8.176 / 28

# Add loopback
/sbin/ifconfig lo 127.0.0.1
/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo

# Ethernet Config Info
IPADDR="49.90.8.180"
NETMASK="255.255.255.240"
NETWORK="49.90.8.176"
BROADCAST="49.90.8.191"
GATEWAY="49.90.8.177"

/sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}
/sbin/route add -net ${NETWORK} netmask ${NETMASK} dev eth0
/sbin/route add default gw ${GATEWAY} netmask 0.0.0.0 metric 1

It results in this (route command output):

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
49.90.8.176 0.0.0.0 255.255.255.240 U 0 0 0 eth0
49.90.8.176 0.0.0.0 255.255.255.240 U 0 0 0 eth0
49.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 69.90.8.177 0.0.0.0 UG 1 0 0 eth0


What is causing the net 49.0.0.0 netmask 255.0.0.0 to be there? I need to
remove that, I know I can do a "route del -net..." but I don't want it to be
there to begin with at bootup. What do I have to change to get rid of that?
Its causing all packets from any ip thats starts with 49. to go nowhere.

This is linux 2.4.26/slackware 9.1.

Thanks.
 
Reply With Quote
 
 
 
 
Gerard Wassink
Guest
Posts: n/a

 
      06-30-2004, 06:51 AM
On Tue, 29 Jun 2004 21:30:31 GMT, Ken Williams scribbled:

> When I bootup this is what sets up my network/eth0.
>
> # Network Block: 49.90.8.176 / 28
>
> # Add loopback
> /sbin/ifconfig lo 127.0.0.1
> /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo
>
> # Ethernet Config Info
> IPADDR="49.90.8.180"
> NETMASK="255.255.255.240"
> NETWORK="49.90.8.176"
> BROADCAST="49.90.8.191"
> GATEWAY="49.90.8.177"
>
> /sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}
> /sbin/route add -net ${NETWORK} netmask ${NETMASK} dev eth0
> /sbin/route add default gw ${GATEWAY} netmask 0.0.0.0 metric 1
>
> It results in this (route command output):
>
> Kernel IP routing table
> Destination Gateway Genmask Flags Metric Ref Use Iface
> 49.90.8.176 0.0.0.0 255.255.255.240 U 0 0 0 eth0
> 49.90.8.176 0.0.0.0 255.255.255.240 U 0 0 0 eth0
> 49.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 eth0
> 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
> 0.0.0.0 69.90.8.177 0.0.0.0 UG 1 0 0 eth0
>
> What is causing the net 49.0.0.0 netmask 255.0.0.0 to be there? I need to
> remove that, I know I can do a "route del -net..." but I don't want it to be
> there to begin with at bootup. What do I have to change to get rid of that?
> Its causing all packets from any ip thats starts with 49. to go nowhere.
>
> This is linux 2.4.26/slackware 9.1.
>
> Thanks.


I'm not entirely sure, but I would consider altering the netmask of 0.0.0.0
in your last route add default to 255.255.255.255, meaning that all other
traffic would go thru your gateway.

--
GerardLinux ay tee filternet dee oo tee ann el

|
\ /
.---.
'-. | | .-'
___| |___
-= [ ] =-
`---. .---'
__||__ | | __||__
'-..-' | | '-..-'
|| | | ||
||_.-| |-,_||
.-"` `"`'` `"-.
.' '.

Jesus is alive, I spoke with Him this morning!
 
Reply With Quote
 
daniele di mattia
Guest
Posts: n/a

 
      06-30-2004, 11:40 AM
(E-Mail Removed) (Ken Williams) wrote in
news:YclEc.27212$(E-Mail Removed):

I noticed sometimes network configuration is set in several files.
In my box, I have /etc/sysconfig/network and /etc/sysconfig/network-
scripts/ifcfg-eth0.
I never remember the right files, so when I make some changes, I often use
grep -r(ecursive) with some keywords to find which file I have to modify.

$ pwd
/etc/sysconfig
$ grep -r MASK= *
networking/ifcfg-lo:NETMASK=255.0.0.0
network-scripts/ifcfg-lo:NETMASK=255.0.0.0
network-scripts/ifup-aliases: echo default_NETMASK=$NETMASK\;;
network-scripts/ifup-aliases: NETMASK=$default_NETMASK
network-scripts/ifcfg-eth0:NETMASK=255.255.255.192
[root@gzdns-e sysconfig]# grep -r MASK= *|more
networking/ifcfg-lo:NETMASK=255.0.0.0
network-scripts/ifcfg-lo:NETMASK=255.0.0.0
network-scripts/ifup-aliases: echo default_NETMASK=$NETMASK\;;
network-scripts/ifup-aliases: NETMASK=$default_NETMASK
network-scripts/ifcfg-eth0:NETMASK=255.255.255.192
$

I hope this could help.

Ciao.



> When I bootup this is what sets up my network/eth0.
>
> # Network Block: 49.90.8.176 / 28
>
> # Add loopback
> /sbin/ifconfig lo 127.0.0.1
> /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo
>
> # Ethernet Config Info
> IPADDR="49.90.8.180"
> NETMASK="255.255.255.240"
> NETWORK="49.90.8.176"
> BROADCAST="49.90.8.191"
> GATEWAY="49.90.8.177"
>
> /sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask
> ${NETMASK} /sbin/route add -net ${NETWORK} netmask ${NETMASK} dev eth0
> /sbin/route add default gw ${GATEWAY} netmask 0.0.0.0 metric 1
>
> It results in this (route command output):
>
> Kernel IP routing table
> Destination Gateway Genmask Flags Metric Ref
> Use Iface 49.90.8.176 0.0.0.0 255.255.255.240 U 0
> 0 0 eth0 49.90.8.176 0.0.0.0 255.255.255.240 U
> 0 0 0 eth0 49.0.0.0 0.0.0.0 255.0.0.0
> U 0 0 0 eth0 127.0.0.0 0.0.0.0 255.0.0.0
> U 0 0 0 lo 0.0.0.0 69.90.8.177
> 0.0.0.0 UG 1 0 0 eth0
>
>
> What is causing the net 49.0.0.0 netmask 255.0.0.0 to be there? I
> need to remove that, I know I can do a "route del -net..." but I don't
> want it to be there to begin with at bootup. What do I have to change
> to get rid of that? Its causing all packets from any ip thats starts
> with 49. to go nowhere.
>
> This is linux 2.4.26/slackware 9.1.
>
> Thanks.


 
Reply With Quote
 
Ian Northeast
Guest
Posts: n/a

 
      06-30-2004, 10:44 PM
On Wed, 30 Jun 2004 08:51:40 +0200, Gerard Wassink wrote:

> On Tue, 29 Jun 2004 21:30:31 GMT, Ken Williams scribbled:
>
>> When I bootup this is what sets up my network/eth0.
>>
>> # Network Block: 49.90.8.176 / 28
>>
>> # Add loopback
>> /sbin/ifconfig lo 127.0.0.1
>> /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo
>>
>> # Ethernet Config Info
>> IPADDR="49.90.8.180"
>> NETMASK="255.255.255.240"
>> NETWORK="49.90.8.176"
>> BROADCAST="49.90.8.191"
>> GATEWAY="49.90.8.177"
>>
>> /sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}
>> /sbin/route add -net ${NETWORK} netmask ${NETMASK} dev eth0 /sbin/route
>> add default gw ${GATEWAY} netmask 0.0.0.0 metric 1
>>
>> It results in this (route command output):
>>
>> Kernel IP routing table
>> Destination Gateway Genmask Flags Metric Ref Use
>> Iface 49.90.8.176 0.0.0.0 255.255.255.240 U 0 0
>> 0 eth0 49.90.8.176 0.0.0.0 255.255.255.240 U 0 0
>> 0 eth0 49.0.0.0 0.0.0.0 255.0.0.0 U 0
>> 0 0 eth0 127.0.0.0 0.0.0.0 255.0.0.0 U
>> 0 0 0 lo 0.0.0.0 69.90.8.177 0.0.0.0 UG
>> 1 0 0 eth0
>>
>> What is causing the net 49.0.0.0 netmask 255.0.0.0 to be there? I need
>> to remove that, I know I can do a "route del -net..." but I don't want
>> it to be there to begin with at bootup. What do I have to change to get
>> rid of that? Its causing all packets from any ip thats starts with 49.
>> to go nowhere.
>>
>> This is linux 2.4.26/slackware 9.1.
>>
>> Thanks.

>
> I'm not entirely sure, but I would consider altering the netmask of
> 0.0.0.0 in your last route add default to 255.255.255.255, meaning that
> all other traffic would go thru your gateway.


No, the default route has a netmask of 0.0.0.0, that is what makes it the
default route. A netmask of 255.255.255.255 would route no traffic except
that destined for the target itself down that route, and as the target is
0.0.0.0 that means nothing.

The 49/8 route (the one with the 255.0.0.0 netmask) being there looks as
though something has set up the interface with the IP address and no
netmask. This would default to /8 - 49 would have been class A and
classfulness is still the default if the netmask isn't specified. But
there isn't anything in the above which would do that. Is anything issuing
"ifconfig eth0 49.90.8.180" alone with no netmask?

Regards, Ian

 
Reply With Quote
 
Ken Williams
Guest
Posts: n/a

 
      06-30-2004, 11:07 PM
In article <(E-Mail Removed)>, Ian Northeast <(E-Mail Removed)> wrote:
>The 49/8 route (the one with the 255.0.0.0 netmask) being there looks as
>though something has set up the interface with the IP address and no
>netmask. This would default to /8 - 49 would have been class A and
>classfulness is still the default if the netmask isn't specified. But
>there isn't anything in the above which would do that. Is anything issuing
>"ifconfig eth0 49.90.8.180" alone with no netmask?


Yes, your right. I just figured it out too. I left it out because I didn't
think it mattered, but I had some other "alias" IPs being setup too that
looked like:

/sbin/ifconfig eth0:0 49.90.8.181
/sbin/route add -host 49.90.8.181 dev eth0:0

without the netmask. I added a netmask so it looked like

/sbin/ifconfig eth0:0 69.90.8.181 netmask 255.255.255.240
/sbin/route add -host 69.90.8.181 dev eth0:0

and everything came up properly. Thanks for your post anyway.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple routing question... Christian Williamson Linux Networking 5 07-18-2007 04:59 PM
simple routing setup ... moritz@uplink-verein.ch Linux Networking 4 09-19-2005 04:35 AM
simple question about ip_forward and NAT routing. meneg Linux Networking 3 03-31-2005 08:55 AM
I have a simple wireless home networking setup question! Joe Samangitak Windows Networking 6 03-14-2005 12:20 AM
Simple (?) routing question Dario Linux Networking 1 11-23-2004 12:51 PM



1 2 3 4 5 6 7 8 9 10 11