LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-17-2015, 05:53 AM   #1
windstory
Member
 
Registered: Nov 2008
Posts: 489

Rep: Reputation: 36
how to change ip?


My box is Centos 7.1 x64 as guest on windows 10 x64 as host.

I installed Centos several times, because when I change network ip or mac address Centos could not connect with internet.

This is the photo after centos was instaled.


Any helpful comments would be appreciated.
Thanks in advance.
Attached Thumbnails
Click image for larger version

Name:	ifconfig.jpg
Views:	41
Size:	177.4 KB
ID:	20064  
 
Old 11-17-2015, 07:27 AM   #2
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
As root (or with sudo)

# ifconfig eth0 192.168.1.2 netmask 255.255.255.0

Where eth0 is the interface name "ifconfig -a". And 192.168.1.2 is the IP you want to change it to. Although many times DHCP sets that up for you. With dhcpcd or dhclient depending on what your distro has and what you prefer. There's also routing that need to be setup. Which is handled for you with DHCP. There's also "ip" which is the new way of doing what ifconfig and stuff does, but I'm not that versed about it, other than it exists. And I sometimes need to use it to force IPv4 on the wifi device.

# route add default gw 192.168.1.1

Although it's more likely that dhcp is setup.

# dhclient -v eth0
 
1 members found this post helpful.
Old 11-17-2015, 07:53 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
you gave almost no information. Especially: how did you configure your network during installation? How did you try to change that IP? What kind of VM do you use? How is it configured (network related settings)?
 
Old 11-17-2015, 07:57 AM   #4
windstory
Member
 
Registered: Nov 2008
Posts: 489

Original Poster
Rep: Reputation: 36
Shadow_7/

I tried the 3 commands and the results are at the attached photo.
Attached Thumbnails
Click image for larger version

Name:	ifconfig2.jpg
Views:	20
Size:	112.2 KB
ID:	20065  
 
Old 11-17-2015, 08:20 AM   #5
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by windstory View Post
Shadow_7/

I tried the 3 commands and the results are at the attached photo.
It looks like your DHCP server is not accessible or not answering.

My suggestion: Read the documentation.
 
1 members found this post helpful.
Old 11-17-2015, 08:37 AM   #6
windstory
Member
 
Registered: Nov 2008
Posts: 489

Original Poster
Rep: Reputation: 36
berndbausch/


L got a hint from your comment, and I did "systemctl restart network" and reboot, then internet access problem was solved.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How can I change file permissions in windows ntfs partition.Even root can't change it e3399 Linux - Newbie 3 03-02-2011 10:54 PM
WEP Encryption Key:26chars_what choices must change in ubuntu 9.10 for the new change lse123 Linux - Newbie 1 03-02-2010 02:38 AM
is there a linux 'change' prog (like old dos 1) for quick change of text in files? johnemac General 2 06-15-2009 11:22 AM
Cannot Change GNOME Menu Items to add/change Item for Mozilla 1.2 After Upgrade metoome General 0 03-27-2004 12:19 AM
Cannot Change GNOME Menu Items to add/change Item for Mozilla 1.3 After Upgrade SForsgren Linux - General 4 03-26-2004 11:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration