首页 > 系统服务 > 详细

ubuntu 开启ip转发的方法

时间:2021-04-18 21:36:35      阅读:14      评论:0      收藏:0      [点我收藏+]

ubuntu 开启网关转发

修改文件 /etc/sysctl.conf

cat /etc/sysctl.conf

  1. 找到 net.ipv4.ip_forward=1 这一行,取消注释既可
nano /etc/sysctl.conf
##############################################################3
# Functions previously found in netbase
#

# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks
#net.ipv4.conf.default.rp_filter=1
#net.ipv4.conf.all.rp_filter=1

# Uncomment the next line to enable TCP/IP SYN cookies
# See http://lwn.net/Articles/277146/
# Note: This may impact IPv6 TCP sessions too
#net.ipv4.tcp_syncookies=1

# Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.ip_forward=1

# Uncomment the next line to enable packet forwarding for IPv6
#  Enabling this option disables Stateless Address Autoconfiguration
#  based on Router Advertisements for this host
#net.ipv6.conf.all.forwarding=1


###################################################################

  1. 保存生效
$ sysctl -p

ubuntu 开启ip转发的方法

原文:https://www.cnblogs.com/WNpursue/p/14673922.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!