Networking Forums

Networking Forums > Computer Networking > Linux Networking > Re: Default Wired eth0 Config on Fedora 13

Reply
Thread Tools Display Modes

Re: Default Wired eth0 Config on Fedora 13

 
 
Bit Twister
Guest
Posts: n/a

 
      10-13-2010, 09:44 AM
On Wed, 13 Oct 2010 02:09:11 -0500, Kevin the Drummer wrote:
> Hi,
>
> Where can I alter the DHCP config to choose the gateway address?


I have seen last nic dink up routing in a multi-nic system.
Of course not knowing your setup, all we can do is make wild guesses.

> Where can I change my default network setup to use the static IP
> address and static gateway I've chosen?


Well, exact solution requires knowledge of your setup which you did
not supply.

Depends on which nic connects to internet,

Here is a dump network script I use to troubleshoot user network problems on
different linux installations. Extract it, run it, search through
resulting text file for pearls of information.

If still in the dark, post the output with which nick is supposed to
be the internet gateway and what router you are using.


----- standard debug network problem text/script follows: version 5.1 -----
dump_net.txt

First assumption is, you have installed ALL updates and have rebooted.

Note: This script does not dump wireless settings.

If you read http://www.catb.org/~esr/faqs/smart-questions.html
it will suggest you provide any information about your setup which might
help troubleshoot your problem.

Examples:
o Internet connection type, (cable, adsl,,,),
o Internet hardware, (vendor/model of the modem).
o What is your type of hookup, (Ethernet, usb, wireless,...).
o Maybe your system is hooked to a hub/switch/router,
o Your distribution, version, config file values,... .

We need to know about your network hardware setup.
This script will dump your config settings.

If something does not start up, try
dmesg
and/or look through /var/log/messages for an error message.
and/or cat /var/log/prcsys.log

If your problem is slow network give us a URL so we can try it.

Once you get your network running, you may want to run xx one last time
and save the output file for disk crash/new installs

Might not hurt to save xx for one of a network debugging checklist steps.

The following ambidextrous script is for mandriva, *buntu. debian,
slackware, pclinux, fedora, suse, and will dump your hardware status,
network settings and config files used in network setup. We need that
information to troubleshoot your problem.

If you are having to use windows to access Usenet:
Format a diskette on the windows system.

Copy the following xx.txt script into xx.txt using notepad.exe
then save xx.txt to the diskette/cd/usb stick.

To get the script results back to Windows and
none of the above hardware works, you can use http://www.fs-driver.org/

If you do not want some malware writing to linux. You can replace it
with http://www.diskinternals.com/linux-reader/ which does not
provide write access to linux.

The above assumes you have not created a FAT partition to exchange
files between OSs. If you did, copy dosa.txt to it from linux and read
it from windows.

I do recommend remove/un-installing the windows/linux file system
driver after you get the linux network up.
Makes your Windows Anti Virus scanner run much faster after removal.

Also, if logged into windows, it would be nice to include your windows
network settings. Click up a Prompt/cmd/terminal and add in contents from
ipconfig /all
when you reply with linux settings.


If using linux for Usenet access, su - root, copy script text into xx
chmod +x xx
./xx

and include a.txt (if on linux) or dosa.txt (if on windows) in your reply.
Do not attach it.

NOTE: to become root, you need to do a
su - root
not su root

For the suse, ubuntu, kubuntu users,
sudo -i
chmod +x xx
../xx

exit will exit the sudo -i command.

Do not change text formatting of the output file.
If you want to hide something like domain name, use an editor to do a global
substitution of .yourdomain.com to .invalid.com

Do not worry about showing your LAN ip addresses because
nobody is going to be able to connect to 198.162.x.x from the Internet.

You dinking with ip addresses could hide the problem or send us off on a
snipe hunt.

If xx is not in your home directory, you will have to provide the full
path in place of $HOME. Example:
sudo -i
chmod +x /some/where/xx
/some/where/xx



------------------ Script starts below this line ---------
#!/bin/bash
#************************************************* ************
#*
#* xx - Dump network config files and network hardware status
#*
#*
#* Output: a.txt is the linux file
#* dosa.txt is the Windows file
#*
#************************************************* ************

_fn=a.txt
_out_fn=$PWD/$_fn
_dos_fn=$PWD/dos${_fn}
_home=$PWD

function cat_fn
{
_fn=$1
if [ "$_fn" = "/etc/urpmi/urpmi.cfg" ] ; then
_cmd="head -30"
else
_cmd=cat
fi

if [ -f $_fn ] ; then
_count=$(stat -c %s $_fn )
if [ $_count -gt 0 ] ; then
echo " " >> $_out_fn
echo "======== $_cmd $_fn ========" >> $_out_fn
$_cmd $_fn >> $_out_fn
echo "======== end of $_fn ========" >> $_out_fn
echo " " >> $_out_fn
fi
fi
} # end cat_fn

function grep_fn
{
_fn=$1
if [ -e $_fn ] ; then
_count=$(stat -c %s $_fn )
if [ $_count -gt 0 ] ; then
_count=$(grep -v '^#' $_fn | wc -l)
if [ $_count -gt 0 ] ; then
echo " " >> $_out_fn
echo "======== grep -v '^#' $_fn ==========" >> $_out_fn
if [ "$_fn" != "shorewall.conf" ] ; then
grep -v '^#' $_fn >> $_out_fn
else
awk 'empty{if (!/^#/) print; empty=0} /^$/{empty=1}' $_fn >> $_out_fn
fi
echo "======== end of $_fn ========" >> $_out_fn
echo " " >> $_out_fn
fi
fi
fi
} # end grep_fn

function ls_dir
{
_dr=$1
if [ -d $_dr ] ; then
echo "========= cd $_dr ; ls -al ========" >> $_out_fn
cd $_dr
ls -al >> $_out_fn
echo " " >> $_out_fn
fi
} # end ls_dir

function tail_fn
{
_fn=$1
if [ -e $_fn ] ; then
echo "======== tail -20 $_fn ==========" >> $_out_fn
tail -20 $_fn >> $_out_fn
echo " " >> $_out_fn
fi
} # end tail_fn

#********************************
# check if commands are in $PATH
# and if not add them to PATH
#********************************

_path=""
type ifconfig > /dev/null 2>&1
if [ $? -ne 0 ] ; then
_path="${_path}/sbin:"
fi

type cat > /dev/null 2>&1
if [ $? -ne 0 ] ; then
_path="${_path}/bin:"
fi

type id > /dev/null 2>&1
if [ $? -ne 0 ] ; then
_path="${_path}/usr/bin:"
fi

if [ -n "$_path" ] ; then
PATH=${_path}$PATH
export PATH
fi

#*****************************************
# check if root and logged in correctly
#*****************************************

_uid=$(id --user)

if [ $_uid -ne 0 ] ; then
echo " "
echo "You need to be root to run $0"
echo "Click up a terminal and do the following:"
echo " "
echo "su - root"
echo "$PWD/xx"
echo " "
echo "or "
echo " "
echo "sudo -i"
echo "$PWD/xx"
echo " "
exit 1
fi

root_flg=1

if [ -n "$LOGNAME" ] ; then
if [ "$LOGNAME" != "root" ] ; then
root_flg=0
fi
fi

if [ -n "$USER" ] ; then
if [ "$USER" != "root" ] ; then
root_flg=0
fi
fi

if [ $root_flg -eq 0 ] ; then
echo " "
echo "Guessing you did a su root"
echo "instead of a su - root"
echo "please exit/logout of this session and do the following:"
echo " "
echo "su - root"
echo "$PWD/xx"
echo " "
echo "or "
echo " "
echo "sudo -i"
echo "$PWD/xx"
echo " "
exit 1
fi


#********************************
# main code starts here
#********************************


echo "Working, output will be in $_out_fn "

date > $_out_fn
chmod 666 $_out_fn

_nic_list=""
for n in eth0: eth1: eth2: eth3: ; do
dmesg | grep -c $n > /dev/null 2>&1
if [ $? -eq 0 ] ; then
_nic_list="$_nic_list ${n:0:4}"
fi
done

_nic_count=$(echo $_nic_list | wc -w )

if [ -n "$_path" ] ; then
echo "======== echo $PATH ==========" >> $_out_fn
echo "$PATH" >> $_out_fn 2>&1
fi


type lsb_release > /dev/null 2>&1
if [ $? -eq 0 ] ; then
cat_fn /etc/release
echo " " >> $_out_fn
echo "======== lsb_release -a ==========" >> $_out_fn
lsb_release -a >> $_out_fn 2>&1
else

for _d in /etc/*release ; do
if [ ! -d $_d ] ; then
if [ $_d != "/etc/lsb-release" ] ; then
cat_fn $_d
break
fi
fi
done

for _d in /etc/*version ; do
if [ ! -d $_d ] ; then
cat_fn $_d
break
fi
done

cat_fn /proc/*version
fi


cat_fn /etc/product.id
cat_fn /etc/sysconfig/speedboot

echo " " >> $_out_fn
echo "======== uname -rvi =============" >> $_out_fn
uname -rvi >> $_out_fn
uname -m >> $_out_fn

_fn=/etc/security/msec/security.conf
if [ -e $_fn ] ; then
echo " " >> $_out_fn
echo "==== grep BASE_LEVEL $_fn ====" >> $_out_fn
grep BASE_LEVEL $_fn >> $_out_fn
fi

if [ -n "$SECURE_LEVEL" ] ; then
echo " " >> $_out_fn
echo "msec security level is $SECURE_LEVEL" >> $_out_fn
fi

echo "
$(grep 'model name' /proc/cpuinfo)
$(grep 'cpu MHz' /proc/cpuinfo)
$(uname -m)

" >> $_out_fn


cat_fn /proc/cmdline

cat_fn /etc/urpmi/urpmi.cfg

echo "======== free ==========" >> $_out_fn
free >> $_out_fn 2>&1
echo " " >> $_out_fn

if [ -e /etc/inittab ] ; then
_line=$(grep :initdefault /etc/inittab)
set -- $(IFS=':'; echo $_line)
echo " " >> $_out_fn
echo "Default run level is $2" >> $_out_fn
echo " " >> $_out_fn
echo "Current level " >> $_out_fn
runlevel >> $_out_fn
echo " " >> $_out_fn
fi


type chkconfig > /dev/null 2>&1
if [ $? -eq 0 ] ; then
echo " " >> $_out_fn
for _serv in avahi named tmdns dhcpd ; do
chkconfig --list | grep -i $_serv > /dev/null 2>&1
if [ $? -eq 0 ] ; then
echo "Double check if /$_serv/ needs to be disabled on boot" >> $_out_fn
chkconfig --list | grep -i $_serv | tr "\t" ' ' >> $_out_fn
fi
done

echo "


" >> $_out_fn
echo "======== chkconfig --list ==========" >> $_out_fn

chkconfig --list | tr "\t" ' ' >> $_out_fn

else
echo " " >> $_out_fn
for _serv in avahi named tmdns ; do
ls /etc/rcS.d/S* | grep $_serv > /dev/null 2>&1
if [ $? -eq 0 ] ; then
echo "Double check if /$_serv/ needs to be disabled on boot" >> $_out_fn
fi
done

echo "


" >> $_out_fn
echo "======== ls -o /etc/rcS.d/ ==========" >> $_out_fn
ls -o /etc/rcS.d >> $_out_fn
fi

_fn=/etc/nsswitch.conf
if [ -e $_fn ] ; then
echo " " >> $_out_fn
echo "======== grep hosts: $_fn ==========" >> $_out_fn
grep hosts: $_fn >> $_out_fn
fi

ls /etc/mod*.conf > /dev/null 2>&1
if [ $? -eq 0 ] ; then
echo " " >> $_out_fn
echo "======== grep -i options /etc/mod*.conf ==========" >> $_out_fn
grep -i options /etc/mod*.conf >> $_out_fn
echo " " >> $_out_fn
echo "======== grep alias /etc/mod*.conf ==========" >> $_out_fn
grep -i alias /etc/mod*.conf >> $_out_fn
fi


cat_fn /etc/dhclient-enter-hooks
cat_fn /etc/dhclient-exit-hooks
cat_fn /etc/dhcp*/dhclient-enter-hooks
cat_fn /etc/dhcp*/dhclient-exit-hooks

grep_fn /etc/host.conf

echo "================ ifconfig -a ==============" >> $_out_fn
ifconfig -a >> $_out_fn

echo " " >> $_out_fn
echo "dmesg has $_nic_list" >> $_out_fn
echo " " >> $_out_fn
cat_fn /etc/iftab
echo "============= cd /etc/udev/rules.d/ =========" >> $_out_fn
cd /etc/udev/rules.d/
echo "============= grep eth * | grep -v ethe | grep -v weth | grep -v veth ==================" >> $_out_fn
grep eth * | grep -v ethe | grep -v bluetooth | grep -v weth | grep -v veth >> $_out_fn
cd

grep_fn /etc/hosts.allow
grep_fn /etc/hosts.deny

echo "============== route -n =================" >> $_out_fn
route -n >> $_out_fn
echo " " >> $_out_fn

echo "===== dig +short rs.dns-oarc.net txt | grep EDNS ======" >> $_out_fn
dig +short rs.dns-oarc.net txt | grep EDNS >> $_out_fn
dig +short @4.2.2.2 rs.dns-oarc.net txt | grep EDNS >> $_out_fn
echo " " >> $_out_fn

cat_fn /etc/sysconfig/network/routes
cat_fn /etc/sysconfig/network
grep_fn /etc/mkinitramfs/initramfs.conf

grep_fn /etc/resolv.conf

grep_fn /etc/resolvconf/resolv.conf.d/head
cat_fn /etc/resolvconf/resolv.conf.d/base
cat_fn /etc/resolvconf/resolv.conf.d/tail


echo "======== hostname --fqdn ==========" >> $_out_fn
hostname --fqdn >> $_out_fn
echo " " >> $_out_fn

cat_fn /etc/hostname
cat_fn /etc/HOSTNAME

grep_fn /etc/hosts

cat_fn /etc/network/interfaces
cat_fn /var/run/network/ifstate
cat_fn /etc/dhclient.conf

if [ -e /etc/ifplugd/ifplugd.conf ] ; then
echo "========== grep -v '^#' /etc/ifplugd/ifplugd.conf ========" >> $_out_fn
grep -v '^#' /etc/ifplugd/ifplugd.conf >> $_out_fn
fi


ethtool_flg=0
type ethtool > /dev/null 2>&1
if [ $? -eq 0 ] ; then
ethtool_flg=1
fi

mii_tool_flg=0
type mii-tool > /dev/null 2>&1
if [ $? -eq 0 ] ; then
mii_tool_flg=1
fi

cat_fn /etc/rc.d/rc.inet1.conf
for _d in \
"/etc/sysconfig/networking/profiles/default" \
"/etc/sysconfig/network-scripts" \
"/etc/sysconfig/network" \
"/etc/sysconfig/networking/devices"
do
if [ -d $_d ] ; then
_cnt=$(ls $_d/ifcfg-* 2> /dev/null | wc -l )
if [ "$_cnt" -gt 1 ] ; then
_dir=$_d
echo " " >> $_out_fn
echo "========== ls $_d/ifcfg-* ===" >> $_out_fn
ls $_d/ifcfg-* >> $_out_fn
fi
fi
done


for nic in $_nic_list ; do
if [ $mii_tool_flg -eq 1 ] ; then
mii-tool -v $nic > /dev/null 2>&1
if [ $? -eq 0 ] ; then
echo " " >> $_out_fn
echo "======== mii-tool -v $nic ==========" >> $_out_fn
mii-tool -v $nic >> $_out_fn
fi
fi

if [ $ethtool_flg -eq 1 ] ; then
ethtool $nic > /dev/null 2>&1
if [ $? -eq 0 ] ; then
echo " " >> $_out_fn
echo "======== ethtool $nic ==========" >> $_out_fn
ethtool $nic >> $_out_fn
fi
fi

echo " " >> $_out_fn
echo "=== dmesg | grep ${nic}: ========" >> $_out_fn
dmesg | grep ${nic}: >> $_out_fn

echo " " >> $_out_fn
echo "=== grep $nic /var/log/messages | grep -v SRC= | grep -v =eth | tail -10 ===" >> $_out_fn
grep $nic /var/log/messages | grep -v SRC= | grep -v =eth | tail -10 >> $_out_fn

cat_fn /etc/sysconfig/network-scripts/ifcfg-$nic
cat_fn /etc/sysconfig/network/ifcfg-$nic
cat_fn /etc/sysconfig/networking/devices/ifcfg-$nic
cat_fn /etc/sysconfig/networking/profiles/default/ifcfg-$nic

ifconfig $nic > /dev/null 2>&1
if [ $? -eq 0 ] ; then
set $(ifconfig $nic | tr [A-Z] [a-z])
cat_fn /etc/sysconfig/network/ifcfg-eth-id-$5
fi

tail_fn /var/lib/dhcp*/dhclient.${nic}.leases
tail_fn /var/lib/dhcp*/dhclient-${nic}.leases
tail_fn /var/lib/dhcp*/dhclient-${nic}.lease
tail_fn /var/lib/dhclient/dhclient-${nic}.leases
tail_fn /var/lib/dhclient/dhclient-*-${nic}.lease
tail_fn /etc/dhcpc/dhcpcd-${nic}.info

done # end for nic in $_nic_list


_dir=/etc/NetworkManager/dispatcher.d
if [ -d $_dir ] ; then
ls_dir $_dir

for _d in "if-up.d" "if-down.d" "if-pre-up.d" "if-post-down.d" ; do
if [ -e /etc/network/${_d} ] ; then
echo "==== cd /etc/network/${_d} ; ls -al ===" >> $_out_fn
cd /etc/network/${_d}
ls -al >> $_out_fn
fi
done
fi

if [ -d /etc/sysconfig/network-scripts ] ; then
for _d in "ifdown.d" "ifup.d" ; do
if [ -e /etc/sysconfig/network-scripts/${_d} ] ; then
_cmd="cd /etc/sysconfig/network-scripts/${_d} ; ls -al "
echo " " >> $_out_fn
echo "===== $_cmd ====" >> $_out_fn
cd /etc/sysconfig/network-scripts/${_d}
ls -al >> $_out_fn
fi
done
fi

ls_dir /etc/dhcp*/dhclient-exit-hooks.d
ls_dir /etc/resolvconf/update.d


if [ -d /etc/shorewall ] ; then
_count=$(chkconfig --list shorewall | grep -c n )
if [ $_count -gt 0 ] ; then
echo " " >> $_out_fn
echo "======= Shorewall settings =========" >> $_out_fn
cd /etc/shorewall
for _f in $(ls) ; do
echo "======= $_f =========" >> $_out_fn
grep_fn $_f
done
fi
fi


cd $_home

echo "==== end of config/network data dump =======" >> $_out_fn

awk '{print $0 "\r" }' $_out_fn > $_dos_fn
chmod 666 $_dos_fn


echo "

CAUTION: review contents of $_out_fn and verify no sensitive WIRELESS key
information is in the output. If so just change the value to _REMOVED_

If posting via linux, post contents of $_out_fn
You might want to copy it to your account with the command
cp $_out_fn ~your_login

If posting via windows, post contents of $_dos_fn

If using diskette,
Copy $_dos_fn to diskette with the following commands:

mkdir -p /floppy
mount -t auto /dev/fd0 /floppy
cp $_dos_fn /floppy
umount /floppy

and $_dos_fn is ready for windows from diskette
"

#*********** end of dump xx.txt script *********
#----------- script ends above this line ------------------------



echo "

and then copy xx.txt to the diskette.

On some linux distributions, you may need to get into the User/Group
screen, show all users, double click root, create the password, and
enable root. Root's password should never be the same as anyone else's.

To move xx.txt from diskette to the linux box, click up a linux terminal
su - root
(root's passwd)

mkdir -p /floppy
mount -t auto /dev/fd0 /floppy
tr -d '\015' < /floppy/xx.txt > xx
chmod +x xx
../xx

Back on the windows OS, you can cut/paste the a:\dosa.txt into your reply
under windows.
Do not attach it.

When you do reply, please remove/trim my response/text/script from your reply
before you add in the results/output of the script.

If you are dual booting the box, you can copy xx.txt to linux from windows.

Note: The following assumes /dev/hda1 is where windows is installed on the
first partition on the C: drive
If you have sata drive, you may have to use /dev/sda1 instead of /dev/hda1.

cat /etc/fstab to see which value will be required.
Do keep quotes used in the following:
mkdir -p /doze
mount -t auto /dev/hda1 /doze
tr -d '\015' < /doze/wherever/you_saved/xx.txt > xx
umount /doze


On windows you can read dosa.txt from a linux partition if you installed
windows linux file system driver from
http://uranus.it.swin.edu.au/~jn/linux/explore2fs.htm

Remember to remove/uninstall it to allow your Windows Anti Virus
scanner to run faster.
"
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get eth0 up (wired) - e1000 device eth0 does not seem to be present, delaying initialization. OtisUsenet Linux Networking 2 06-06-2007 02:57 AM
eth0 initialisation fails after Fedora 6 upgrade Adam Lipscombe Linux Networking 3 03-15-2007 12:55 AM
timeout eth0 on disconnected laptop fedora core2 Gary Smith Linux Networking 7 08-26-2004 01:50 PM
Fedora 1 eth0 problem Yvan@office Linux Networking 3 08-02-2004 11:21 AM
Going broadband! Help config eth0/1 and ppp0. pt Linux Networking 14 08-13-2003 02:49 PM



1 2 3 4 5 6 7 8 9 10 11