Results 1 to 6 of 6

Thread: Configure multiple network profiles

  1. #1
    Hi,
    Thanks for all the inputs.
    This is what I came up with.

    Of the three scripts -
    /etc/sysconfig/network-scripts/ifcfg-eth0
    /etc/sysconfig/networking/devices/ifcfg-eth0
    /etc/sysconfig/networking/profiles/default/ifcfg-eth0

    The one located under network-scripts did not help. I just changed that and restarted my network to find the network just reverts to its original.
    By changing the ifcfg-eth0 under devices did the trick. By restarting the network all ifcfg-eth0 scripts are changed to reflect what I want.
    That solved the ip. But I still needed to change the dns (/etc/resolv.conf). That was easy.
    My script -
    if [ $1 == 1 ]
    then
    echo "Changing to local ip"
    cp lan.ifcfg-eth0 /etc/sysconfig/networking/devices/ifcfg-eth0
    cp lan.resolv.conf /etc/resolv.conf
    else
    echo "Changing to isp"
    cp isp.ifcfg-eth0 /etc/sysconfig/networking/devices/ifcfg-eth0
    cp /etc/isp.resolv.conf /etc/resolv.conf
    fi
    echo "Restarting network"
    /sbin/service network restart

    Now about the grud and network profile.
    I started of by creating multiple profiles by using the network config gui. BIG MISTAKE.
    That ended up creating links of the default folder under profile. I change anything in any file, all the files with the same name in all the other profiles gets changed.
    So i used
    cp -R /etc/sysconfig/networking/profiles/default /etc/sysconfig/networking/profiles/PROFILENAME
    Then I changed the ifcfg-eth0 and resolv.conf in each different profile.

    I changed grub at /boot/grub/grub.conf
    Added netprofile=PROFILENAME at grub kernel.

    default=0
    timeout=10
    splashimage=(hd0,0)/grub/splash.xpm.gz
    hiddenmenu
    title Fedora Core Lan
    root (hd0,0)
    kernel /vmlinuz-2.6.15-1.2054_FC5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet netprofile=lan
    initrd /initrd-2.6.15-1.2054_FC5.img
    title Fedora Core Isp
    root (hd0,0)
    kernel /vmlinuz-2.6.15-1.2054_FC5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet netprofile=isp
    initrd /initrd-2.6.15-1.2054_FC5.img

    But after reboot the lan settings become what is set in default.

    I am completely stumped.
    What am I doing wrong?

    Thanks again for all the help. I wouldnt have come this far without it.

    Regards

  2. #2
    Mods - can the thread title be changed? I think the present title is no longer appropiate.

  3. #3
    Junior Member girlygeek's Avatar
    Join Date
    Jan 2006
    Posts
    54
    I have checked the contents of /etc/init.d and /etc/sysconfig/network-scripts for any reference to /etc/sysconfig/networking and see none for both FC5 and FC6.

    However, it looks like system-config-network creates them, that's probably why editing the files in /etc/sysconfig/network-scripts directly didn't work with you.

    Interesting post, I didn't know about that profile feature. More information can be found on it here.

    On another note,

    The reason why "lan" is the default is because you have set

    Code:
    default=0
    which makes grub use entry number 0 in grub.conf, namely the "lan" one. Set default to 1 and you should get it defaulting to your ISP.

  4. #4
    Junior Member girlygeek's Avatar
    Join Date
    Jan 2006
    Posts
    54
    FYI, I tried using system-config-network and the files were copied, not linked, from the network-scripts directory.

  5. #5
    here.

    Thanks for the link.

    On another note,

    The reason why "lan" is the default is because you have set .... which makes grub use entry number 0 in grub.conf, namely the "lan" one. Set default to 1 and you should get it defaulting to your ISP

    Actually -
    My default net profile is that of my isp. Casue that is what I use mostly. But sometimes I connect to the internet through my desktop and use it as a gateway for my laptop. So I alternate between two static ips, one given by my ISP for connecting to their network through which I get connect to the net, and my home ip 192.168.0.x.
    In trying to make this transition smoother I wanted to write a script. The result of which is above.
    But then Compunut showed me the grub settings.

    The default netprofile has not been deleted. But I have two fedora kernel settings in grub.conf both having netprofile. Inspite of me choosing LAN profile during boot - I end up with my isp setting. Not only that, the files upder /etc/.../profiles/lan changes to default settings.

    And my gui is still creating links if i use it. Am I missing some patches or something.
    I gotto solve this problem.
    I have to plug into various networks because of work. Having network profiles will really solve me a lot of problems.

    Regards

  6. #6
    Administrator Moderator
    Member
    starfish's Avatar
    Join Date
    Apr 2004
    Posts
    141
    I tried the link on my system at home. I think the key to your problem is near the bottom of the link page.

    These commands should force the copy of your settings from /etc/sysconfig/networking/profiles/default and /etc/sysconfig/networking/profiles/lan to /etc/sysconfig/network-scripts where the system will search for interface settings on boot up.

    Code:
    system-config-network-cmd -a -p lan
    system-config-network-cmd -a -p default
    Selecting the profile from the grub boot menu just gives you the option of selecting one on demand but won't change which of the two are selected at boot time.

    You may want to create an entry like this, which will use the default settings given by the system-config-network-cmd command.

    Code:
    kernel /vmlinuz-2.6.15-1.2054_FC5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet 
    initrd /initrd-2.6.15-1.2054_FC5.img
    title Fedora Core Default
    Study the output of the
    Code:
    system-config-network-cmd
    without any arguments and it will show which of the two is the true default. The command also sticks an entry in /etc/sysconfig/network, but I am not sure whether this is just informational for the user or whether the system actually uses it during boot time.

Similar Threads

  1. codes in updating profiles
    By selena in forum Tutorials
    Replies: 1
    Last Post: 04-13-2011, 07:07 AM
  2. Outlook profiles
    By dominicmiller in forum Windows - General Topics
    Replies: 0
    Last Post: 10-30-2006, 06:57 PM
  3. 98 /ME profiles to Win XP Domain User Profiles
    By regix in forum Windows - General Topics
    Replies: 0
    Last Post: 01-01-2005, 02:21 AM
  4. Mozilla profiles for a Kiosk
    By ph34r in forum Linux - Software, Applications & Programming
    Replies: 0
    Last Post: 02-05-2003, 07:29 PM
  5. Saving profiles
    By trickster in forum Linux - General Topics
    Replies: 9
    Last Post: 09-02-2002, 11:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •