Find the answer to your Linux question:
Results 1 to 2 of 2
Hi. 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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2006
    Posts
    17

    How to disable ipv4


    Hi.

    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...

    Code:
    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.

    thanks

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

    Code:
    ip -f inet6 flush eth0
    Got this from typing
    Code:
    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
  •