Results 1 to 3 of 3

Thread: NAT- masquerade scenario problem

  1. #1
    Join Date
    Jun 2012
    Beans
    3

    NAT- masquerade scenario problem

    Hi to all...I have asked all my friends but no one didn't know to help me ...so i was surfing a bit and found out this forum ...i have seen that many problems were solved here, so i hope that my problem will be one of them ...


    So, anyway let me tell my problem (immediately in my first post hahaha)...
    well, i have problem with one simple MASQERADING scenario...really need to help...
    On one computer pc1 (let's call it router) i need to open a new subinterfaces (exp. eth0:1) where is possible to communicate with rest of the my LOCAL AREA NETWORK...I need to set up the NAT on my pc1 (router) and enable another computer PC2 (let's call it user) to communicate with rest of Local Network... Also is necessary to configure the PC2 (user) to use PC1 (router) as gateway (hint: default gateway). And after all that when i check the communicate between PC2 (user) with rest of LAN (with ping) i need to get source address of PC2 (router) in ICMP packets on destination PC.


    And all computers in my Network are have install only one network Interface...
    Well i also post pic here how i see the problem (maybe i didn't drew the best but i think that is clearly what i want to say haha)...so i hope that will help to you...


    and I also type this commands


    //PC2
    route add default gateway 192.168.0.105 eth0


    //PC1
    Ifconfig eth0:1 192.168.0.105 netmask 255.255.255.0 up
    Ifconfig eth0:1 192.168.1.105 netmask 255.255.255.0 up
    iptables -t nat -A POSTROUTING -d 192.168.0.105 -j MASQUERADE
    iptables -A FORWARD -s 192.168.0.105 -d 192.168.1.105 -m state --state RELATED,ESTABLISHED -j ACCEPT
    iptables -A FORWARD - s 192.168.1.105 -d 192.168.0.105 -j ACCEPT
    iptables -t nat -A POSTROUTING -s 192.168.0.105 - j SNAT - - to-source 192.168.1.105

    and after all that didn't work... i’m so lost...

    don’t know what to do anymore...


    Thanks for any help what i get...
    Attached Images Attached Images
    Last edited by CheerfulSonya; June 1st, 2012 at 10:05 PM.

  2. #2
    Join Date
    Oct 2005
    Location
    Al Ain
    Beans
    7,975

    Re: NAT- masquerade scenario problem


  3. #3
    Join Date
    Jun 2012
    Beans
    3

    Re: NAT- masquerade scenario problem

    Many thanks for your help...Much appreciated that...
    the problem was been that i forgot to enable the ip forwarding with command

    1 > /proc/sys/net/ipv4/ip_forward

    thanks again...

Tags for this Thread

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
  •