• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

problem with netcfg

I'm running Red Hat 4.1 and I need to connect my machine to
the the Internet via Ethernet and specify a permanent IP address. So I ran netcfg (from the Control Panel), made some changes, bur it didn't work. The next time I ran netcfg, and ever since, the following happens:
------------------------------------------------------------
[root@hoodbu /root]# netcfg
Red Hat Linux netcfg 2.13
Copyright (C) 1996 Red Hat Software
Redistributable under the terms of the GNU General Public License
Traceback (innermost last):
  File "/usr/lib/rhs/netcfg/netcfg.py", line 1567, in ?
    win = WindowFrame(Toplevel())
  File "/usr/lib/rhs/netcfg/netcfg.py", line 1535, in __init__
    self.G = GV()
  File "/usr/lib/rhs/netcfg/netcfg.py", line 94, in __init__
    self.ESStaticRoutes = ConfESStaticRoutes()
  File "/usr/lib/rhs/python/Conf.py", line 443, in __init__
    Conf.__init__(self, '/etc/sysconfig/static-routes', '#', '\t ', ' ')
  File "/usr/lib/rhs/python/Conf.py", line 110, in __init__
    self.read()
  File "/usr/lib/rhs/python/Conf.py", line 446, in read
    self.initvars()
  File "/usr/lib/rhs/python/Conf.py", line 455, in initvars
    self.vars[var[0]].append([var[2], var[4], var[6]])
KeyError:
[root@hoodbu /root]#
------------------------------------------------------------
How do I get past this and run netcfg so that I can at least view the settings before I can change them?
0
Pakman
Asked:
Pakman
1 Solution
 
sauronCommented:
Netcfg is a Python app, and I've never used it, so I can't really help you directly with it.

To see your current IP address, run ifconfig. Look at the details for eth0 - this will have your IP address, broadcast address, and netmask specified.
Doing a route -n will show you the current state of the routing table.

To change your IP address etc, you need to do a few things.

Look at /etc/sysconfig/network - in here you set the host name, default gateway, and gateway device. Your gateway device should probably be eth0 (if there's a router on your network), and the gateway IP is the address of the router.

Then, look at /etc/sysconfig/network-scripts/ifcfg-eth0

Here you need to set the IP address, Network address, Broadcast address, and subnet mask for the eth0 adapter.

When you've done all this, do

/etc/rc.d/init.d/network stop, followed by:-
/etc/rc.d/init.d/network start

and you should have your new IP address, and routing table sorted out. You don't even have to reboot. Isn't Linux wonderful ;-)


0
 
PakmanAuthor Commented:
That didn't help at all. I know enough of networking. What I'm having difficulty in running netcfg on Red Hat 4.1. I still get that error message. Now I can modify /etc/sysconfig/network to change the gateway device, but there is no /etc/sysconfig/network-scripts/ifcfg-eth0 on my system. Also, ifconfig and route are not available (no command for them). I'm increasing the value of this question, so I'd like a pretty decent answer.
0
 
saliyaCommented:
Try running /sbin/route and /sbin/ifconfig since they may not be in your path (but are definitely there in RedHat 4-1 with Networking enabled).

Check your system logfiles since the error messages you list don't make much sense on their own. It looks like it is having trouble parsing your existing configuration files, so removing them and restarting may be the only solution...
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
n3mtrCommented:
Check your netcfg, and python packages:
rpm -V netcfg
rpm -V python
rpm -V pythonlib
if any of them report errors reinstall them.

It could also be corrupt config files that is causing the problem.(at least netcfg thinks they are) Sometimes these redhat programs don't like it if we edit them by hand.
0
 
PakmanAuthor Commented:
Its ok, I reinstalled them. Works now. Thanks.
0
 
n3mtrCommented:
Ok, then you will not mind giving me the points.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now