`
Donald_Draper
  • 浏览: 971857 次
社区版块
存档分类
最新评论

Ubuntu关闭Ipv6

阅读更多
查看端口:
donald_draper@rain:~$ netstat -ntlp
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.1.1:53            0.0.0.0:*               LISTEN      -              
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -              
tcp6       0      0 ::1:631                 :::*                    LISTEN      -
查看ipv6状态:
#显示0说明ipv6开启,1说明关闭
donald_draper@rain:~$ cat /proc/sys/net/ipv6/conf/all/disable_ipv6
0
在 /etc/sysctl.conf 增加下面几行
#disable IPv6
donald_draper@rain:~$ sudo vim  /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
donald_draper@rain:~$ tail -n 3 /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

将文件中的  GRUB_CMDLINE_LINUX_DEFAULT="quiet spalsh"  修改为
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 quiet splash"
donald_draper@rain:~$  sudo vim  /etc/default/grub
donald_draper@rain:~$ cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 quiet splash"
GRUB_CMDLINE_LINUX=""

运行sudo update-grub更新
donald_draper@rain:~$ sudo update-grub
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.2.0-16-generic
Found initrd image: /boot/initrd.img-4.2.0-16-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
重启网络服务,禁用ipv6成功
donald_draper@rain:~$ netstat -ntup
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:47154         127.0.0.1:631           ESTABLISHED -              
tcp        0      0 127.0.0.1:47156         127.0.0.1:631           ESTABLISHED -              
tcp        0      0 127.0.0.1:631           127.0.0.1:47156         ESTABLISHED -              
tcp        0      0 127.0.0.1:631           127.0.0.1:47154         ESTABLISHED -              
donald_draper@rain:~$ ifconfig
eno16777736 Link encap:Ethernet  HWaddr 00:0c:29:39:44:61 
          inet addr:192.168.126.135  Bcast:192.168.126.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:104 errors:0 dropped:0 overruns:0 frame:0
          TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:8278 (8.2 KB)  TX bytes:5534 (5.5 KB)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:213 errors:0 dropped:0 overruns:0 frame:0
          TX packets:213 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:18820 (18.8 KB)  TX bytes:18820 (18.8 KB)


关于SSH IP6关闭,参见:
https://www.jb51.net/LINUXjishu/335724.html

还有一个cups的打印服务关闭:
参见:
https://unix.stackexchange.com/questions/177458/remove-cupsd-completly

分享到:
评论

相关推荐

    局域网内ubuntu上网问题及网络显示已经连接,可是却打不开网页.docx

    ubuntu局域网内上网问题解决方案 一、双系统下ubuntu上网问题解决方案 在企业或者某些办公地方,局域网内的电脑只能有一个IP地址,所以在安装了双系统之后,需要解决上网问题。首先,需要记住自己Windows系统下的...

    ubuntu界面网络配置操作.doc

    配置完成后,关闭当前的网络连接,然后重新连接。可以通过点击网络图标并选择已配置的连接来实现。连接成功后,可以运行`ping`命令测试网络连通性,例如`ping www.baidu.com`。如果能收到返回的数据包,那么网络配置...

    Ubuntu命令技巧.pdf

    **7.4 临时关闭一个服务** - 使用 `systemctl stop <service>.service` 命令临时停止服务。 **7.5 临时启动一个服务** - 使用 `systemctl start <service>.service` 命令临时启动服务。 #### 八、用户管理 **8.1 ...

    Ubuntu 下安装和配置 FTP服务器

    - `listen_ipv6=YES`:监听IPv6(根据网络情况调整) - `pam_service_name=vsftpd`:指定PAM验证服务名 - `userlist_enable=YES`:启用用户列表功能 - `tcp_wrappers=YES`:启用TCP包装器 用户列表文件`/etc/vsftpd...

    在 Ubuntu 中使用 NTP 进行时间同步设置

    此外,还可以使用IPv6地址的NTP服务器,如`ipv6.ntp.ubuntu.com`,但这并不是默认配置。 #### 五、总结 在Ubuntu中使用NTP进行时间同步是非常重要的,尤其是在分布式环境中,它可以帮助确保所有节点上的时间一致。...

    ubuntu服务器搭建ftp整理

    - `listen_ipv6=YES`:启用IPv6监听支持。 - `anonymous_enable=NO`:禁用匿名登录。 - `local_enable=YES`:启用本地用户登录。 - `local_root=/home/ftp`:指定本地用户的根目录。 - `write_enable=YES`:...

    ubuntu skills ubuntu命令技巧(pdf格式)

    ##### 7.4 临时关闭一个服务 临时停止服务,可以使用`systemctl stop <service-name>.service`命令。 ##### 7.5 临时启动一个服务 临时启动服务,可以使用`systemctl start <service-name>.service`命令。 #### 八...

    在Ubuntu系统上安装Nginx服务器的简单方法

    本指南将详细介绍如何在Ubuntu上安装Nginx,以及如何管理Nginx服务。 首先,确保你的Ubuntu系统是最新的。在终端中输入以下命令来更新系统软件包列表: ```bash sudo apt update ``` 然后,安装Nginx服务器,使用...

    ubuntu 12.04 安装 Nginx+PHP5 (PHP-FPM) +MySQL主机详解.docx

    listen [::]:80 default_server ipv6only=on; location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php5.5-fpm.sock; } ``` 保存并关闭文件,然后重新加载Nginx配置: ```...

    Android SDK在线更新方法

    IPv6: http://ubuntu.buct6.edu.cn/ 端口:80 上海GDG镜像服务器地址: http://sdk.gdgshanghai.com 端口:8000 使用方法: 启动 Android SDK Manager ,打开主界面,依次选择『Tools』、『Options...』,弹出...

    R4S-OpenWrt:适用于Nanopi R4S的OpenWrt

    (推荐关闭ipv6,默认已关闭ipv6的dns解析,手动可以在DHCP/DNS里的高级设置中调整)4.刷写或升级后遇到任何问题,可以尝试ssh进路由器,输入fuck,回车后等待重启,或可解决,如仍有异常,建议ssh进路由器,输入...

    scripts:我认为有用的脚本集合

    显现禁用IPv6:目的:暂时或永久禁用IPv6兼容性:Debian 10(Buster),Ubuntu 16.0用法: ./disableipv6.py --help状态:工作中DisableSplash:目的:禁用静默启动和关闭启动屏幕兼容性:Debian 10(Buster),...

    java版电商源码-gogotester_python:由Python提供支持的工具,用于为Goagent和GoProxy查找可用的Googl

    默认ipv6扫描为关闭状态,如有需要请手动开启 Windows Vista + 全部功能可用 (XP只能使用IPv4) Ubuntu 14.04+, lubuntu 15.04 测试通过 OS X 10.9 必须安装2.7.9+的Python才能使用嗯, 安装方法在, 安装完后请用新装...

    UDP 客户端 服务端 网络编程

    - `socket()`函数:创建一个套接字,指定协议族(AF_INET用于IPv4,AF_INET6用于IPv6)和协议(SOCK_DGRAM表示UDP)。 - `bind()`函数:将套接字与本地地址和端口关联。 - `sendto()`函数:将数据发送到指定的...

    校园网在linux下的连接方法

    - 不要关闭终端,稍后还需要使用它来进行其他配置。 3. **配置网络连接**: - 在网络设置中添加一个新的连接,并将其命名为“锐捷校园网”或其他易于识别的名字。 - 对于IPv4设置,选择“自动获取IP地址(DHCP)...

    sysctl:LinuxBSD内核调整和网络安全强化优化,通过优化的sysctl调整提高了服务器系统的性能

    - Debian和Ubuntu:可以使用`sysctl-d`配置文件来区分启动时的不同环境。 - CentOS、Fedora和Red Hat:遵循RHEL最佳实践,调整`/etc/sysconfig/sysctl`中的变量。 - TCP参数在IPv4和IPv6之间的差异,例如`...

    socket tcp.rar_2RU_Sever and client_linux_socket_tcp

    本示例着重讲解了在Linux Ubuntu 16.04操作系统上,使用C语言实现基于TCP协议的socket服务器与客户端之间的通信。TCP(Transmission Control Protocol)是一种面向连接、可靠的传输协议,确保数据在互联网上准确无误...

Global site tag (gtag.js) - Google Analytics