LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 01-06-2004, 01:16 PM   #1
trees
Member
 
Registered: Dec 2003
Location: Earth... I think!?
Distribution: Debian
Posts: 32

Rep: Reputation: 15
"route add" gets reset at reboot


Greetings,
I'm using command:
route add -net 192.168.1.0 netmask 255.255.255.0 dev eth0
It adds a line in the routing tables, but upon restarting, the tables go back to the way they were before.
Is there a way to permanetly add the line either to the tables or the bootup sequence?

I'm using Debian.
Thanks!
 
Old 01-06-2004, 02:15 PM   #2
mizuki26
LQ Newbie
 
Registered: Nov 2003
Distribution: Madrake 9.1
Posts: 8

Rep: Reputation: 0
hi,

got the same problem. although i got the right ip in /etc/syconfig/networks/ifcfg-eth0 i got to delete a funny network ip(10.0.0.0 - which mandrake sets after every bootpup) and also got to add the gateway everytime (i got the gateway set in /etc /sysconfig/network).

ifcfg-eth0 looks like this:

DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.0.1
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
ONBOOT=yes

network looks like this:
HOSTNAME=black
NETWORKING=yes
GATEWAY=192.168.0.1
GATEWAYDEV=eth0

is there some extra mandrake script i got to edit before?
thanx.
 
Old 01-06-2004, 02:51 PM   #3
GAVollink
Member
 
Registered: Apr 2002
Location: St. Paul, Minnesota
Distribution: UbuntuStudio, Ubuntu
Posts: 357

Rep: Reputation: 31
Add extra or explicit routes within /etc/rc.d/init.d/net (or whatever file initializes the networking on your system). Otherwise, only the default route (to GATEWAY) will be added by the startup.

As for the issue listed from "mizuki26" - I could not fathom what the heck your Mandrake is trying to do - though I have a strange feeling that it is automatically addressing your interface with a private net address prior to the actual network startup scripts are run.
 
Old 01-20-2004, 11:51 AM   #4
trees
Member
 
Registered: Dec 2003
Location: Earth... I think!?
Distribution: Debian
Posts: 32

Original Poster
Rep: Reputation: 15
Never did figure out how to keep the routing table set, but did find a solution:
Second network card configured through /network/interfaces
That's it.
 
Old 01-21-2004, 03:16 PM   #5
eyewittness
Member
 
Registered: Dec 2003
Location: Netherlands
Distribution: SuSe 9.0
Posts: 44

Rep: Reputation: 15
lol u could also at that command to your /etc/rc.d/rc.local
it will be executed at boot time :P

EyeWiTTneSS
 
Old 01-21-2004, 05:18 PM   #6
codedv
Member
 
Registered: Nov 2003
Location: Slough, UK
Distribution: Debian
Posts: 146

Rep: Reputation: 15
edit your /etc/network/interfaces file and add the gateway to your interface. e.g:
Code:
iface eth0 inet static
  address 192.168.0.2
  netmask 255.255.255.0
  gateway 192.168.0.1
Thats like executing the route add command at startup.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"route add default gw" - trouble Vijayasarathy Linux - Networking 2 03-23-2005 08:54 AM
what is difference between "reset" and "clean " commands? zameer_india Linux - Newbie 2 01-10-2005 07:23 AM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 04:28 PM
Route to subnet exists but I get "Network unreachable" when adding default route fciuffani Linux - Networking 4 08-18-2004 03:11 PM
Permanently set "route add" -host and default gw sacants Linux - Newbie 1 07-18-2003 05:04 AM


All times are GMT -5. The time now is 06:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration