Operating Systems > Linux and UNIX
ip address
(1/1)
Master of Reality:
how do i change the ip address of a certain ethernet card in Linux redhat?
Master of Reality:
i find it odd that no one knows how to set an IP address. I only know that webmin can do it.
voidmain:
I could have sworn I replied to this. Did you post this question in another forum area or did I just reply to it in another forum area?
The command that configures the ethernet cards (including the IP address) on all Linux systems (and on most other UNIX systems) is "ifconfig". However normally you set the addresses in a configuration file that a script will read and internally use the "ifconfig" command to set the IP address.
In RedHat the configuration files where you set the addresses for all of your network devices reside in /etc/sysconfig/network-scripts. Since you have two ethernet cards you should have two configuration files. One would be called "ifcfg-eth0" and the other called "ifcfg-eth1". Just edit the file assoctiated with the card you want to change and set the variable "IPADDRESS=xxx.xxx.xxx" to whatever you want. If you change eth0 then the command to make it take effect would be:
# ifdown eth0
# ifup eth0
Navigation
[0] Message Index
Go to full version