1834425 Members
2255 Online
110067 Solutions
New Discussion

Network issue

 
Habib_4
Advisor

Network issue

As you are all probably aware by now I am a beginner so will ask questions some might think are starnge.
Just wondered, when we are doing a:

"/sbin/init.d/net stop"

What is this command actually doing?
7 REPLIES 7
Peter Godron
Honored Contributor

Re: Network issue

Habib,
please read the file /sbin/init.d/net and in the header:
# net: configure lan interface(s) at initialization time.

The files in /sbin/init.d are executed at startup/shutdown time. So the net start means the lan interface on the machine is configured. net stop would shut the lan card down.

Be very careful if you ever need to execute the /sbin/init.d commands while the machine is running.
Chan 007
Honored Contributor

Re: Network issue

In addition to the above,

if you have changed any thing in /etc/rc.config.d/netconf file, that will be effective.

e.g if you change your IP, GW or ROUTER.

Chan
Asif Sharif
Honored Contributor

Re: Network issue

Salam Habib,

Once you have edited the netconf file, you need to make your configuration active. After adding the LAN and routing configuration information into the netconf file, you can either reboot your system, execute the ifconfig, and route commands manually, or run /sbin/init.d/net srart/stop scripts.

Regards,
Asif Sharif
Regards,
Asif Sharif
sysadm_1
Valued Contributor

Re: Network issue


Habib,

This is the scrip to configure the LAN interfaces while system startup and shutdown while system shutdown.

/sbin/init.d/net is linked to

/sbin/rc2.d/S340net -This link is executed while system startup.
and
/sbin/rc1.d/K660net -This is executed while system shutdown

-sysadm-
Peter Godron
Honored Contributor

Re: Network issue

Habib,
if your question has been aswered, can you please indify the most useful answer and close the thread.
Otherwise, please update.
yunardi
Frequent Advisor

Re: Network issue

Salam Habib,

Just sharing my experience.
Do not stop network while you connect from telnet/ssh, ofcourse your session will disconnected.

I suggest you to login on console and restart network services from here.

Sometime we working far away from console, if you only need to start stop the services write command to stop/start in crontab. I have do this before and its work :D

Thx,
EKO
Ralph Grothe
Honored Contributor

Re: Network issue

Though what Yournadi said
(viz. to be wary when executing /sbin/init.d/net while you are connected over the NICs the net script sets up)
I often successfully executed
/sbin/init.d/net start
to assign new IPs to lan devices
after having edited /etc/rc.config.d/netconf
to reflect the desired changes
even while I was connected via ssh over the affected NIC.
This however requires that you introduce no syntactic errors or inappropiate IP addresses and netmasks for the connected subnets.
But this is a bit of a gamble and the official way should be from the console in single user mode ;-)
Madness, thy name is system administration