Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Network config issues

1 view
Skip to first unread message

dnoyeB

unread,
Jun 16, 2007, 11:39:59 AM6/16/07
to
I just installed my linux box as my internet gateway and I have several
issues I am hoping to clean up.

#1 DNS servers not proper
for some reason I always have trouble getting the DNS servers passed on
properly. Right now I have 1 bogus address as the first address and 1
good address for the 2nd. I have DHCP enabled so it should get addresses
from dchp, but still, its coming back with the one funky address. Such as
69.0.0.2 or 192.0.0.2. I have no idea why its doing this. Its making my
resolution slow.
What I just did was to copy resolv.conf.save overtop resolv.conf. so
resolv.conf now has 2 good addresses in it again. Is this what the system
will use for DNS? will my other computers that share this connection and
get DHCP from this linux box also now use what is in resolv.conf??

i noticed the flaky addresses are in
/etc/sysconfig/setwork-scripts/ifcfg-eth3 and ifcfg-eth2

[root@erasmus network-scripts]# cat ifcfg-eth3
DEVICE=eth3
BOOTPROTO=dhcp
IPADDR=69.246.99.125
NETMASK=255.255.248.0
NETWORK=69.246.96.0
BROADCAST=69.246.103.255
GATEWAY=69.0.0.1
ONBOOT=yes
METRIC=10
MII_NOT_SUPPORTED=no
USERCTL=no
MS_DNS1=69.0.0.2
RESOLV_MODS=yes
IPV6INIT=no
IPV6TO4INIT=no
DHCP_CLIENT=dhclient
NEEDHOSTNAME=no
PEERDNS=yes
PEERYP=yes
PEERNTPD=no

that dns address is bogus. and its also probably not good for gateway
either. whats up with that?

#2 eth# are not right
I changed to a new MB and instead of renaming eth0, mandriva just made an
eth2. I added another net card so now I have eth0, eth2, eth3, eth4 with
eth0 being non-existent but it still appears in various places. I wish I
could get eth4 to become eth0, but I dont know how!? for instance
/etc/iftab has an entry for eth0.

im going to edit out the eth0 entry in modprobe.conf since I think I know
what that does.

#3 dhclients.
I have files dhclient-eth3.conf, dhclient-eth2.conf, dhclient-eht0.conf
I suppose I can just delete dhclient-eth0.conf since there is no eth0. im
doing that.

I appreciate your help in clening up my mess. internet seems fast enough
but name resolution is not good.

Bit Twister

unread,
Jun 16, 2007, 1:14:52 PM6/16/07
to
On Sat, 16 Jun 2007 10:39:59 -0500, dnoyeB wrote:
> I just installed my linux box as my internet gateway and I have several
> issues I am hoping to clean up.
>

First, get into Mandriva Control Center (MCC) stop and disable on boot
for avahi-daemon

Second, find which card is connected to the internet and note it's
HWaddr value (mac address)
Do same for nic for LAN. Example:

$ ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:16:17:57:66:54 <------- mac addy

I want/have eth0 set for my LAN. That way if internet/WAN is down, LAN
still comes up fast on boot/network restarts.

> I added another net card so now I have eth0, eth2, eth3, eth4 with
> eth0 being non-existent but it still appears in various places. I wish I
> could get eth4 to become eth0, but I dont know how!?

My recommendation:
Make sure to have mouse/kb/monitor connected to box in question.
Get into MCC --> network
and delete all connections.

Reboot. linux will assign eth0 to first nic found when it polls the
i/o buss.

in a root terminal
dmesg | grep eth0

Note mac addy --------------------------------.
|
V
eth0: RealTek RTL8139 at 0xf9170000, 00:16:17:57:66:54, IRQ 21
eth0: Identified 8139 chip type 'RTL-8100B/8139D'

Now you know how to configure eth0 in MCC create network connection.
Do same for each nic you want configured.

Still have problems, we need to see what you have. New and inproved
-------- standard debug network problem text/script follows: ------------
dump_net.txt version 3.1


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. Example, internet connection type,
(cable, adsl,,,), it's hardware, (vendor/model of the modem).
Maybe that your system is hooked to a hub/switch/router and type of
hookup, (ethernet,usb, wireless,...), distribution, config file values,... .

We need to see what you have setup.

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

If your problem is slow network give 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 ambidexterous script is for suse, mandriva, ubuntu, kubuntu
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 writting to linux. You can replace it
with http://www.diskinternals.com/linux-reader/ which does not
provide write access if you have not created a FAT partition to
exchange files between OSs.
I do recommend removing the windows/linux file system driver after you get the
linux network up.
Makes your Windows AntiVirus 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 respond 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.


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

For the suse, ubuntu, kubuntu users, sudo $HOME/xx should work.
If xx is not in your home directory, you will have to provide the full
path in place of $HOME. Example: sudo /some/where/xx

------------------ Script starts below this line -----------------------
#!/bin/bash
#******** start of xx.txt script ****************

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

function cat_fn
{
_fn=$1
if [ -f $_fn ] ; then
_count=$(stat -c %s $_fn )
if [ $_count -gt 0 ] ; then
echo ======== cat $_fn ========== >> $_out_fn
cat $_fn >> $_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 "======== 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
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
fi
} # end ls_dir

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

#********************************
# check if commands are in $PATH
# and if not add them path 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"
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 " "
exit 1
fi


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


echo "Working, output will be in $_out_fn "

date > $_out_fn
chmod 666 $_out_fn

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

cat_fn /etc/product.id

echo ======== cat /etc/*release ========== >> $_out_fn
cat /etc/*release >> $_out_fn 2>&1

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

echo ======== cat /etc/*version ========== >> $_out_fn
cat /etc/*version >> $_out_fn 2>&1

echo ======== cat /proc/version ========== >> $_out_fn
cat /proc/*version >> $_out_fn 2>&1

type lsb_release > /dev/null 2>&1
if [ $? -eq 0 ] ; then
echo ======== lsb_release -a ========== >> $_out_fn
lsb_release -a >> $_out_fn 2>&1
fi

echo " " >> $_out_fn
echo msec security level is $SECURE_LEVEL >> $_out_fn

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

type chkconfig > /dev/null 2>&1
if [ $? -eq 0 ] ; then
echo ======== chkconfig --list ========== >> $_out_fn
for _serv in avahi named tmdns ; 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 >> $_out_fn
fi
done

chkconfig --list >> $_out_fn

else
echo ======== ls -o /etc/rcS.d/ ========== >> $_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

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

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

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 ========== >> $_out_fn
hostname >> $_out_fn

cat_fn /etc/hostname
cat_fn /etc/HOSTNAME

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

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

grep_fn /etc/host.conf

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

cat_fn /etc/iftab
cat_fn /etc/udev/rules.d/61-net_config.rules

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

cat_fn /etc/sysconfig/network/routes

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

echo ============== head -15 /etc/hosts =============== >> $_out_fn
head -15 /etc/hosts >> $_out_fn

cat_fn /etc/network/interfaces
cat_fn /var/run/network/ifstate


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

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

if [ -z "$_cmd" ] ; then
echo ======== mii-tool/ethtool NOT INSTALLED ========== >> $_out_fn
fi

for nic in 0 1 2 ; do

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

cat_fn /etc/sysconfig/network-scripts/ifcfg-eth$nic

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

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

done # end for nic in 0 1 2 ; do

_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
echo ==== cd /etc/network/${_d} ; ls -al === >> $_out_fn
cd /etc/network/${_d}
ls -al >> $_out_fn
done
fi

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

ls_dir /etc/dhcp3/dhclient-exit-hooks.d
ls_dir /etc/resolvconf/update.d


if [ -d /etc/shorewall ] ; then
_count=$(chkconfig --list shorewall | grep -c :on )
if [ $_count -gt 0 ] ; then
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

grep_fn /etc/hosts.allow
grep_fn /etc/hosts.deny
echo "======= end of config/network data dump ===========" >> $_out_fn

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


echo " "
echo "If posting via linux, post contents of $_out_fn"
echo "You might want to copy it to your account with the command"
echo "cp $_out_fn ~your_login"
echo " "
echo "If posting via windows, post contents of $_dos_fn"
echo " "
echo "If using diskette,"
echo "Copy $_dos_fn to diskette with the following commands:"
echo " "
echo "mkdir -p /floppy"
echo "mount -t auto /dev/fd0 /floppy"
echo "cp $_dos_fn /floppy"
echo "umount /floppy "
echo " "
echo "and $_dos_fn is ready for windows from diskette"
echo " "

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

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 elses.

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.

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

mkdir -p /doze
mount -t auto /dev/hda1 /doze
tr -d '\015' < "/doze/whever/you saved/xx.txt" > xx
umount /doze

On windows you can read dosa.txt from a linux partition if you installed
windows linux filesystem driver from
http://uranus.it.swin.edu.au/~jn/linux/explore2fs.htm
Remember to remove it to allow your Windows AntiVirus scanner to run faster.

Wes Newell

unread,
Jun 16, 2007, 2:47:20 PM6/16/07
to
On Sat, 16 Jun 2007 10:39:59 -0500, dnoyeB wrote:

> I just installed my linux box as my internet gateway and I have several
> issues I am hoping to clean up.

Do yourself a favor and spend $10 for a router. Problems solved.

--
Want the ultimate in free OTA SD/HDTV Recorder? http://mythtv.org
http://mysettopbox.tv/knoppmyth.html Usenet alt.video.ptv.mythtv
My server http://wesnewell.no-ip.com/cpu.php
HD Tivo S3 compared http://wesnewell.no-ip.com/mythtivo.htm

dnoyeB

unread,
Jun 16, 2007, 3:44:15 PM6/16/07
to
On Sat, 16 Jun 2007 17:14:52 +0000, Bit Twister wrote:

> On Sat, 16 Jun 2007 10:39:59 -0500, dnoyeB wrote:
>> I just installed my linux box as my internet gateway and I have several
>> issues I am hoping to clean up.
>>
>
> First, get into Mandriva Control Center (MCC) stop and disable on boot
> for avahi-daemon
>

what is that for?

> Second, find which card is connected to the internet and note it's
> HWaddr value (mac address)
> Do same for nic for LAN. Example:
>
> $ ifconfig -a
> eth0 Link encap:Ethernet HWaddr 00:16:17:57:66:54 <------- mac addy
>

i got all my mac addresses.

> I want/have eth0 set for my LAN. That way if internet/WAN is down, LAN
> still comes up fast on boot/network restarts.
>
>> I added another net card so now I have eth0, eth2, eth3, eth4 with
>> eth0 being non-existent but it still appears in various places. I wish I
>> could get eth4 to become eth0, but I dont know how!?
>
> My recommendation:
> Make sure to have mouse/kb/monitor connected to box in question.
> Get into MCC --> network
> and delete all connections.
>
> Reboot. linux will assign eth0 to first nic found when it polls the
> i/o buss.
>

nope. it reassignes eth2, eth3 and eth4. I even edited the modprobe.conf
and still it just adds a new entry. after an hour i gave up renaming the
eth.


I just dumped all internet connections and started from scratch.
fortuntely the configs were wiped as well.

The problem I am having now is when I add my internal net as 192.168.0.1,
it changes DNS for all networks to include 192.168.0.2, which is so
fucking stupid. I want the DNS to stay the same. if I delete 2nd nic,
and reinstall first nic, I get DNS from comcast. but as soon as I add 2nd
nic, I get 192.168.0.2 as my first dns server. i could type them in
manually but i dont wanna do that...

let me clean up some stuff and see what happens. im gonna uninstall
guarddog though its claiming to not be doing anything yet.

David W. Hodgins

unread,
Jun 16, 2007, 4:20:20 PM6/16/07
to
On Sat, 16 Jun 2007 15:44:15 -0400, dnoyeB <no...@none.net> wrote:

> nope. it reassignes eth2, eth3 and eth4. I even edited the modprobe.conf
> and still it just adds a new entry. after an hour i gave up renaming the
> eth.

Remove the network connections via mcc.
Remove the entires, if present from modprobe.conf.
Remove the lines with the mac addresses from /etc/iftab (if present),
and from /etc/udev/rules.d/61-net_config.rules

Re-add the connection for the lan, making sure you do no select
"Get dns servers from dhcp". Do not select "Assign host name from
dhcp address". Select advanced, and uncheck the "Get YP servers
from DHCP".

Re-add the connection for the internet, with the "Get dsn servers
from dhp" checked.

Regards, Dave Hodgins

--
Change nomail.afraid.org to ody.ca to reply by email.
(nomail.afraid.org has been set up specifically for
use in usenet. Feel free to use it yourself.)

Gordon

unread,
Jun 17, 2007, 1:37:56 AM6/17/07
to
On Sat, 16 Jun 2007 10:39:59 -0500, dnoyeB wrote:

> #2 eth# are not right
> I changed to a new MB and instead of renaming eth0, mandriva just made
> an eth2.

Get back to MCC, the control ctr, and reconfigure the network interface.

dnoyeB

unread,
Jun 17, 2007, 9:55:54 AM6/17/07
to
On Sat, 16 Jun 2007 16:20:20 -0400, David W. Hodgins wrote:

> On Sat, 16 Jun 2007 15:44:15 -0400, dnoyeB <no...@none.net> wrote:
>
>> nope. it reassignes eth2, eth3 and eth4. I even edited the
>> modprobe.conf and still it just adds a new entry. after an hour i gave
>> up renaming the eth.
>
> Remove the network connections via mcc. Remove the entires, if present
> from modprobe.conf. Remove the lines with the mac addresses from
> /etc/iftab (if present), and from /etc/udev/rules.d/61-net_config.rules
>
>

ahh i see. what the heck is udev? Can I get to that from a GUI? it does
have the eth entries so I can edit that. the modprobe.conf just keeps
coming back when I edit that.


> Re-add the connection for the lan, making sure you do no select "Get dns
> servers from dhcp". Do not select "Assign host name from dhcp address".
> Select advanced, and uncheck the "Get YP servers
> from DHCP".
>
>

i need dns servers from dhcp though.


> Re-add the connection for the internet, with the "Get dsn servers
> from dhp" checked.
>
> Regards, Dave Hodgins
>
>

ahh, ill try it that way. finnicky.

Doug Laidlaw

unread,
Jun 18, 2007, 8:55:53 AM6/18/07
to
dnoyeB wrote:

I had the same problem (adding ethxx connections), using the NIC on my new
Gigabyte motherboard. I fixed it by taking the NIC from my old system and
using that.

Dave, I think that you may have been in that thread??

Doug.

dnoyeB

unread,
Jun 18, 2007, 11:38:39 AM6/18/07
to
On Mon, 18 Jun 2007 22:55:53 +1000, Doug Laidlaw wrote:


> I had the same problem (adding ethxx connections), using the NIC on my
> new Gigabyte motherboard. I fixed it by taking the NIC from my old
> system and using that.
>
> Dave, I think that you may have been in that thread??
>
> Doug.

Its not really a functional problem for me. Just bugging me.

I quit on this anyway after realizing that I need to learn how to
configure NAT, and DHCP, and DNS, plus the firewall stuff. Its too many
technologies to learn at once. maybe what I will do is turn on DHCP to
happen from my linux box as a step one. Then maybe DNS one day.


I keep overlooking that when Linux says 'internet connection sharing' they
do not mean NAT, they mean simply DNS and gateway.

Bit Twister

unread,
Jun 18, 2007, 1:01:50 PM6/18/07
to
On Mon, 18 Jun 2007 10:38:39 -0500, dnoyeB wrote:

> I quit on this anyway after realizing that I need to learn how to
> configure NAT, and DHCP, and DNS, plus the firewall stuff.

Well, my suggestion is to see if cleaning out the suggested files
fixes the problem that David W. Hodgins suggested.

http://groups.google.com/group/alt.os.linux.mandriva/msg/a17cf88ca2bcdf62

Experience in the past has shown me that I save
time fixing problems as I find them even though they do not seem
related to what I was trying to fix in the first place.

You seem about to leave this problem alone, and go try to make
something else work which depends on using ethX. :-(

dnoyeB

unread,
Jun 18, 2007, 1:46:57 PM6/18/07
to

No, there was nothing that did not work because of this. I was simply
annoyed by it. I will perhaps sometime this week clean it up and get my
network cards as eth0 and eth1.

0 new messages