Networking Forums

Networking Forums > Computer Networking > Linux Networking > file for routing changes

Reply
Thread Tools Display Modes

file for routing changes

 
 
Virtual_Ron
Guest
Posts: n/a

 
      10-17-2005, 07:00 PM
Greetings!

I need to add the following gateway to my machine:

route add net 192.168.1.0 netmask 255.255.255.0 192.168.100.32

Where/how do I store it so it comes back after a reboot?

here's my: /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.1.129
NETMASK=255.255.255.0
USERCTL=no
PEERDNS=no
TYPE=Ethernet
NETWORK=192.168.1.0
BROADCAST=192.168.1.255

#############################

Is is supposed to go in there somewhere?
I'm not trying to change my DEFAULT gateway, just add one.

thanks!
 
Reply With Quote
 
 
 
 
Tauno Voipio
Guest
Posts: n/a

 
      10-17-2005, 08:19 PM
Virtual_Ron wrote:
> Greetings!
>
> I need to add the following gateway to my machine:
>
> route add net 192.168.1.0 netmask 255.255.255.0 192.168.100.32
>
> Where/how do I store it so it comes back after a reboot?
>
> here's my: /etc/sysconfig/network-scripts/ifcfg-eth0
> DEVICE=eth0
> BOOTPROTO=none
> ONBOOT=yes
> IPADDR=192.168.1.129
> NETMASK=255.255.255.0
> USERCTL=no
> PEERDNS=no
> TYPE=Ethernet
> NETWORK=192.168.1.0
> BROADCAST=192.168.1.255
>
> #############################
>
> Is is supposed to go in there somewhere?
> I'm not trying to change my DEFAULT gateway, just add one.


This depends on the distribution you're using.

With Debian, the place is /etc/network/interfaces.

--

Tauno Voipio
tauno voipio (at) iki fi


 
Reply With Quote
 
Virtual_Ron
Guest
Posts: n/a

 
      10-17-2005, 08:55 PM
Tauno Voipio wrote:

> Virtual_Ron wrote:
>
>> Greetings!
>>
>> I need to add the following gateway to my machine:
>>
>> route add net 192.168.1.0 netmask 255.255.255.0 192.168.100.32
>>
>> Where/how do I store it so it comes back after a reboot?
>>
>> here's my: /etc/sysconfig/network-scripts/ifcfg-eth0
>> DEVICE=eth0
>> BOOTPROTO=none
>> ONBOOT=yes
>> IPADDR=192.168.1.129
>> NETMASK=255.255.255.0
>> USERCTL=no
>> PEERDNS=no
>> TYPE=Ethernet
>> NETWORK=192.168.1.0
>> BROADCAST=192.168.1.255
>>
>> #############################
>>
>> Is is supposed to go in there somewhere?
>> I'm not trying to change my DEFAULT gateway, just add one.

>
>
> This depends on the distribution you're using.
>
> With Debian, the place is /etc/network/interfaces.
>


I'm using Redhat 2.4.20-24.9
 
Reply With Quote
 
Raqueeb Hassan
Guest
Posts: n/a

 
      10-18-2005, 02:19 PM
> I'm using Redhat 2.4.20-24.9

Well, please have a look at /etc/sysconfig/network .... and edit the
gw.

NETWORKING=yes
HOSTNAME=yourhostname
FORWARD_IPV4=true
GATEWAY=192.168.100.32

Hope this helps.

--
Raqueeb Hassan
Bangladesh

 
Reply With Quote
 
Moe Trin
Guest
Posts: n/a

 
      10-19-2005, 12:18 AM
In the Usenet newsgroup comp.os.linux.networking, in article
<2dU4f.7284$da1.514@trndny04>, Virtual_Ron wrote:

>Tauno Voipio wrote:
>
>> Virtual_Ron wrote:


>>> I need to add the following gateway to my machine:
>>>
>>> route add net 192.168.1.0 netmask 255.255.255.0 192.168.100.32
>>>
>>> Where/how do I store it so it comes back after a reboot?


>>This depends on the distribution you're using.


>I'm using Redhat 2.4.20-24.9


That's the fifth updated kernel to RH-9 (2.4.20-43.9.legacy seems to
be current for that release - download.fedoralegacy.org).

For RH8+, add a file to /etc/sysconfig/network-scripts/. The file should be
called /etc/sysconfig/network-scripts/route-eth0 and its contents should be
as such:

192.168.1.0/24 via 192.168.100.32

That's assuming the interface is eth0 - adjust as needed.

Old guy
 
Reply With Quote
 
Moe Trin
Guest
Posts: n/a

 
      10-19-2005, 12:30 AM
In the Usenet newsgroup comp.os.linux.networking, in article
<(E-Mail Removed) .com>, Raqueeb Hassan wrote:

>> I'm using Redhat 2.4.20-24.9

>
>Well, please have a look at /etc/sysconfig/network .... and edit the
>gw.
>
>NETWORKING=yes
>HOSTNAME=yourhostname
>FORWARD_IPV4=true
>GATEWAY=192.168.100.32


You missed the line where he said:

>> I'm not trying to change my DEFAULT gateway, just add one.


The "GATEWAY" variable effects the default gateway only. He wants to
add another gateway, like

[example ~]$ /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 95017 eth0
192.168.2.0 192.168.100.32 255.255.255.0 UG 0 0 11695 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 420 lo
0.0.0.0 192.168.100.2 0.0.0.0 UG 0 0 2004 eth0

In this case, 192.168.1.248 does not lead to 192.168.2.0, and if I were
to use your method, I would end up with

192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 95017 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 420 lo
0.0.0.0 192.168.100.32 0.0.0.0 UG 0 0 2004 eth0

which isn't going to work, because the Internet is not in that direction.

Old guy
 
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
Win2003 R2 server just stops routing traffic until I restart Routing service Martijn Tonies Windows Networking 8 11-03-2008 11:05 AM
File Copy Windows -> SMB Linux; File size problem Publishers Press Windows Networking 0 10-23-2008 06:05 PM
Saving text file on SMB share - file has changed James Telford Linux Networking 3 09-18-2007 10:12 AM
I not find the NAT/Basic Firewall under Routing\IP Routing mtczx232@yahoo.com Windows Networking 2 12-16-2006 04:08 PM
Locking a file temporarily (till the file is transferred completely). Lince M Lawrence Linux Networking 2 11-10-2004 01:15 AM



1 2 3 4 5 6 7 8 9 10 11