Results 1 to 5 of 5

Thread: nat on iptables

  1. #1
    Join Date
    Aug 2012
    Beans
    47

    nat on iptables

    im tring to make a nat, so i create a rule to test:

    iptables -t nat -I PREROUTING -p icmp -s 192.168.XX.yy -d 192.168.XX.zz -j DNAT --to 192.168.ZZ.xx

    and them i ping the nat machine to see if its is working, but when i ue wireshark to check the 2 interfaces. The fist show the icmp request,but in the other is not showing anything. any idea what could be?

    im new on iptables, so a really need some help.

  2. #2
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: nat on iptables

    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  3. #3
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    3,506
    Distro
    Ubuntu Development Release

    Re: nat on iptables

    I guess CharlesA replied while I was away trying to figure out a reply. Anyway...

    If your default policy for your FORWARD chain is DROP, then you will also need to define a path through the FORWARD chain. I tested this on my computer. I think you would need:
    Code:
    iptables -A FORWARD -p icmp -s 192.168.XX.yy -d 192.168.ZZ.XX -j ACCEPT
    Note that I am using the DNAT'd address for the destination above.
    If your FORWARD chain default policy is ACCEPT then I do not know why it is not working.

  4. #4
    Join Date
    Aug 2012
    Beans
    47

    Re: nat on iptables

    Well, its works!
    really thank charlie for the great tutorial, and thanks doug for that tip, i have used to create some rules for make it work.

    thanks you guys!

  5. #5
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    3,506
    Distro
    Ubuntu Development Release

    Re: nat on iptables

    Glad you got it sorted out. And thanks for reporting back.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •