LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 06:53 AM   #1
windstory
Member
 
Registered: Nov 2008
Posts: 486

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:	36
Size:	177.4 KB
ID:	20064  
 
Old 11-17-2015, 08:27 AM   #2
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 2,324
Blog Entries: 1

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
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, 08:53 AM   #3
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,121

Rep: Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270
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, 08:57 AM   #4
windstory
Member
 
Registered: Nov 2008
Posts: 486

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:	15
Size:	112.2 KB
ID:	20065  
 
Old 11-17-2015, 09:20 AM   #5
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora
Posts: 1,687

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
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, 09:37 AM   #6
windstory
Member
 
Registered: Nov 2008
Posts: 486

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 11: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 03: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 12:22 PM
Cannot Change GNOME Menu Items to add/change Item for Mozilla 1.2 After Upgrade metoome General 0 03-27-2004 01:19 AM
Cannot Change GNOME Menu Items to add/change Item for Mozilla 1.3 After Upgrade SForsgren Linux - General 4 03-27-2004 12:43 AM


All times are GMT -5. The time now is 04:31 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration