Administrators may desire to provision Kasm sessions that egress out of a specific IP assigned to
the host. This might be useful if the network utilizes special policy routes based on source IPs to direct traffic.
In this example we will demonstrate how to:
Create a custom docker network using the bridge driver.
Configure the docker network to egress out of defined interface IP.
Configure a Kasm Image to always be provisioned on the desired docker network, using the Restrict to Docker NetworkImage Setting
In this model, the Kasm sessions will be given a NATed address inside the docker network pool (e.g 172.19.0.0/16) but
when the traffic leaves the docker host it will be utilize a specific IP that belongs to one of the hosts interfaces.
The docker network names used in this example are intentionally prefixed with z_ . Due to a quirk
docker will choose the default route for the container based on the name of the docker network ordered
alphabetically. We name these custom networks accordingly so that they won’t cause interruptions with the Kasm
service containers or user workflow.
The generated briged interfaces can also be observed using ip a
ip a
...
32: z_custom_a: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:5e:07:7a:e6 brd ff:ff:ff:ff:ff:ff
inet 172.19.0.1/16 brd 172.19.255.255 scope global z_custom_a
valid_lft forever preferred_lft forever
33: z_custom_b: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:f4:a5:a7:ca brd ff:ff:ff:ff:ff:ff
inet 172.20.0.1/16 brd 172.20.255.255 scope global z_custom_b
valid_lft forever preferred_lft forever