Container on macvlan network cannot access outside world

Hi, I have very little to no knowledge about networking. I created a custom docker macvlan network.My home router is on subnet with the router using ip acting as the gateway.
I’m on Ubuntu. The container im using is also the latest Ubuntu docker container. wls2 is the network interface of the WiFi network card of the Ubuntu host in which I’m running the Ubuntu container.
Macvlan network that I created is
docker network create -d macvlan \ --subnet=
–gateway= \ -o parent=wls2
I’m running the container with --network=pub_net —ip= --dns=
With this configuration when I run the container I can’t ping anything on my lan or google. Nor can I ping my container from host or lan. If I create a docker network with bridge mode, -d bridge ,from the container I can access the outside world but can’t access the container from outside world with its ip. I know it’s possible to access services running in the container using the host ip but that’s not what I want.
I want, if possible to give a static ip (possible using a user defined docker network) to the container and then access the container using that ip and the container should be able to access the outside world also. I thought macvlan is the solution but doesn’t seem to be straightforward and I’m missing certain basic network things.
Any idea how to achieve this? Thanks a ton for your time. This thing is becoming an obsession. I don’t want to use host networking for the container.