Link to home
Start Free TrialLog in
Avatar of syedasimmeesaq
syedasimmeesaqFlag for United States of America

asked on

how to change my ip address in centos 5

I need to change my ip address, DNS , gateway and subnet mask in my centos. How would I do it from command prompt.
Also what is broadcast ip?
thanks
ASKER CERTIFIED SOLUTION
Avatar of bswinnerton
bswinnerton
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
if your interface is eth0 you need to modify the file:
/etc/sysconfig/network-scripts/ifcfg-eth0

See this link for reference:
http://www.centos.org/docs/5/html/Deployment_Guide-en-US/ch-networkscripts.html
use setup command to control the centos system setting
and selected Network Configuration
Gud luck
setup
(or) use
system-config-network if you are using GUI
(or) use
system-config-network-tui

Open in new window

The broadcast address has the last octet set to 255 only if your netmask is 255.255.255.0. This is usually the case for home users (usually a class C address), but often not the case in a larger network (such as a class B or a subset thereof).

If you understand bitmasks, logical AND, etc. you can calculate the broadcast address. It's not hard. But it's even easier to reference one of the websites on the Internet that'll do it for you such as:

http://www.subnetmask.info/