LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   configuring network on startup (https://www.linuxquestions.org/questions/linux-networking-3/configuring-network-on-startup-124511/)

blish_blash 12-10-2003 05:38 AM

configuring network on startup
 
Hi,
I would be glad for advice on configuring the following network "things" on startup (I am not sure if I am using grep or lilo, if it is important tell me how to tell the difference, and i will check...):

Routing : my eth1 startsup with a route I do not wish it to have. Where does it take it from? How can I change it

Ip_forward : I can change to 1 on /proc/sys/net/ipv4/ip_forward but wouldn't it be greate if linux could start with 1?

iptables : i did not get to this one yet, but when I will, I will also probably wonder how to set or change the tables on startup.

dhcpd : how to start on startup?

sshd : how to start on startup?

will be glad for help...
Thanx,
Ron

fatgod 12-10-2003 07:37 AM

I think you mean 'grub' and no it's nothing to do with startup scripts. grub and lilo boot linux (and other OS's) and that's about all they are good for ;)

You need to take a look at your startup (rc) scripts... it depends a bit on what distro your using, but generally you will find them in /etc/init.d/ or /etc/rc.d.

I'm not going to explain everything here, but I'll do my best to give you a kick start ;)

the system is starting these scipts by runlevel. runlevel 5 is (usually) start network and start X so your probably using that...

so the scripts in /etc/init.d/ are linked to /etc/init.d/rc5.d and then the system knows what scripts to run when you are in runlevel 5.

you control when they are started by assigning a number, so if you make your own rc script (just using any other as a template) you would put it in /etc/init.d then do 'ln -s /etc/init.d/myscript /etc/init.d/rc5.d/S99myscript' so it will definatly run last.

you might want to make a K link as well, so the "stop" part of the script runs on shutdown.



So....
Routing : my eth1 startsup with a route I do not wish it to have. Where does it take it from? How can I change it

It will be setup by one of your current rc scripts, but it might be quite complex... you can have a look at your current scripts or make your own entry to change it on startup until you can get it figured out...



Ip_forward : I can change to 1 on /proc/sys/net/ipv4/ip_forward but wouldn't it be greate if linux could start with 1?

put "echo 1 > /proc/sys/net/ipv4/ip_forward" into a script somewhere (your own?) I have it set in my firewall script.


iptables : i did not get to this one yet, but when I will, I will also probably wonder how to set or change the tables on startup.

Firewalls can be complex beasts to setup, fortunately there are tools to help you, or you can just use scripts maintained by others... I use firegate http://firegate.sourceforge.net/



dhcpd : how to start on startup?

startup scripts.

sshd : how to start on startup?

startup scripts.

You probably already have scripts for both these if you are using a "big" distro like suse or redhat, you should be able to just link them to rc5.d

Good luck ;)


All times are GMT -5. The time now is 01:34 PM.