ip.route iptable does not natIptables and SNATTrigger iptables masquerade before reaching service on gateway?OpenVPN AS accept connections forwarded by NATHow do I forward/NAT all traffic to one interface/IP to a remote IP?Linux Routing with two NICs (LAN vs Internet) with NAT and bridging for VMsIptables port forwarding with restrictions on someNated traffic don't returnIPTables Multi-VLAN NAT to Multiple IPsLEDE 17.01.1, StrongSwan 5.6.0 swanctl NATiptables NAT HTTPS on external IP to internal IP - debian

Summer '19 Sandbox error: String index out of range: 0: Source

Game artist computer workstation set-up – is this overkill?

Why would a military not separate its forces into different branches?

Playing Doublets with the Primes

How important are good looking people in a novel/story?

Can anyone identify this unknown 1988 PC card from The Palantir Corporation?

What word describes the sound of an instrument based on the shape of the waveform of its sound?

Do quaternary sulfur dications exist?

Why can’t you see at the start of the Big Bang?

Lines too long in piece with two sections for different instruments

My dual citizen son (US and Australia) wants to marry a US citizen but live in Australia

TIP120 Transistor + Solenoid Failing Randomly

Picking a theme as a discovery writer

What happens if I accidentally leave an app running and click "Install Now" in Software Updater?

Is crescere the correct word meaning to to grow or cultivate?

Reverse ColorFunction or ColorData

Can I combine SELECT TOP() with the IN operator?

How did the Force make Luke hard to hit in the Battle of Yavin?

What are these silver "sporks" for?

How to replace space with '+' symbol in a triangular array?

Transistor gain, what if there is not enough current?

What's the 2-minute timer on mobile Deutsche Bahn tickets?

How long did it take Captain Marvel to travel to Earth?

What does the copyright in a dissertation protect exactly?



ip.route iptable does not nat


Iptables and SNATTrigger iptables masquerade before reaching service on gateway?OpenVPN AS accept connections forwarded by NATHow do I forward/NAT all traffic to one interface/IP to a remote IP?Linux Routing with two NICs (LAN vs Internet) with NAT and bridging for VMsIptables port forwarding with restrictions on someNated traffic don't returnIPTables Multi-VLAN NAT to Multiple IPsLEDE 17.01.1, StrongSwan 5.6.0 swanctl NATiptables NAT HTTPS on external IP to internal IP - debian






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








-1















|--------------| |--------------| |--------------|
| computer A | eth0| computer B | | computer C |internet
| (10.5.0.2) |----------| (10.5.0.1) | | (x.x.x.x) |--------
| | | | | ^ |
| | | NAT | | | NAT | |
| | | ˇ | tun0 | |
| | | (10.8.0.14) |----------| (10.8.0.1) |
|--------------| |--------------| |--------------|


Here the schematic of the network I've build.

My problem is when I try to configure the NAT in the B computer

''bash
root@computerB#cat /proc/sys/net/ipv4/ip_forward
1



root@computerB# iptables-save 
*nat
:PREROUTING ACCEPT [13:1108]
:INPUT ACCEPT [10:600]
:OUTPUT ACCEPT [6708:457650]
:POSTROUTING ACCEPT [5782:389727]
-A POSTROUTING -o wlan0 -j MASQUERADE
COMMIT
# Completed on Sat Apr 27 23:56:29 2019
# Generated by iptables-save v1.6.0 on Sat Apr 27 23:56:29 2019
*filter
:INPUT ACCEPT [1235765:1640284761]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [759264:248481682]
-A FORWARD -i eth0 -j ACCEPT
COMMIT
# Completed on Sat Apr 27 23:56:29 2019


  • when I whant to ping 10.5.0.1 from computer A it's work

  • when I whant to ping 10.8.0.14 from computer A it's work


  • when I whant to ping 10.8.0.1 from computer A it's not working

    so i take my friend wireshark and start to listen on tun0 I can see packets like that



    No. time mac source destination protocol length info
    285 106.310258 N/A 10.5.0.2 10.8.0.1 ICMP 84 Echo (ping) request id=0x8114, seq=0/0, ttl=63 (no response found!)



I don't understand why I get ip 10.5.0.2 on interface tun0










share|improve this question



















  • 1





    Route, don't NAT.

    – Michael Hampton
    Apr 27 at 22:35











  • NAT is not a substitute for routing. Those are two completely different things.

    – Ron Maupin
    Apr 27 at 22:40






  • 1





    What name has interface with 10.8.0.14? wlan0 or tun0?

    – Jigius
    Apr 28 at 2:06











  • my interface with 10.8.0.14 is tun0

    – Colin ROUBAUD
    Apr 28 at 11:13

















-1















|--------------| |--------------| |--------------|
| computer A | eth0| computer B | | computer C |internet
| (10.5.0.2) |----------| (10.5.0.1) | | (x.x.x.x) |--------
| | | | | ^ |
| | | NAT | | | NAT | |
| | | ˇ | tun0 | |
| | | (10.8.0.14) |----------| (10.8.0.1) |
|--------------| |--------------| |--------------|


Here the schematic of the network I've build.

My problem is when I try to configure the NAT in the B computer

''bash
root@computerB#cat /proc/sys/net/ipv4/ip_forward
1



root@computerB# iptables-save 
*nat
:PREROUTING ACCEPT [13:1108]
:INPUT ACCEPT [10:600]
:OUTPUT ACCEPT [6708:457650]
:POSTROUTING ACCEPT [5782:389727]
-A POSTROUTING -o wlan0 -j MASQUERADE
COMMIT
# Completed on Sat Apr 27 23:56:29 2019
# Generated by iptables-save v1.6.0 on Sat Apr 27 23:56:29 2019
*filter
:INPUT ACCEPT [1235765:1640284761]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [759264:248481682]
-A FORWARD -i eth0 -j ACCEPT
COMMIT
# Completed on Sat Apr 27 23:56:29 2019


  • when I whant to ping 10.5.0.1 from computer A it's work

  • when I whant to ping 10.8.0.14 from computer A it's work


  • when I whant to ping 10.8.0.1 from computer A it's not working

    so i take my friend wireshark and start to listen on tun0 I can see packets like that



    No. time mac source destination protocol length info
    285 106.310258 N/A 10.5.0.2 10.8.0.1 ICMP 84 Echo (ping) request id=0x8114, seq=0/0, ttl=63 (no response found!)



I don't understand why I get ip 10.5.0.2 on interface tun0










share|improve this question



















  • 1





    Route, don't NAT.

    – Michael Hampton
    Apr 27 at 22:35











  • NAT is not a substitute for routing. Those are two completely different things.

    – Ron Maupin
    Apr 27 at 22:40






  • 1





    What name has interface with 10.8.0.14? wlan0 or tun0?

    – Jigius
    Apr 28 at 2:06











  • my interface with 10.8.0.14 is tun0

    – Colin ROUBAUD
    Apr 28 at 11:13













-1












-1








-1








|--------------| |--------------| |--------------|
| computer A | eth0| computer B | | computer C |internet
| (10.5.0.2) |----------| (10.5.0.1) | | (x.x.x.x) |--------
| | | | | ^ |
| | | NAT | | | NAT | |
| | | ˇ | tun0 | |
| | | (10.8.0.14) |----------| (10.8.0.1) |
|--------------| |--------------| |--------------|


Here the schematic of the network I've build.

My problem is when I try to configure the NAT in the B computer

''bash
root@computerB#cat /proc/sys/net/ipv4/ip_forward
1



root@computerB# iptables-save 
*nat
:PREROUTING ACCEPT [13:1108]
:INPUT ACCEPT [10:600]
:OUTPUT ACCEPT [6708:457650]
:POSTROUTING ACCEPT [5782:389727]
-A POSTROUTING -o wlan0 -j MASQUERADE
COMMIT
# Completed on Sat Apr 27 23:56:29 2019
# Generated by iptables-save v1.6.0 on Sat Apr 27 23:56:29 2019
*filter
:INPUT ACCEPT [1235765:1640284761]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [759264:248481682]
-A FORWARD -i eth0 -j ACCEPT
COMMIT
# Completed on Sat Apr 27 23:56:29 2019


  • when I whant to ping 10.5.0.1 from computer A it's work

  • when I whant to ping 10.8.0.14 from computer A it's work


  • when I whant to ping 10.8.0.1 from computer A it's not working

    so i take my friend wireshark and start to listen on tun0 I can see packets like that



    No. time mac source destination protocol length info
    285 106.310258 N/A 10.5.0.2 10.8.0.1 ICMP 84 Echo (ping) request id=0x8114, seq=0/0, ttl=63 (no response found!)



I don't understand why I get ip 10.5.0.2 on interface tun0










share|improve this question
















|--------------| |--------------| |--------------|
| computer A | eth0| computer B | | computer C |internet
| (10.5.0.2) |----------| (10.5.0.1) | | (x.x.x.x) |--------
| | | | | ^ |
| | | NAT | | | NAT | |
| | | ˇ | tun0 | |
| | | (10.8.0.14) |----------| (10.8.0.1) |
|--------------| |--------------| |--------------|


Here the schematic of the network I've build.

My problem is when I try to configure the NAT in the B computer

''bash
root@computerB#cat /proc/sys/net/ipv4/ip_forward
1



root@computerB# iptables-save 
*nat
:PREROUTING ACCEPT [13:1108]
:INPUT ACCEPT [10:600]
:OUTPUT ACCEPT [6708:457650]
:POSTROUTING ACCEPT [5782:389727]
-A POSTROUTING -o wlan0 -j MASQUERADE
COMMIT
# Completed on Sat Apr 27 23:56:29 2019
# Generated by iptables-save v1.6.0 on Sat Apr 27 23:56:29 2019
*filter
:INPUT ACCEPT [1235765:1640284761]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [759264:248481682]
-A FORWARD -i eth0 -j ACCEPT
COMMIT
# Completed on Sat Apr 27 23:56:29 2019


  • when I whant to ping 10.5.0.1 from computer A it's work

  • when I whant to ping 10.8.0.14 from computer A it's work


  • when I whant to ping 10.8.0.1 from computer A it's not working

    so i take my friend wireshark and start to listen on tun0 I can see packets like that



    No. time mac source destination protocol length info
    285 106.310258 N/A 10.5.0.2 10.8.0.1 ICMP 84 Echo (ping) request id=0x8114, seq=0/0, ttl=63 (no response found!)



I don't understand why I get ip 10.5.0.2 on interface tun0







nat debian-stretch






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 28 at 11:18







Colin ROUBAUD

















asked Apr 27 at 22:33









Colin ROUBAUDColin ROUBAUD

12




12







  • 1





    Route, don't NAT.

    – Michael Hampton
    Apr 27 at 22:35











  • NAT is not a substitute for routing. Those are two completely different things.

    – Ron Maupin
    Apr 27 at 22:40






  • 1





    What name has interface with 10.8.0.14? wlan0 or tun0?

    – Jigius
    Apr 28 at 2:06











  • my interface with 10.8.0.14 is tun0

    – Colin ROUBAUD
    Apr 28 at 11:13












  • 1





    Route, don't NAT.

    – Michael Hampton
    Apr 27 at 22:35











  • NAT is not a substitute for routing. Those are two completely different things.

    – Ron Maupin
    Apr 27 at 22:40






  • 1





    What name has interface with 10.8.0.14? wlan0 or tun0?

    – Jigius
    Apr 28 at 2:06











  • my interface with 10.8.0.14 is tun0

    – Colin ROUBAUD
    Apr 28 at 11:13







1




1





Route, don't NAT.

– Michael Hampton
Apr 27 at 22:35





Route, don't NAT.

– Michael Hampton
Apr 27 at 22:35













NAT is not a substitute for routing. Those are two completely different things.

– Ron Maupin
Apr 27 at 22:40





NAT is not a substitute for routing. Those are two completely different things.

– Ron Maupin
Apr 27 at 22:40




1




1





What name has interface with 10.8.0.14? wlan0 or tun0?

– Jigius
Apr 28 at 2:06





What name has interface with 10.8.0.14? wlan0 or tun0?

– Jigius
Apr 28 at 2:06













my interface with 10.8.0.14 is tun0

– Colin ROUBAUD
Apr 28 at 11:13





my interface with 10.8.0.14 is tun0

– Colin ROUBAUD
Apr 28 at 11:13










1 Answer
1






active

oldest

votes


















0














As explained in the comments, you should not do NAT here. You should use just regular IP routing.



However, to fix the issue with NAT, change



-A POSTROUTING -o wlan0 -j MASQUERADE


to



-A POSTROUTING -o tun0 -j MASQUERADE


in your IPTables rules.






share|improve this answer























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "2"
    ;
    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',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f964887%2fip-route-iptable-does-not-nat%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    As explained in the comments, you should not do NAT here. You should use just regular IP routing.



    However, to fix the issue with NAT, change



    -A POSTROUTING -o wlan0 -j MASQUERADE


    to



    -A POSTROUTING -o tun0 -j MASQUERADE


    in your IPTables rules.






    share|improve this answer



























      0














      As explained in the comments, you should not do NAT here. You should use just regular IP routing.



      However, to fix the issue with NAT, change



      -A POSTROUTING -o wlan0 -j MASQUERADE


      to



      -A POSTROUTING -o tun0 -j MASQUERADE


      in your IPTables rules.






      share|improve this answer

























        0












        0








        0







        As explained in the comments, you should not do NAT here. You should use just regular IP routing.



        However, to fix the issue with NAT, change



        -A POSTROUTING -o wlan0 -j MASQUERADE


        to



        -A POSTROUTING -o tun0 -j MASQUERADE


        in your IPTables rules.






        share|improve this answer













        As explained in the comments, you should not do NAT here. You should use just regular IP routing.



        However, to fix the issue with NAT, change



        -A POSTROUTING -o wlan0 -j MASQUERADE


        to



        -A POSTROUTING -o tun0 -j MASQUERADE


        in your IPTables rules.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 30 at 5:30









        Tero KilkanenTero Kilkanen

        20.7k22744




        20.7k22744



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Server Fault!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f964887%2fip-route-iptable-does-not-nat%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

            Esgonzo ibérico Índice Descrición Distribución Hábitat Ameazas Notas Véxase tamén "Acerca dos nomes dos anfibios e réptiles galegos""Chalcides bedriagai"Chalcides bedriagai en Carrascal, L. M. Salvador, A. (Eds). Enciclopedia virtual de los vertebrados españoles. Museo Nacional de Ciencias Naturales, Madrid. España.Fotos

            Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020