Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 19117 - A better network config.
Summary: A better network config.
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-10 21:00 UTC by Ian Kumlien
Modified: 2003-04-12 18:08 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Kumlien 2003-04-10 21:00:23 UTC
A network config that has a closer resemblance to RH/MDK's network config would
be easyer to use aswell as easier to maintain. Added features could be added in
the scripts and less work would have to be done manually.

I know that the RH/MDK names triggers some bad emotions for some ppl but look at
it and see what it does. It also handles the DHCP hostname settings, which
current gento scripts dosn't handle.

It could be easily implented with a "startnetwork" in a runlevel.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Ian Kumlien 2003-04-10 21:00:44 UTC
There is a rouge version of this in the GRP section... =P
Comment 2 Jon Portnoy (RETIRED) gentoo-dev 2003-04-11 17:51:58 UTC
This is another one of the major selling points for Gentoo, easier network configuration than RH/Mandrake/etc.

If our network configuration is missing something, we should add that functionality, not rip it out in favor of a more obfuscated configuration set up like RH has.
Comment 3 Ian Kumlien 2003-04-11 21:14:16 UTC
Once you take the time to understand how rh/mdk's network config works, you'll see that slackware and gentoo is inferior in this respect. There is no way that you can claim that gentoo has a superior network config... Some basics like "reporting hostname to the dhcpd" has to be manually hacked, and would be somewhat hard to implent afterwards while rh and mdk offer a future proof solution.

editing a file with:
BOOTPROTO=dhcp

or:
IPADDR=x.x.x.x
GATEWAY=x.x.x.x
NETMASK=x.x.x.x

And then making shure that another file has the right if as defualt route is (pardon the language) shitloads easier. Sorry, but i could just do the ifconfig if and dhcpd commands manually than using the current netconfig.

Please install a recent mdk dist and look at what ifup and down handles.
(Again i'm not saying that it should remove any existsing 'depend' functinality, but stating that the current config is better is... bull =P )
Comment 4 Jon Portnoy (RETIRED) gentoo-dev 2003-04-11 21:38:57 UTC
The current config is 100% better, not at all cryptic, doesn't require use of a ncurses-based tool like netconfig, is centralized, provides heavy-duty configurability, and is generally sane.

Unlike RH.

If we're missing something (dhcp options?) please specify what's missing so we can add that functionality.
Comment 5 Ian Kumlien 2003-04-11 21:43:57 UTC
netconfig? just edit /etc/sysconfig/network-scripts/ifcfg-<ifname>
and /etc/sysconfig/network

thats all you need for ANY CONFIG.
And a hellofalot simpler than current gentoo. Aswell as the functinallity that ifup and ifdown provides... instead of having to type /etc/init.d/net.eth0 restart.

You are currently missing:
       -h <hostname>
              specifies  a  string  used  for  the  hostname option field when
              dhcpcd sends DHCP messages. Some  DHCP  servers,  notably  those
              used  by  @Home Networks, require the hostname option field con-
              taining a specific string in the DHCP messages from clients.

I bet that there are more that i have missed though. And how will you update *existing configs*? diffs? in rh and mdk ifup and ifdown does all this automagically, so a update goes like this: ifdown <if>; ifup <if>.
Comment 6 Martin Schlemmer (RETIRED) gentoo-dev 2003-04-12 15:27:51 UTC
Right, so what is this then:

---------------------------------------------------
# For DHCP set iface_eth? to "dhcp"
# For passing options to dhcpcd use dhcpcd_eth?
#
#iface_eth0="dhcp"
#dhcpcd_eth0="..."
---------------------------------------------------

See .. we do not have to add extra stuff, as you pass whatever you like
to the tools:

---------------------------------------------------
iface_eth0="dhcp"
dhcpcd_eth0="-h foobar"
---------------------------------------------------

Comment 7 Ian Kumlien 2003-04-12 15:44:03 UTC
Yes, but thats not my point.

Anyways, to humor you:
....
if [ "$DHCP_HOSTNAME" ] && [ "$DOMAINNAME" ]
then
        DHCP_HOSTNAME=`echo $DHCP_HOSTNAME | sed -e "s/\.$DOMAINNAME//g"`
fi
....
case $(basename $DHCP_CLIENT) in
    dhcpcd)
    [ -n "$DHCP_HOSTNAME" ] && DHCP_ARGS="-h $DHCP_HOSTNAME"
    [ -n "$NEEDHOSTNAME" ] && DHCP_ARGS="$DHCP_ARGS -H"
    [ "${PEERDNS}" = "no" ] && DHCP_ARGS="$DHCP_ARGS -R"
    [ "${PEERYP}" = "yes" ] || DHCP_ARGS="$DHCP_ARGS -Y"
    [ "${PEERNTPD}" = "yes" ] || DHCP_ARGS="$DHCP_ARGS -N"
    [ "X${DOMAINNAME}" = "X" ] && DHCP_ARGS="$DHCP_ARGS -D"
    [ -n "$DHCP_TIMEOUT" ] && DHCP_ARGS="$DHCP_ARGS -t ${DHCP_TIMEOUT}"
    DHCP_ARGS="$DHCP_ARGS $DEVICE"
....
etc

Which is easier?

And, going trough a 166 line file vs a file with 4 lines, which is less painfull?

Again, I'm not saying do it exactly like rh/mdk, but LOOK AT IT, get INSPIRED and make something even better.
Comment 8 Jon Portnoy (RETIRED) gentoo-dev 2003-04-12 15:48:24 UTC
I'll be honest with you. I looked at a RH network configuration a week ago. I wanted to vomit. That's not very inspiring.

We have a nice, clean, centralized, understandable, well-commented, easily understood, self-explanatory file. That's why it's 100+ lines. They have a few variables that may even be entirely cryptic to someone unfamiliar with it.

We have all of the functionality with much more cleanliness.
Comment 9 Ian Kumlien 2003-04-12 16:43:50 UTC
Sigh. I have even heard comments on that 'centralized, understandablem, wellcommented, easily understood file" from ppl who love *bsd and this is ppl who have been Solaris admins for years. None of em thinks that the way it's currently done is easier or better or anything.

If you in the future want to change the netconfig you will get more manual involvement due to this 'lovley way of dealing with it'.

I suggested this as a enhancement that would make gentoo more future poof, but it seems like i could talk to /dev/null instead.

What is so wrong with rh/mdk's way? that the files in dirs?
It handles it all, and it does most things automagically, no need for manual intervention. (Hell it even handles bonding and other cool tricks)
Comment 10 Martin Schlemmer (RETIRED) gentoo-dev 2003-04-12 17:51:36 UTC
And is dead slow, and you have hack 20 different files to add a new feature
that it do not support.  With us a new option to lets say dhcpcd just require
you to edit one file, edit one line, and there you go ...

Anyhow, lets say you come from Debian, or Slack, and you do not know about
netconfig, how will you know that you should add files called
/etc/sysconfig/network-scripts/{foo,bar}?  Especially for ppp I remember
way back how a mission it was (yes, did not know about netconfig :P), because
it needs more than ifcfg-ppp0.
Comment 11 Ian Kumlien 2003-04-12 18:08:34 UTC
It's just some shell scripts, i bet it could be made better with python or so.

Most things they've done has been future proof but i can't find dhcp options there now... 

Anyways, For gentoo it could have seperated script files, be written in python, have a /etc/network/ dir with the 'nice-naming-scheme' files. You could also have some kind of dependecy structure, ie, a dir with script files for different aspects of networking, and then adding something like 'depend bonding dhcp etc' in the begining (rename depend though.. ) and thus have it all more seperated.

ppp0 needs chat-ppp0 aswell yes, and editing (if you like) of /etc/pppd/options. But depending on your isp, ifcfg-ppp0 might be all you need to change.

Fyi, i have only hacked rh/mdk network configs manually, and Debian also have a ifup/ifdown system, but they have binaries instead of shellscripts. I assume it's for better performance but you can't modify em if you want to....