I plugged my laptop on Ethernet cable with a fix IP address. I shared my WIFI card connection for open a connection to an android device. My Ethernet card device is enp2s0 and my WIFI card device is wlp3s0. I dont have any problem when my network manager service is caring everything. So, I modified my IPTables rules for detect what are the TCP/UDP open needed by Android.So I flushed my default IPTables rules like this :/sbin/iptables -P INPUT ACCEPT/sbin/iptables -P FORWARD ACCEPT/sbin/iptables -P OUTPUT ACCEPT/sbin/iptables -F/sbin/iptables -X/sbin/iptables -t nat -F/sbin/iptables -t nat -X/sbin/iptables -t mangle -F/sbin/iptables -t mangle -X/sbin/iptables -t raw -F /sbin/iptables -t raw -XAnd I applied these rules :iptables -P INPUT DROPiptables -P FORWARD DROPiptables -P OUTPUT DROPiptables -P PREROUTING ACCEPTiptables -P INPUT ACCEPTiptables -P OUTPUT ACCEPTiptables -P POSTROUTING ACCEPTiptables -A POSTROUTING -s 10.42.0.0/24 ! -d 10.42.0.0/24 -o enp2s0 -j MASQUERADEiptables -A INPUT -i lo -j ACCEPTiptables -A INPUT -i enp2s0 -j ACCEPTiptables -A INPUT -i wlp3s0 -p udp -m udp --dport 67 -j ACCEPTiptables -A INPUT -i wlp3s0 -p tcp -m tcp --dport 67 -j ACCEPTiptables -A INPUT -i wlp3s0 -p icmp -m icmp --icmp-type 8 -j ACCEPTiptables -A FORWARD -d 10.42.0.0/24 -o wlp3s0 -m state --state RELATED,ESTABLISHED -j ACCEPTiptables -A FORWARD -s 10.42.0.0/24 -i wlp3s0 -j ACCEPTiptables -A FORWARD -i wlp3s0 -o wlp3s0 -j ACCEPTiptables -A OUTPUT -o lo -j ACCEPTiptables -A OUTPUT -o enp2s0 -j ACCEPTiptables -A OUTPUT -o wlp3s0 -p udp -m udp --sport 67 -j ACCEPTiptables -A OUTPUT -o wlp3s0 -p tcp -m tcp --sport 67 -j ACCEPTiptables -A OUTPUT -o wlp3s0 -p icmp -m icmp --icmp-type 0 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPTThe android device has got the IP address 10.42.0.138When I Tried to ping it I've got these error message :ping 10.42.0.138PING 10.42.0.138 (10.42.0.138) 56(84) bytes of data.ping: sendmsg: Operation not permittedalso I can ping my WIFI card :ping -c2 10.42.0.1PING 10.42.0.1 (10.42.0.1) 56(84) bytes of data.64 bytes from 10.42.0.1: icmp_seq=1 ttl=64 time=0.101 ms64 bytes from 10.42.0.1: icmp_seq=2 ttl=64 time=0.083 ms--- 10.42.0.1 ping statistics ---2 packets transmitted, 2 received, 0% packet loss, time 999msrtt min/avg/max/mdev = 0.083/0.092/0.101/0.009 msWhat did I miss?Thanks for your help
How to ping an interface on shared WIFI laptop
networking;iptables;network interface;ping