Showing results for 
Search instead for 
Did you mean: 

network configuration

Go to solution

network configuration

I finally have my Linux box up and running. But I want to switch IP addresses on a regular basis.

I have only one Ether card and I have to switch between Internet and intranet IP's. I know how to change IP's using netcfg. But what I would like to know is how can I do it from the "#" prompt without GUI. WHich files should be changed and what are the commands I have to run along with syntax.

If somebody can tell me it would be most helpfull. It would also be helpful if somebody can tell me how to change IP's on an OPENBSD machine.


Honored Contributor

Re: network configuration


If you are using RedHat (or similar) distribution, your network configuration is stored under
See /etc/sysconfig/network and /etc/sysconfig/network-script/ifcfg-eth0

and /etc/hosts, /etc/resolv.conf are also important.


masanari iida
Santosh Nair_1
Honored Contributor

Re: network configuration

(Again on redhat systems) Alternatively, run the /sbin/netconf script with will set all the necessary files based on your responses. This program runs in a screen oriented GUI if X is not up.

Life is what's happening while you're busy making other plans

Re: network configuration

thankx guys that was helpful.

Hope somebody can answer my OPenbsd question.

Timo Rajala
Occasional Visitor

Re: network configuration

The IP information for network interfaces on OpenBSD are stored in the /etc/hostname.* -files.

Run 'man hostname.if' and 'man afterboot' for instructions.

Timo Rajala
dirk dierickx
Honored Contributor

Re: network configuration

You could also try to bind two IP addresses to one card.
(Aliases) that way, when you switch the cable, it should work automaticly.
It is not a clean solution, but a laisy one :)