ssh reverse tunnel & gateway ports: forwarding users real (public) IP address?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite
1












I'm using a reverse tunnel to a public vps so users can connect to my machine at home. However, due to the reason the reverse tunnel works, their IP addresses are shown as local (127.0.0.1) to my service.



is it possible to make SSH forward the public IP address of the user (e.g. 7.8.9.10 instead of 127.0.0.1)? could it potentially break something?







share|improve this question




















  • I think this is not possible, however I'm also very interested in an answer, facing a related problem.
    – TomáÅ¡ PospíÅ¡ek
    Nov 28 '17 at 21:50














up vote
0
down vote

favorite
1












I'm using a reverse tunnel to a public vps so users can connect to my machine at home. However, due to the reason the reverse tunnel works, their IP addresses are shown as local (127.0.0.1) to my service.



is it possible to make SSH forward the public IP address of the user (e.g. 7.8.9.10 instead of 127.0.0.1)? could it potentially break something?







share|improve this question




















  • I think this is not possible, however I'm also very interested in an answer, facing a related problem.
    – TomáÅ¡ PospíÅ¡ek
    Nov 28 '17 at 21:50












up vote
0
down vote

favorite
1









up vote
0
down vote

favorite
1






1





I'm using a reverse tunnel to a public vps so users can connect to my machine at home. However, due to the reason the reverse tunnel works, their IP addresses are shown as local (127.0.0.1) to my service.



is it possible to make SSH forward the public IP address of the user (e.g. 7.8.9.10 instead of 127.0.0.1)? could it potentially break something?







share|improve this question












I'm using a reverse tunnel to a public vps so users can connect to my machine at home. However, due to the reason the reverse tunnel works, their IP addresses are shown as local (127.0.0.1) to my service.



is it possible to make SSH forward the public IP address of the user (e.g. 7.8.9.10 instead of 127.0.0.1)? could it potentially break something?









share|improve this question











share|improve this question




share|improve this question










asked Nov 28 '17 at 21:06









simplex123

1




1











  • I think this is not possible, however I'm also very interested in an answer, facing a related problem.
    – TomáÅ¡ PospíÅ¡ek
    Nov 28 '17 at 21:50
















  • I think this is not possible, however I'm also very interested in an answer, facing a related problem.
    – TomáÅ¡ PospíÅ¡ek
    Nov 28 '17 at 21:50















I think this is not possible, however I'm also very interested in an answer, facing a related problem.
– TomáÅ¡ PospíÅ¡ek
Nov 28 '17 at 21:50




I think this is not possible, however I'm also very interested in an answer, facing a related problem.
– TomáÅ¡ PospíÅ¡ek
Nov 28 '17 at 21:50










1 Answer
1






active

oldest

votes

















up vote
0
down vote













SSH implements a tunnel in which information is only **forwarded* to or from the remote or local system. Therefor it can only to the assigned local address. You can however configure a local private address virtually and bind to it instead of 127.0.0.1.



sudo ifconfig eth0:0 10.0.0.1 up
sudo ssh -g -L 1234:10.0.0.1:1234 user@host.tld



In order to keep the IP address you need something like l2tp. Note that port forwarding in these cases of NATs is called IP masquerading and by definition loses information about the original IPs when it is sent over the tunnel. Instead you'd need to encapsulate forward packets including their source into something like l2tp and THEN forward that through the tunnel then decode it on the other side.






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f407590%2fssh-reverse-tunnel-gateway-ports-forwarding-users-real-public-ip-address%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    SSH implements a tunnel in which information is only **forwarded* to or from the remote or local system. Therefor it can only to the assigned local address. You can however configure a local private address virtually and bind to it instead of 127.0.0.1.



    sudo ifconfig eth0:0 10.0.0.1 up
    sudo ssh -g -L 1234:10.0.0.1:1234 user@host.tld



    In order to keep the IP address you need something like l2tp. Note that port forwarding in these cases of NATs is called IP masquerading and by definition loses information about the original IPs when it is sent over the tunnel. Instead you'd need to encapsulate forward packets including their source into something like l2tp and THEN forward that through the tunnel then decode it on the other side.






    share|improve this answer
























      up vote
      0
      down vote













      SSH implements a tunnel in which information is only **forwarded* to or from the remote or local system. Therefor it can only to the assigned local address. You can however configure a local private address virtually and bind to it instead of 127.0.0.1.



      sudo ifconfig eth0:0 10.0.0.1 up
      sudo ssh -g -L 1234:10.0.0.1:1234 user@host.tld



      In order to keep the IP address you need something like l2tp. Note that port forwarding in these cases of NATs is called IP masquerading and by definition loses information about the original IPs when it is sent over the tunnel. Instead you'd need to encapsulate forward packets including their source into something like l2tp and THEN forward that through the tunnel then decode it on the other side.






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        SSH implements a tunnel in which information is only **forwarded* to or from the remote or local system. Therefor it can only to the assigned local address. You can however configure a local private address virtually and bind to it instead of 127.0.0.1.



        sudo ifconfig eth0:0 10.0.0.1 up
        sudo ssh -g -L 1234:10.0.0.1:1234 user@host.tld



        In order to keep the IP address you need something like l2tp. Note that port forwarding in these cases of NATs is called IP masquerading and by definition loses information about the original IPs when it is sent over the tunnel. Instead you'd need to encapsulate forward packets including their source into something like l2tp and THEN forward that through the tunnel then decode it on the other side.






        share|improve this answer












        SSH implements a tunnel in which information is only **forwarded* to or from the remote or local system. Therefor it can only to the assigned local address. You can however configure a local private address virtually and bind to it instead of 127.0.0.1.



        sudo ifconfig eth0:0 10.0.0.1 up
        sudo ssh -g -L 1234:10.0.0.1:1234 user@host.tld



        In order to keep the IP address you need something like l2tp. Note that port forwarding in these cases of NATs is called IP masquerading and by definition loses information about the original IPs when it is sent over the tunnel. Instead you'd need to encapsulate forward packets including their source into something like l2tp and THEN forward that through the tunnel then decode it on the other side.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 29 '17 at 0:29









        jdwolf

        2,392116




        2,392116



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f407590%2fssh-reverse-tunnel-gateway-ports-forwarding-users-real-public-ip-address%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay