Routing tables


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Routing tables
# 8  
Old 10-06-2006
Yep, that did the trick.

I guess I'll put what I did in here just incase someone else needs it some other time.

in /etc/rc3.d/

I created a file called S99addroute (why S99 it was with the naming convention with the other files soooo you can probably just make a file called addroute and it should work)

-rwxr--r-- 1 root sys 244 Oct 6 09:31 S99addroute (make sure perms are same as other files)

(inside file)
#!/sbin/sh

ifconfig hme0:1 plumb
ifconfig hme0:1 172.28.66.10 netmask 255.255.255.252 broadcast 172.28.66.11
ifconfig hme0:1 up
route add 10.192.0.0/10 172.28.66.9

I changed the ip's around so they aren't mine, but you get the idea... if anyone thinks the script can be improved or start it in a different rc dir let me know this is kinda new to me.
# 9  
Old 10-06-2006
Ok, two things.

First, Solaris goes into the rc directories upon startup and shutdown and runs the scripts in the rc directory. On startup, all scripts that begin with 'S' are run in order. Shutdown runs the scripts that begin with 'K'.

So the script must start with an S or K depending on when you want the script to run. The numbers ensure the scripts are executed in the proper order. That the network is started before the web server or mail daemon for example. If you have a necessary route, I would think (I haven't tried this) that it would need to be run after the interface is set up and active.

Second, it is convention and highly suggested that you put the addroute script in the /etc/init.d directory. Then use ln -s to link the S script in the rc2.d or rc3.d directories

Code:
# ln -s ../init.d/addroute S99addroute

Generally when I'm checking the system for startup files, I'll check the /etc/init.d directory first since each of the scripts in the rc.d directories should link to a script that exists in /etc/init.d. It's a centralized repository of the startup scripts. Otherwise I have to go into each of the rc directories (not like there's 200 of them or anything) and search.

Hope this helps.

Carl
# 10  
Old 10-06-2006
Oh and you shouldn't need to configure your interface in your script. It should already be up if there's a /etc/hostname.hme0 file. This file tells the startup scripts to initialize the hme0 interface with information in the other files (netmask, hosts, etc).

Carl
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compare with 2 tables

I have 3 file inputs, file1 20160302|5485368299953|96|510101223440252|USA|5485368299953|6|800|2300|0 20160530|5481379883742|7|510101242850814|USA|5481379883742|5|540|2181|1500 20160513|5481279653404|24|510100412142433|INDIA|5481279653404|3|380|1900|0... (1 Reply)
Discussion started by: radius
1 Replies

2. UNIX for Dummies Questions & Answers

UNIX Routing Tables

I'm trying to learn the basic in's and out's of networking on my own through the use of a book. When it comes to routing tables I'm completely lost. I apologize for the alignment of the table below. The book vaguely explains routing tables, then has the following example: E15.3) Consider the... (8 Replies)
Discussion started by: ksmarine1980
8 Replies

3. Programming

C++ Dictionaries and tables

I was looking at this code from a programming book: #include <time.h> #include <iostream> #include <string> #include <deque> #include <map> #include <vector> #include <cstdlib> using namespace std; const int NPREF = 2; const char NONWORD = "\n"; // cannot appear as real line: we... (1 Reply)
Discussion started by: totoro125
1 Replies

4. Shell Programming and Scripting

Selecting tables

Hi, Can anyone help me that, How to see the table fields in Oracle database through shell script(ksh). I have tried with the following: sqlplus -s $user/$passwd@$sid << SQL >> session.log select * from Testtab.sql I'm not able to see anything.. Thanks (4 Replies)
Discussion started by: zxcjggu708
4 Replies

5. Shell Programming and Scripting

Display tables of 6

I'm new to linux and unix I would like to know how to display tables of 6 line after line Output should be 1*6 = 6 2*6 = 12 3*6 = 18 4*6 = 24 etc I can display line by line but not continuously Any suggestion (3 Replies)
Discussion started by: electricair
3 Replies

6. Shell Programming and Scripting

Tables and borders

when i do this: cat HITS i get the following displayed: sport.hits:87.114.172.31 Thu Sep 28 22:45:12 GMT 2006 how do i put this information into a bordered table? so it will output like this: ...........File /... (9 Replies)
Discussion started by: amatuer_lee_3
9 Replies

7. Shell Programming and Scripting

tables in scripts

Hi , I have two tables with same length t1 and t2, I want to cretae a new third table where i put the difference between the elements of t2 and t1, t3= t1 - t2 t3= t1 - t2 I am new to scripts, any help please? thanks (7 Replies)
Discussion started by: Celine19
7 Replies

8. Shell Programming and Scripting

Converting tables of row data into columns of tables

I am trying to transpose tables listed in the format into format. Any help would be greatly appreciated. Input: test_data_1 1 2 90% 4 3 91% 5 4 90% 6 5 90% 9 6 90% test_data_2 3 5 92% 5 4 92% 7 3 93% 9 2 92% 1 1 92% ... Output:... (7 Replies)
Discussion started by: justthisguy
7 Replies

9. UNIX for Dummies Questions & Answers

viewing tables

I have completely blanked out on this and I have done it a million times. I need to modify some tables in unix. What is the command for opening/viewing the tables? Thanks so much. :o (2 Replies)
Discussion started by: itldp
2 Replies
Login or Register to Ask a Question