I know how to make a one layer tunnel:
ssh -ND 9898 username@mymachine
and then add a sockss proxy localhost:9898 in the browser.
but how to make a two layer tunnel? Suppose mymachine is not directly accessible to me but another machine machineprime is accessible and mymachine is accessible once I am on machineprime. So how do I redirect all my browser requests via machineprime and mymachine to the outer world?
These links helped me achieve what I wanted: