docker起动报错IPv4 forwarding is disabled

[root@corpse ~]#docker run -it tomcat:latest
WARNING: IPv4 forwarding is disabled. Networking will not work.
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /usr/local/openjdk-11
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar

方法:

# vim /usr/lib/sysctl.d/00-system.conf

添加:net.ipv4.ip_forward=1

Linux的内核参数net.ipv4.ip_forward参数指定了Linux系统当前对路由转发功能的支持情况;其值为0时表示禁止进行IP转发;是1,IP转发功能已经打开。

[root@corpse ~]# echo "net.ipv4.ip_forward=1" >>/usr/lib/sysctl.d/00-system.conf
 

[root@corpse ~]# systemctl  restart network
 

{\color{Red} }
 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值