Why can't I configure a static IP on my CentOS7 system?
my /etc/sysconfig/network-scripts/ifcfg-eth0 is like this:
And I have issued the command "systemctl restart network".
But when I issued "ifconfig", it shows that the ip on eth0 is 192.168.1.117,but I configured it as static ip 192.168.1.210
Then I issued "ip addr" , I did got ip 192.168.1.210, but the ip 192.168.1.117 also appeared, which I don't want to have at all:
How can I handle it?
centos ip
|
show 6 more comments
my /etc/sysconfig/network-scripts/ifcfg-eth0 is like this:
And I have issued the command "systemctl restart network".
But when I issued "ifconfig", it shows that the ip on eth0 is 192.168.1.117,but I configured it as static ip 192.168.1.210
Then I issued "ip addr" , I did got ip 192.168.1.210, but the ip 192.168.1.117 also appeared, which I don't want to have at all:
How can I handle it?
centos ip
what happens if you doifdown eth0; ifup eth0; ip addr
?
– Serge
Jul 4 '16 at 5:40
when I issued "ifdown eth0",it shows that " Could not load file '/etc/sysconfig/network-scripts/ifcfg-eth0' " for 4 times.
– Julian20151006
Jul 4 '16 at 5:49
and when I issued "ifup eth0", it shows " Could not load file '/etc/sysconfig/network-scripts/ifcfg-eth0' " for 4 times ,too
– Julian20151006
Jul 4 '16 at 5:50
Then check if the file exist and its permissions first.
– Serge
Jul 4 '16 at 5:51
then I issued " ip addr ", it shows that "inet 192.168.1.117/24" and "192.168.1.210/24" and "inet6 fe80::20c:29ff:fee6:d6f3/64" are all under eth0
– Julian20151006
Jul 4 '16 at 5:52
|
show 6 more comments
my /etc/sysconfig/network-scripts/ifcfg-eth0 is like this:
And I have issued the command "systemctl restart network".
But when I issued "ifconfig", it shows that the ip on eth0 is 192.168.1.117,but I configured it as static ip 192.168.1.210
Then I issued "ip addr" , I did got ip 192.168.1.210, but the ip 192.168.1.117 also appeared, which I don't want to have at all:
How can I handle it?
centos ip
my /etc/sysconfig/network-scripts/ifcfg-eth0 is like this:
And I have issued the command "systemctl restart network".
But when I issued "ifconfig", it shows that the ip on eth0 is 192.168.1.117,but I configured it as static ip 192.168.1.210
Then I issued "ip addr" , I did got ip 192.168.1.210, but the ip 192.168.1.117 also appeared, which I don't want to have at all:
How can I handle it?
centos ip
centos ip
asked Jul 4 '16 at 5:34
Julian20151006
615
615
what happens if you doifdown eth0; ifup eth0; ip addr
?
– Serge
Jul 4 '16 at 5:40
when I issued "ifdown eth0",it shows that " Could not load file '/etc/sysconfig/network-scripts/ifcfg-eth0' " for 4 times.
– Julian20151006
Jul 4 '16 at 5:49
and when I issued "ifup eth0", it shows " Could not load file '/etc/sysconfig/network-scripts/ifcfg-eth0' " for 4 times ,too
– Julian20151006
Jul 4 '16 at 5:50
Then check if the file exist and its permissions first.
– Serge
Jul 4 '16 at 5:51
then I issued " ip addr ", it shows that "inet 192.168.1.117/24" and "192.168.1.210/24" and "inet6 fe80::20c:29ff:fee6:d6f3/64" are all under eth0
– Julian20151006
Jul 4 '16 at 5:52
|
show 6 more comments
what happens if you doifdown eth0; ifup eth0; ip addr
?
– Serge
Jul 4 '16 at 5:40
when I issued "ifdown eth0",it shows that " Could not load file '/etc/sysconfig/network-scripts/ifcfg-eth0' " for 4 times.
– Julian20151006
Jul 4 '16 at 5:49
and when I issued "ifup eth0", it shows " Could not load file '/etc/sysconfig/network-scripts/ifcfg-eth0' " for 4 times ,too
– Julian20151006
Jul 4 '16 at 5:50
Then check if the file exist and its permissions first.
– Serge
Jul 4 '16 at 5:51
then I issued " ip addr ", it shows that "inet 192.168.1.117/24" and "192.168.1.210/24" and "inet6 fe80::20c:29ff:fee6:d6f3/64" are all under eth0
– Julian20151006
Jul 4 '16 at 5:52
what happens if you do
ifdown eth0; ifup eth0; ip addr
?– Serge
Jul 4 '16 at 5:40
what happens if you do
ifdown eth0; ifup eth0; ip addr
?– Serge
Jul 4 '16 at 5:40
when I issued "ifdown eth0",it shows that " Could not load file '/etc/sysconfig/network-scripts/ifcfg-eth0' " for 4 times.
– Julian20151006
Jul 4 '16 at 5:49
when I issued "ifdown eth0",it shows that " Could not load file '/etc/sysconfig/network-scripts/ifcfg-eth0' " for 4 times.
– Julian20151006
Jul 4 '16 at 5:49
and when I issued "ifup eth0", it shows " Could not load file '/etc/sysconfig/network-scripts/ifcfg-eth0' " for 4 times ,too
– Julian20151006
Jul 4 '16 at 5:50
and when I issued "ifup eth0", it shows " Could not load file '/etc/sysconfig/network-scripts/ifcfg-eth0' " for 4 times ,too
– Julian20151006
Jul 4 '16 at 5:50
Then check if the file exist and its permissions first.
– Serge
Jul 4 '16 at 5:51
Then check if the file exist and its permissions first.
– Serge
Jul 4 '16 at 5:51
then I issued " ip addr ", it shows that "inet 192.168.1.117/24" and "192.168.1.210/24" and "inet6 fe80::20c:29ff:fee6:d6f3/64" are all under eth0
– Julian20151006
Jul 4 '16 at 5:52
then I issued " ip addr ", it shows that "inet 192.168.1.117/24" and "192.168.1.210/24" and "inet6 fe80::20c:29ff:fee6:d6f3/64" are all under eth0
– Julian20151006
Jul 4 '16 at 5:52
|
show 6 more comments
3 Answers
3
active
oldest
votes
In the /etc/sysconfig/network-scripts/ifcfg-eth0
change BOOTPROTO
to none
instead of static
then restart network using systemctl restart network
BOOTPROTO doesn't support static
, it should be either none
, bootp
or dhcp
https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-networkscripts-interfaces.html
add a comment |
This is due to NetworkManager service probably being still in use (on CentOS 7).
You need to either disable entirely NetworkManager (recommended on servers) :
systemctl disable NetworkManager && systemctl stop NetworkManager && service network restart && chkconfig network on
or disable NetworkManager being active on this interface (recommended for desktop), by adding
NM_CONTROLLED=no
to your ifcfg-eth0
file.
yeah, your answer is like @Rahul's answers. Thank you!
– Julian20151006
Jul 5 '16 at 5:14
add a comment |
Be aware to specify your GATEWAY correctly, maybe you entered the Subnet IP address.
You need to add a gateway IP that is usually one number higher than it.
So check your IP with an online calculator tool (e.g. this one) and find the correct gateway.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f293689%2fwhy-cant-i-configure-a-static-ip-on-my-centos7-system%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
In the /etc/sysconfig/network-scripts/ifcfg-eth0
change BOOTPROTO
to none
instead of static
then restart network using systemctl restart network
BOOTPROTO doesn't support static
, it should be either none
, bootp
or dhcp
https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-networkscripts-interfaces.html
add a comment |
In the /etc/sysconfig/network-scripts/ifcfg-eth0
change BOOTPROTO
to none
instead of static
then restart network using systemctl restart network
BOOTPROTO doesn't support static
, it should be either none
, bootp
or dhcp
https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-networkscripts-interfaces.html
add a comment |
In the /etc/sysconfig/network-scripts/ifcfg-eth0
change BOOTPROTO
to none
instead of static
then restart network using systemctl restart network
BOOTPROTO doesn't support static
, it should be either none
, bootp
or dhcp
https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-networkscripts-interfaces.html
In the /etc/sysconfig/network-scripts/ifcfg-eth0
change BOOTPROTO
to none
instead of static
then restart network using systemctl restart network
BOOTPROTO doesn't support static
, it should be either none
, bootp
or dhcp
https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-networkscripts-interfaces.html
answered Jul 4 '16 at 5:50
SomeGuy
212112
212112
add a comment |
add a comment |
This is due to NetworkManager service probably being still in use (on CentOS 7).
You need to either disable entirely NetworkManager (recommended on servers) :
systemctl disable NetworkManager && systemctl stop NetworkManager && service network restart && chkconfig network on
or disable NetworkManager being active on this interface (recommended for desktop), by adding
NM_CONTROLLED=no
to your ifcfg-eth0
file.
yeah, your answer is like @Rahul's answers. Thank you!
– Julian20151006
Jul 5 '16 at 5:14
add a comment |
This is due to NetworkManager service probably being still in use (on CentOS 7).
You need to either disable entirely NetworkManager (recommended on servers) :
systemctl disable NetworkManager && systemctl stop NetworkManager && service network restart && chkconfig network on
or disable NetworkManager being active on this interface (recommended for desktop), by adding
NM_CONTROLLED=no
to your ifcfg-eth0
file.
yeah, your answer is like @Rahul's answers. Thank you!
– Julian20151006
Jul 5 '16 at 5:14
add a comment |
This is due to NetworkManager service probably being still in use (on CentOS 7).
You need to either disable entirely NetworkManager (recommended on servers) :
systemctl disable NetworkManager && systemctl stop NetworkManager && service network restart && chkconfig network on
or disable NetworkManager being active on this interface (recommended for desktop), by adding
NM_CONTROLLED=no
to your ifcfg-eth0
file.
This is due to NetworkManager service probably being still in use (on CentOS 7).
You need to either disable entirely NetworkManager (recommended on servers) :
systemctl disable NetworkManager && systemctl stop NetworkManager && service network restart && chkconfig network on
or disable NetworkManager being active on this interface (recommended for desktop), by adding
NM_CONTROLLED=no
to your ifcfg-eth0
file.
edited Jul 4 '16 at 13:37
dr01
15.9k114970
15.9k114970
answered Jul 4 '16 at 13:09
Bruno Mairlot
29623
29623
yeah, your answer is like @Rahul's answers. Thank you!
– Julian20151006
Jul 5 '16 at 5:14
add a comment |
yeah, your answer is like @Rahul's answers. Thank you!
– Julian20151006
Jul 5 '16 at 5:14
yeah, your answer is like @Rahul's answers. Thank you!
– Julian20151006
Jul 5 '16 at 5:14
yeah, your answer is like @Rahul's answers. Thank you!
– Julian20151006
Jul 5 '16 at 5:14
add a comment |
Be aware to specify your GATEWAY correctly, maybe you entered the Subnet IP address.
You need to add a gateway IP that is usually one number higher than it.
So check your IP with an online calculator tool (e.g. this one) and find the correct gateway.
add a comment |
Be aware to specify your GATEWAY correctly, maybe you entered the Subnet IP address.
You need to add a gateway IP that is usually one number higher than it.
So check your IP with an online calculator tool (e.g. this one) and find the correct gateway.
add a comment |
Be aware to specify your GATEWAY correctly, maybe you entered the Subnet IP address.
You need to add a gateway IP that is usually one number higher than it.
So check your IP with an online calculator tool (e.g. this one) and find the correct gateway.
Be aware to specify your GATEWAY correctly, maybe you entered the Subnet IP address.
You need to add a gateway IP that is usually one number higher than it.
So check your IP with an online calculator tool (e.g. this one) and find the correct gateway.
edited Dec 18 at 10:49
Glorfindel
2151310
2151310
answered Dec 18 at 10:22
Amin
11
11
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f293689%2fwhy-cant-i-configure-a-static-ip-on-my-centos7-system%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
what happens if you do
ifdown eth0; ifup eth0; ip addr
?– Serge
Jul 4 '16 at 5:40
when I issued "ifdown eth0",it shows that " Could not load file '/etc/sysconfig/network-scripts/ifcfg-eth0' " for 4 times.
– Julian20151006
Jul 4 '16 at 5:49
and when I issued "ifup eth0", it shows " Could not load file '/etc/sysconfig/network-scripts/ifcfg-eth0' " for 4 times ,too
– Julian20151006
Jul 4 '16 at 5:50
Then check if the file exist and its permissions first.
– Serge
Jul 4 '16 at 5:51
then I issued " ip addr ", it shows that "inet 192.168.1.117/24" and "192.168.1.210/24" and "inet6 fe80::20c:29ff:fee6:d6f3/64" are all under eth0
– Julian20151006
Jul 4 '16 at 5:52