LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 07-13-2017, 09:44 AM   #1
aidylewis
LQ Newbie
 
Registered: Apr 2016
Posts: 25

Rep: Reputation: Disabled
Disable IPv4 on Red Hat 7.3


I am trying to disable IPv4 on Red Hat 7.3. I would have thought this would have been a kernel setting or an ip down on a network interface.

Many Thanks

Aidy
 
Old 07-13-2017, 10:42 AM   #2
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec, CANADA
Distribution: Arch
Posts: 1,234

Rep: Reputation: 451Reputation: 451Reputation: 451Reputation: 451Reputation: 451
Hello aidylewis,

A quick web search yielded this information. I suggest you give it a try.

Code:
Here's how to disable the protocol on a Red Hat-based system:
Open a terminal window.
Change to the root user.
Issue the command sysctl -w net.ipv4.conf.all.disable_ipv4=1.
Issue the command sysctl -w net.ipv4.conf.default.disable_ipv4=1.
Cheers :-)
 
1 members found this post helpful.
Old 07-13-2017, 11:32 AM   #3
aidylewis
LQ Newbie
 
Registered: Apr 2016
Posts: 25

Original Poster
Rep: Reputation: Disabled
Dear Rickkkk

Thanks for your reponse but I made a mistake and I am on Amazon Linux:

Code:
cat /etc/*release
NAME="Amazon Linux AMI"
VERSION="2017.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2017.03"
PRETTY_NAME="Amazon Linux AMI 2017.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2017.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
Amazon Linux AMI release 2017.03
And I receive:
Code:
sudo sysctl -w net.ipv4.conf.all.disable_ipv4=1
error: "net.ipv4.conf.all.disable_ipv4" is an unknown key
Would the kernel be compiled that differently?
 
Old 07-13-2017, 11:39 AM   #4
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Xubuntu
Posts: 5,404

Rep: Reputation: 1881Reputation: 1881Reputation: 1881Reputation: 1881Reputation: 1881Reputation: 1881Reputation: 1881Reputation: 1881Reputation: 1881Reputation: 1881Reputation: 1881
As you see, you were absolutely right to think this was a kernel setting: sysctl gives you considerable (and dangerous!) powers over the kernel.
http://access.redhat.com/documentati...c-dir-sys.html
See also the man pages for proc and sysctl.

Oops! Our posts have crossed! Amazon Linux in a cut-down version of Red Hat. This would work in CentOS, but evidently that bit was thought unnecessary by Amazon.

You could try adding
net.ipv4.conf.all.disable_ipv4=1
net.ipv4.conf.default.disable_ipv4=1
to the end of the file /etc/sysctl.conf and see if that works.

On reflection, I'm not sure that you can disable ipv4 and leave ipv6 in place: I think ipv6 may require some ipv4 code, but this is all a bit beyond me. Usually people want to know how to rempve ipv6. Perhaps you could tell us why you want to do this? There might be another solution to whatever your problem is.

Last edited by DavidMcCann; 07-13-2017 at 11:54 AM. Reason: more information
 
Old 07-13-2017, 11:50 AM   #5
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec, CANADA
Distribution: Arch
Posts: 1,234

Rep: Reputation: 451Reputation: 451Reputation: 451Reputation: 451Reputation: 451
Quote:
Originally Posted by aidylewis View Post
Dear Rickkkk

Thanks for your reponse but I made a mistake and I am on Amazon Linux:


And I receive:
Code:
sudo sysctl -w net.ipv4.conf.all.disable_ipv4=1
error: "net.ipv4.conf.all.disable_ipv4" is an unknown key
Would the kernel be compiled that differently?
Hi again aidylewis,

I believe your best course of action would be to follow DavidMcCann's suggestion to begin with, and read up on the applicable commands for your version of linux.

I am neither a generic RHEL nor Amazon Linux user, so it would be more prudent to wait for/seek advice from members more experienced in those distros. I wouldn't want to lead you astray ... :-)

Cheers.
 
1 members found this post helpful.
  


Reply

Tags
ipv4


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
Howto disable Red Hat Linux Firewall. gardenair Linux - Newbie 11 04-08-2010 01:44 AM
Both IPv4 and IPv6 on Red Hat 9 rmori Linux - Networking 4 03-18-2008 05:19 PM
How disable eth0 in red hat 9.0? dgermann Linux - Networking 4 04-30-2006 07:14 PM
Disable Visual Effects (red hat 9) Jags83 Linux - Newbie 3 07-04-2004 05:17 PM

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

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