LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-18-2016, 09:28 AM   #1
kumar v
LQ Newbie
 
Registered: Jan 2016
Posts: 2

Rep: Reputation: Disabled
Not getting external network(internet) from static IP in Cent OS VM


Hi

I have installed the CentOS 7 VM(in VMware) in my laptop. By default IP is generated using dhcp and IP is changing every time. But I need a static IP and I configured static IP by modifying the file /etc/sysconfig/network-scripts. After configuring static IP, I am not able to connect internet from VM. Below is the file, where if I keep static inplace of dhcp, internet is not connecting.

[root@controller1 network-scripts]# cat ifcfg-eno16777736
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
IPADDR=192.168.1.127
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=eno16777736
UUID=95b2da8f-49f8-4f41-8b8b-f459bf9d8e06
DEVICE=eno16777736
ONBOOT=yes
PEERDNS=yes
PEERROUTES=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
[root@controller1 network-scripts]#
 
Old 01-18-2016, 10:50 AM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Why do you have BOOTPROTO=dhcp as well as a manual IP assigned? You need to pick one or the other, you can't set an IP and still tell it to use DHCP. You're also missing a lot of other fields that are required for a static configuration.

Set the following:
NM_CONTROLLED=no
BOOTPROTO=none
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=8.8.8.8
DNS2=8.8.4.4

And remove all of the IPV6 crap, unless you are actually interested in IPv6.

Note that I'm just guessing on netmask and gateway, you should set them to their proper values. If you have a preferred DNS server you should set that too, the ones I added above are Google's DNS.
 
Old 01-18-2016, 12:33 PM   #3
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
In centos7 you can install networkmanager-tui and use the command line nmtui utility to configure NetworkManager network settings. NetworkManager is enabled on centos7 unless you have turned it off.
 
Old 01-19-2016, 06:02 AM   #4
kumar v
LQ Newbie
 
Registered: Jan 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
Its working, thanks

Its working, thanks
 
  


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
cannot mount external ntfs hdd in Cent 6 D3M0L1SHER Linux - Newbie 2 03-03-2013 11:24 AM
setting static IP on linux PCs with no static IP address from internet provider? solvetek Linux - Networking 1 10-22-2011 08:04 AM
Connecting to external network and internet via two gateways GitS Linux - Networking 2 11-18-2009 01:19 AM
Cannot telnet static internet IP from external network nikhil010586 Linux - Server 1 09-01-2009 08:03 AM
static routing question (cent os 4.x server) foilpan Linux - Networking 4 04-13-2009 01:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:24 AM.

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