Hw does amodem work with a vpn on the same network

Not sure what you are asking, explain the setup a bit more. A Modem just sets up the data connection, VPN hardware/software then uses that connection to create a secure tunnel through a public network betweeen 2 private networks.