LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   where information is saved from eth0,?in which file? (https://www.linuxquestions.org/questions/linux-networking-3/where-information-is-saved-from-eth0-in-which-file-788709/)

bushra 02-12-2010 11:47 AM

where information is saved from eth0,?in which file?
 
i want to know about eth0..that where information is saved from eth0?in which file? and how to take input from that file? what will be the script?

pixellany 02-12-2010 11:58 AM

Welcome to LQ!!

eth0 is a device node--most likely for your wired (Ethernet) internet connection. You would not normally read or write this "file".

Please describe what you are trying to accomplish and we can give a better answer.

bushra 02-12-2010 11:05 PM

if i change the device name like eth0 t0 xxxx,and then save it,where this file will save? and i want to make a script that takes input from that saved file.

etc itself is a directory. i want to know how i can access the neworking configuration parameters? files where these parameters are saved?


regards,

catkin 02-12-2010 11:29 PM

It varies between distros. The config may be in /etc/network/interfaces (ubuntu and ...?) or in /etc/rc.d/rc.inet1.conf (Slackware and ...?).

EDIT: or in the /etc/sysconfig/network-scripts directory (Redhat and ...)

pixellany 02-13-2010 11:55 AM

Quote:

Originally Posted by bushra (Post 3862187)
if i change the device name like eth0 t0 xxxx,and then save it,where this file will save? and i want to make a script that takes input from that saved file.

I still have no clue what you are trying to do......

First, if you change the device name, then something in your networking is probably not going to work.

Second, whenever you rename a file, you specify where it goes. Example:

mv filename newname ##the renamed file is in the same directory

mv filename /path/newname ##the renamed file is in the location specfied by /path/

Finally, if you rename eth0, then how will information get INTO that file so that you can read from it.

Again, please describe the overall problem you are trying to solve---i.e. WHY do you want to rename eth0 and then read from it?

jschiwal 02-14-2010 09:48 AM

On many systems, the values you enter in your network configuration setup end up in a file named ifcfg-eth0. When you run ifup, it sources this file to set variables that the ifup script uses. If you use ifup-* scripts instead of network manager, you could for example add your PSK to a wireless interfaces settings. I've done that so I could use a 64 hex digit random PSK which I would never be able to remember.

Try running "man 5 ifcfg" for more information on these settings. Other files are used for different settings, such as your routers. Read the manpages for these commands and look at the "see also" entries in the bottom. Usually the config file used are included and often these configuration files have their own man pages.


All times are GMT -5. The time now is 09:16 AM.