linux 开启 proxy arp

What is proxy arp?

When you turn on proxy arp for a network interface card (nic), then it will answer all arp requests with its own ip-address. What does this mean?

  • When a computer wants to send an ip packet it first decides, wether the destination ip address is on the same LAN or the packet must be sent to a router (which must be on the same LAN).
  • Before it can deliver the packet to the LAN, it must know the recipient's Ethernet MAC address.
  • In order to determine the MAC address it sends an ARP broadcast package to the LAN asking "who has ip address a.b.c.d".
  • Normally only the computer with that ip address answers.
  • Proxy arp changes that: A computer doing proxy arp answers all ARP requests with its own MAC address.
  • The asking computer retrieves the MAC address and sends the packet to that computer.

When do you need proxy arp?

Proxy arp is a solution if for some reason you cannot configure a computer or other device on the LAN to use your computer as gateway instead of another one or instead of delivering all packets locally to the LAN.

How is it turned on with Linux?

With one simple command: Let's say your nic is eth1. The command would then be this:

# echo 1 > /proc/sys/net/ipv4/conf/eth1/proxy_arp

Turning it off again is done by:

# echo 0 > /proc/sys/net/ipv4/conf/eth1/proxy_arp

Checking wether it's turned on:

# cat /proc/sys/net/ipv4/conf/eth1/proxy_arp

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值