1

I have a shell script on my linux computer that has these arptables command;

$ cat arptables.sh

mac_address="AA:BB:CC:DD:EE:FF"

arptables -P INPUT DROP
arptables -P OUTPUT DROP

arptables -A INPUT --opcode Request -d 0.0.0.0 -j DROP
arptables -A INPUT --opcode Reply -d 0.0.0.0 -j DROP
arptables -A INPUT --opcode Request -j DROP

arptables -A INPUT -s 192.168.3.1 --source-mac "$mac_address" -j ACCEPT
arptables -A OUTPUT -d 192.168.3.1 -j ACCEPT

Then I added this script at system startup of my PC and it works fine with my previous wifi router. Now, I recently bought a new wifi router and changed the mac_address part of the code to match my new router and it fails to connect to the internet. All my other devices can connect to the internet, since this script isn't running on those devices. Then I removed the opcode portions from the script above and everything worked fine for the new wifi router. However, on the previous router, this entire script works just fine. Would anyone explain what is this opcode part. I read on an article couple years back that opcode could prevent spoofing mac addresses so they suggested this code. So I added the opcode portion to my script.

2
  • @shellter it's double quoted on my pc, forgot to include double quotes here. Edited the code. Commented Mar 19 at 22:47
  • Well, sorry, -v(vv) is about all I've got, not an arptables expert at all. I'm surprised at the low number of followers (even linux) for your tags. If you can sort the tag list by number of followers, add one that has some relevance with a higher follower count. Commented Mar 19 at 23:17

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.