C Board  

Go Back   C Board > Platform Specific Boards > Linux Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 09-04-2008, 08:00 AM   #1
Alessio Stella
 
Join Date: May 2008
Location: Italy, Bologna
Posts: 235
where ifconfig setup/init files?

Where can i set the value of MTU of an eth permanently? If i do it with ifconfig then at shutdown the set is lost
mynickmynick is offline   Reply With Quote
Old 09-04-2008, 08:07 AM   #2
Kernel hacker
 
Join Date: Jul 2007
Location: Farncombe, Surrey, England
Posts: 15,686
Somehwere in init.d there is a network setup shell-script. Modify that so that it sets the correct MTU. [It may call some other script which may be what you want to modify - but the principle is that the network start is done via a shell-script somewhere init.d].

--
Mats
__________________
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
matsp is offline   Reply With Quote
Old 09-04-2008, 08:20 AM   #3
Cat without Hat
 
CornedBee's Avatar
 
Join Date: Apr 2003
Posts: 8,492
And that init.d script will be configurable using some configuration file.

For example:
- Gentoo's /etc/init.d/net.* scripts are configured by /etc/conf.d/net and /etc/conf.d/wireless.
- ArchLinux's /etc/rc.d/network script is configured by /etc/rc.conf.
__________________
All the buzzt!
CornedBee

"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
CornedBee is offline   Reply With Quote
Old 09-05-2008, 05:38 AM   #4
Alessio Stella
 
Join Date: May 2008
Location: Italy, Bologna
Posts: 235
Quote:
Originally Posted by CornedBee View Post
And that init.d script will be configurable using some configuration file.

For example:
- Gentoo's /etc/init.d/net.* scripts are configured by /etc/conf.d/net and /etc/conf.d/wireless.
- ArchLinux's /etc/rc.d/network script is configured by /etc/rc.conf.
Thank you I have Debian and I have to wait till Tuesday for a colleague expert to these things
This is what I dislike of Linux
How can one find out which file to edit and how to edit it
"man ifconfig" points at 3 empty files
/proc/net/socket
/proc/net/dev
/proc/net/if_inet6
mynickmynick is offline   Reply With Quote
Old 09-05-2008, 05:42 AM   #5
Kernel hacker
 
Join Date: Jul 2007
Location: Farncombe, Surrey, England
Posts: 15,686
Files in /proc are not real files. Those are interfaces to the OS to supply information out of the OS without adding new API functions - instead, the OS pretends to have files in the /proc tree which provides text information to the applications that want it.

--
Mats
__________________
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
matsp is offline   Reply With Quote
Old 09-05-2008, 11:06 AM   #6
Registered User
 
Join Date: Oct 2001
Posts: 2,110
Yes, like Mats says, don't edit the files in /proc, rather, /etc is where your configuration files are.
robwhit is offline   Reply With Quote
Old 09-05-2008, 01:26 PM   #7
Frequently Quite Prolix
 
dwks's Avatar
 
Join Date: Apr 2005
Location: Canada
Posts: 7,698
Good reading: http://www.debian.org/doc/manuals/re...ateway.en.html

Maybe you want this.
Quote:
10.8.1 Triggering network configuration at boot time
On boot the /etc/rcS.d/S40networking init script runs the command ifup -a. This brings up all physical interfaces listed in auto stanzas in /etc/network/interfaces.

These days it is often better to handle network configuration using dynamic methods. Once mechanisms for supporting dynamically changing hardware are in place it becomes simplest to treat static hardware as if it were dynamic too. Booting can then be treated as just another hotplug event. (See Triggering network configuration – hotplug, Section 10.8.2.)

However, in almost all cases one wants at least the loopback interface lo to be brought up on boot. Therefore, make sure that /etc/network/interfaces includes the following stanzas.

auto lo

iface lo inet loopback
You can list additional physical interface names in auto stanzas if you want them to be brought up on boot too. Never list PCMCIA interfaces in auto stanzas. The PCMCIA cardmgr is started later in the boot sequence than when /etc/rcS.d/S40networking runs.
__________________
dwk

Seek and ye shall find. quaere et invenies.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell


Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net

My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
dwks is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ressources files mikahell Windows Programming 4 06-19-2006 06:50 AM
add source files to embedded VC 4.0 George2 C++ Programming 4 06-13-2006 03:28 AM
*.cpp and *.h files understanding ElastoManiac C++ Programming 4 06-11-2006 04:45 AM
Linking header files, Source files and main program(Accel. C++) Daniel Primed C++ Programming 3 01-17-2006 11:46 AM
Multiple Cpp Files w4ck0z C++ Programming 5 11-14-2005 02:41 PM


All times are GMT -6. The time now is 05:16 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22