Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How to disable IPv4 on OVZ?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How to disable IPv4 on OVZ?

RurikoRuriko Member
edited April 6 in Help

How do you disable ipv4 on ovz container ubuntu 22.04? I just want to make it ipv6 only but I don't want to remove ipv4 permanently since I may need it to use it for downloading updates.

Comments

  • yoursunnyyoursunny Member, IPv6 Advocate

    ip -4 addr flush

    Thanked by 2ehab kevinds
  • RurikoRuriko Member

    @yoursunny said:
    ip -4 addr flush

    how do I add back ipv4?

  • MumblyMumbly Member
    edited April 6

    Check your network settings and save them before flush may be the easiest way :P

  • kevindskevinds Member, LIR

    @Ruriko said:
    How do you disable ipv4 on ovz container ubuntu 22.04? I just want to make it ipv6 only but I don't want to remove ipv4 permanently since I may need it to use it for downloading updates.

    I would advise not doing that... 127.0.0.0/8 is used for a lot of things.

  • MumblyMumbly Member

    Again ... network settings.
    Open with editor /etc/network/interfacesor wherever are your networking settings, remove IP and restart network service /etc/init.d/networking restart

  • RurikoRuriko Member

    @kevinds said: I would advise not doing that... 127.0.0.0/8 is used for a lot of things.

    well if you know other solutions to hide ipv4 when browsing the internet, I'm happy to hear them cause I run squid proxy server

  • kevindskevinds Member, LIR

    @Ruriko said: well if you know other solutions to hide ipv4 when browsing the internet, I'm happy to hear them cause I run squid proxy server

    If that is your goal, just remove the IPv4 gateways.

    Thanked by 1totally_not_banned
  • RurikoRuriko Member

    How do I make these changes permanent? cause the settings reset when I reboot

  • kevindskevinds Member, LIR
    edited April 7

    @Ruriko said:
    How do I make these changes permanent? cause the settings reset when I reboot

    Edit the network config file..

  • Tell host to unplug ethernet cables

    Thanked by 1totally_not_banned
  • @Ruriko said:
    How do you disable ipv4 on ovz container ubuntu 22.04? I just want to make it ipv6 only but I don't want to remove ipv4 permanently since I may need it to use it for downloading updates.

    Edit the file /etc/sysctl.conf and add the line "net.ipv4.conf.all.disable_ipv4=1". Then run the command "sudo sysctl -p" to apply the change.

  • cochoncochon Member

    @Ruriko said:

    @kevinds said: I would advise not doing that... 127.0.0.0/8 is used for a lot of things.

    well if you know other solutions to hide ipv4 when browsing the internet, I'm happy to hear them cause I run squid proxy server

    Is that just to prevent unwanted clients connecting to the proxy? or to hide your identity? Surely a chunk of the internet you want to access is still IPv4 only and you won't be able to connect to that.

    Configuring acls in squid.conf to disallow IPv4 connections would seem far less extreme.

  • kevindskevinds Member, LIR

    @greenhost_cloud said:
    Edit the file /etc/sysctl.conf and add the line "net.ipv4.conf.all.disable_ipv4=1". Then run the command "sudo sysctl -p" to apply the change.

    Again, I would advise against doing that.. A lot of internal processes use 127.0.0.0/8 and localhost as whatever non loopback IP is on the system.

  • edited April 16

    @kevinds said:

    @greenhost_cloud said:
    Edit the file /etc/sysctl.conf and add the line "net.ipv4.conf.all.disable_ipv4=1". Then run the command "sudo sysctl -p" to apply the change.

    Again, I would advise against doing that.. A lot of internal processes use 127.0.0.0/8 and localhost as whatever non loopback IP is on the system.

    Yeah, doing that for ipv6 is pretty safe as nothing is really written to assume it's presence but with v4 id be a little more cautious. Expect to not get a lot of useful logs (if there'll be any at all) when something "realizes" (or really 100% unexpectedly sees some syscall fail) that it can't bind to 127.0.0.1 and/or friends.

Sign In or Register to comment.