zhangeamon

1.设置Linux内核支持ip数据包的转发

  echo "1" > /proc/sys/net/ipv4/ip_forward

  or 

      vi /etc/sysctl.conf   net.ipv4.ip_forward=1

2.配置双IP

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.6.xx
netmask 255.255.255.0
gateway 192.168.6.1
dns-nameservers 8.8.8.8

auto eth0:0
iface eth0:0 inet static
  address 10.2.0.1
  netmask 255.255.255.0

3.添加IP伪装规则

iptables -t nat -A POSTROUTING -S 192.168.1.0/24 -O eth1 -j MASQUERADE

分类:

技术点:

相关文章:

  • 2022-01-05
  • 2021-11-08
  • 2021-11-26
  • 2021-12-20
  • 2021-09-15
  • 2022-02-28
  • 2021-12-13
  • 2022-12-23
猜你喜欢
  • 2021-06-09
  • 2021-07-01
  • 2023-02-10
  • 2021-04-28
  • 2021-08-25
  • 2021-11-23
  • 2021-10-16
相关资源
相似解决方案