NAT on one interface

Home Page Forums Network Management Networking NAT on one interface

This topic contains 5 replies, has 0 voices, and was last updated by  somleac 9 years, 4 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #42152

    somleac
    Member

    Hi,

    I need to set up a router box with following configuration:

    ETH0 : LAN : 192.168.x.x/24
    ETH1 : WAN : eg.: 88.99.100.23
    ETH2 : Servers subnet : eg.: 100.100.100.0/28

    I need to have NAT enabled only for LAN to WAN and Servers subnet just routed from eth2 to eth1.

    As far as I understood NAT configured from inside the ZeroShell interface will enable all traffic to be NAT-ed which I do not need.
    I need help in configuring scripts for NAT.
    Thanks.

    somleac.

    #49412

    ppalias
    Member

    In your case you’ll have to manually write down the iptables commands in a script and create a script to run it post boot.

    http://www.frozentux.net/documents/iptables-tutorial/
    A fine iptables tutorial.

    #49413

    somleac
    Member

    Thank you ppalias.
    I know that hard way … 🙂 – knows as r.t.f.m.

    I hoped that somebody had the same issue and can give me a more precise solution.

    Regards,
    somleac

    #49414

    ppalias
    Member

    Something like this maybe

    iptables -t nat -I 1 POSTROUTING --src 192.168.x.x/24 -o eth1 -j MASQUERADE
    #49415

    somleac
    Member

    Thank you ppalias for your fas replay.

    Unfortunately I can not test the configuration this days. I will come back late next week with details about.

    regards,
    somleac.

    #49416

    ppalias
    Member

    Just an edit on the command.

    #49417

    somleac
    Member

    Hi ppalias,

    Finally I managed to test the config.
    You gave me a good command.
    Talking to a friend I choose to use -A instead of -I 1 argument.

    Thank you ppalias.

    somleac

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.