Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    How to disable ipv4


    I am writing a small C application that uses BASH scripts. This application gives a user the ability to use ipv4 only or ipv6 only or both at the same time.

    How can I disable ipv4?

    I don't want to remove ipv4 from the kernel. I just want to disable it where it cannot be used or pinged.

    If I run...

    ip address flush eth0
    both ipv4 and ipv6 addresses get flushed.

    How do I just disable the IPv4 address and leave the IPv6.

    And how do I disable the IPv6 and leave the IPv4 address.


  2. #2
    Just Joined! ironduke's Avatar
    Join Date
    Sep 2006
    Brisbane Queensland Australia
    I haven't tried it myself but you could try using the -f[amily] option.
    For IPv4 use
    ip -f inet flush eth0
    or to flush the IPv6 address

    ip -f inet6 flush eth0
    Got this from typing
    ip help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts