How to change ip address on Linux server

Hi Experts,

  I have a linux server with a static ip address of 10.10.2.36. I would like to change to a different address. I'm at the following prompt, please note I have no experience with Linux, I just want to change the ip address.

[root@nglinux04]#

frankbustosAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mrcannonCommented:
Each distro has it's own GUI methods however...

this command will set ip address of ethernet adapter eth0 to 192.168.1.5
# ifconfig eth0 192.168.1.5 netmask 255.255.255.0 up
# ifconfig eth0

To make permanent changes to IP address you need to edit configuration file according to your Linux distribution.

0
frankbustosAuthor Commented:

ok, this is my windows ipconfig/all
IP Address. . . . . . . . . . . . : 192.168.89.155
Subnet Mask . . . . . . . . . . . : 255.255.254.0
Default Gateway . . . . . . . . . : 192.168.88.1
DHCP Server . . . . . . . . . . . : 192.168.88.12
DNS Servers . . . . . . . . . . . : 192.168.88.2
                                    172.21.0.12
                                    172.21.1.10
Primary WINS Server . . . . . . . : 10.2.102.4
Secondary WINS Server . . . . . . : 10.2.102.5


I  typed in this command #root: vi /etc/sysconfig/network-scripts/ifcfg-eth0 and I'm now editing but need to know the broadcast address and network address?
0
aleghartCommented:
Network address is x.x.x.0
Broadcast address is x.x.x.255

All the numbers from x.x.x.1 - 254 are for your use on the LAN.
0
Acronis Data Cloud 7.8 Enhances Cyber Protection

A closer look at five essential enhancements that benefit end-users and help MSPs take their cloud data protection business further.

furettoCommented:
If you would like linux to reflect your windows configuration, use the following in /etc/sysconfig/network-scripts/ifcfg-eth0

GATEWAY=192.168.88.1
BOOTPROTO=none
TYPE=Ethernet
DEVICE=eth0
NETMASK=255.255.254.0
BROADCAST=192.168.89.255
IPADDR=192.168.89.155
NETWORK=192.168.88.0
DNS1=192.168.88.2
ONBOOT=yes

and this in /etc/sysconfig/network
NETWORKING=yes
GATEWAY=192.168.88.1
HOSTNAME=yourhostname
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
expert1010Commented:
The prefered method is not ifconfig now days. It's "ip".

ip addr change 192.168.89.155/23 dev eth0

check with "ip addr" to see that it is correct.

For permanent changes you should do as suggested in /etc/.....

To get the broadcast address and such install sipcalc and do this.

sipcalc 192.168.89.155 255.255.254.0
or
sipcalc 192.168.89.155/23

You'll get this
-[ipv4 : 192.168.89.155/23] - 0

[CIDR]
Host address            - 192.168.89.155
Host address (decimal)  - 3232258459
Host address (hex)      - C0A8599B
Network address         - 192.168.88.0
Network mask            - 255.255.254.0
Network mask (bits)     - 23
Network mask (hex)      - FFFFFE00
Broadcast address       - 192.168.89.255
Cisco wildcard          - 0.0.1.255
Addresses in network    - 512
Network range           - 192.168.88.0 - 192.168.89.255
Usable range            - 192.168.88.1 - 192.168.89.254


If you're on a debian-based thing do this:
apt-get install sipcalc

suse:
zypper in sipcalc

on red had/centos/fedora you already have ipcalc
do this and you'll get almost the same result
ipcalc 192.168.0.1/23
0
joolsSenior Systems AdministratorCommented:
you dont have to enter the broadcast and network addresses, the system can work them out for you.
0
frankbustosAuthor Commented:
thanks for your expert help!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.