IFCONFIG Help


Forum: USB booting
Topic: IFCONFIG Help
started by: supercluver

Posted by supercluver on Jan. 10 2005,04:27
Hi all!!  New to the forums and new to Linux (I've played a little with SUSE 9.1 I guess, but very little), but loving it.  But I could use a little help from some guru-

in my /opt/bootlocal.sh file I have:

#!/bin/bash
# put other system startup command here
ifconfig eth0 address xxx.xxx.xxx.xxx netmask 255.255.255.0 broadcast xxx.xxx.xxx.xxx
route add default gw xxx.xxx.xxx.xxx
echo nameserver xxx.xxx.xxx.xxx > /etc/resolv.conf
echo nameserver xxx.xxx.xxx.xxx >> /etc/resolv.conf

where x is replaced by a number of course.
But upon booting I cannot access the network or get online.
I then type ifconfig -a and I can see that everything looks set, but it is not listed as up.
So then I type the ifconfig and route commands into the command line and whammo I can get online just fine.  Why?  What am I leaving out?  Do I need to add sudo before the commands?  I have to be superuser to enter them into the command line.  Thanks in advance!!

Posted by mikshaw on Jan. 10 2005,04:47
bootlocal is run as root, so sudo is not necessary.
Try adding 'eth0 up' to bootlocal

Posted by supercluver on Jan. 10 2005,05:59
Thanks I tried that, no dice.  I still have to go to netcardconfig or use ifconfig at the command line to get it to work.  Could it be because DHCP is automatic when booting?  Should I shut down the card first with "ipconfig eth0 down" and then try to bring it up???  Thanks again for your help.
Posted by mikshaw on Jan. 10 2005,06:05
I'm not sure...my ethernet seems to work fine with DHCP, and i don't know much about manually configuring networks.  Let's hope someone here can help you more than I can.
Posted by green on Jan. 11 2005,02:46
Well, I have not done what you are trying, but I would try another approach if I didn't get it working the way you suggest. If you have anything on your network acting as a DHCP server, do you have the option enter your MAC address and have you router/firewall do 'dynamic static'/ IP assignments? If you do, you could have your router/firewall assign the same IP to that MAC address everytime it asks for an IP. I know that's not what you're looking for, but it would work if all else fails. Do you "need" a static IP ?
Posted by supercluver on Jan. 11 2005,13:47
Well, I only need it while I'm here working for this client as I am on their network and they assign me the static IP details (I don't have access to the router or anything)...  All other times I use DHCP so it won't be a big deal then, its just I will be here working for another week and I can't STAND IT when I can't figure something simple like this out!!!   :angry:   But I think I will just leave it booted up for the next week and then it won't matter....  thanks anyway...
Posted by henk1955 on Jan. 11 2005,14:10
the dhcp-client is still waiting in the background. when it timesout you can use ifconfig. (may take 1 or 2 minutes)
OR add nodhcp to the bootoptions, so dhcp-client is not started.
Code Sample
dsl nodhcp

Posted by supertom64 on Jan. 12 2005,07:10
hi mikshaw,

you have to edit some files.

1. at boot prompt type nodhcp this disables automatic ip assignment

2. edit the resolv.conf with an dns server and add it to the /home/dsl/filetool.lst
e.g.
nameserver 192.168.1.254 (maybe take the router/gateway which often have an dns proxy or look what the other have for dns server)

3. edit the file
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
# automatically added when upgrading
auto lo eth0
iface lo inet loopback


iface eth0 inet static
address 192.168.xxx.xxx (xxx adjust to you needs)
netmask 255.255.255.0
network 192.168.xxx.0
broadcast 192.168.xxx.255
gateway 192.168.xxx.xxx

and add it to the filetool.lst
4. edit the bootlocal.sh and add the command
/etc/init.d/networking restart

thats it, if you donīt need anymore, remove them from the filetool.lst

hth
TOM

Posted by Tyraldur on Jan. 12 2005,13:06
Hi all,

sorry iam a little bit Nobby and my english is also.

There are any things i dont understand.
1) the files resolv.conf filetools.lst are in the ramdisk, isnt it?
2) where are they saved, because the usb-stick is only mounted ro in /cdrom, how can use DSL this files during the next booting?

Thanks for answering.
Greetings from Germany :)

Posted by henk1955 on Jan. 12 2005,13:31
if you used the usb-install script then one of the bootparams is "frugal".
this magicword makes the /cdrom writeable at boottime so you can write to the usb-stick

Posted by Tyraldur on Jan. 12 2005,14:29
Damn, so easy?

Ive made a small ext3 partiton (~300MB), copy /KNOPPIX/* to a new directory like /mnt/KNOPPIX, change my configuration and do
mkisofs -R /mnt/KNOPPIX | create_compressed_fs - 65536 > /mnt/newKNOPPIX/KNOPPIX
and change it with the /KNOPPIX/KNOPPIX from the USB-Stick

But it works  :D

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.