Assign Network for Container access Internet

I have 1 ubuntu 22.04 server. On the server, there are two network interfaces, ens192 for internal access and ens224 for internet access. But the default route is required to be ens192 because it is running the service on docker if ens192 is not the default route other internal networks cannot access it. So I want to create a container running on a network and that network accesses the Internet through the ens224 interface. Or is there a way to change the route on the host. Thank you very much

Not sure this is a Docker topic, Docler will just transparently use the host network to connect to Internet and can be reached on all IPs when just using port without IP to listen.

1 Like