修改文件 /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

相关文章:

  • 2021-11-01
  • 2022-12-23
  • 2021-05-03
  • 2022-12-23
  • 2021-11-05
  • 2021-09-25
  • 2021-11-18
  • 2021-08-29
猜你喜欢
  • 2022-01-01
  • 2022-01-29
  • 2022-12-23
  • 2021-08-13
  • 2021-08-11
  • 2021-12-19
  • 2021-11-02
相关资源
相似解决方案