SIOCADDRT: Operation not permitted

  docker, routes

I’m a newbie with linux and I have a problem I don’t know how to resolve…
I needed to add the routing table to my device with this command:

```sudo ifconfig wlan0mon up 192.168.1.1 netmask 255.255.255.0
    route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1```

I get this:

```SIOCADDRT: Operation not permitted```

What can I do to unlock this command?

So I did find two possible solutions and tried them but for the first command I get:

Code
┌──(kali㉿kali)-[~/fap]
└─$ sudo docker exec --privileged container ip route add default via 192.168.1.0 dev eth0 130 ⨯
sudo: docker: command not found

With the second method I get:

Code
┌──(kali㉿kali)-[~/fap]
└─$ pid=($sudo docker inspect -f '{{.State.Pid}}' container) 127 ⨯

sudo mkdir -p /var/run/netns
sudo ln -s /proc/$pid/ns/net /var/run/netns/$pid

sudo ip netns exec $pid ip route add default via 192.168.1.0
ln: target 'container': No such file or directory
Cannot open network namespace "docker": No such file or directory

Can anyone help? Thank you in advance.

Source: Docker Questions

LEAVE A COMMENT