Find the answer to your Linux question:
Results 1 to 7 of 7
Hello I'm hoping someone can help me with my problem. I'll start with explaining my situation. This is a box with iptables and 1 nic. It has a bunch of ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2009
    Posts
    3

    Redirecting IP > iptables?


    Hello

    I'm hoping someone can help me with my problem.

    I'll start with explaining my situation. This is a box with iptables and 1 nic. It has a bunch of ip addresses and i want to redirect ip1 to ip2 with the end user seeing he's connected to ip2 (while having connected to ip1 intentionally). All traffic is staying internally.

    I'm trying to redirect, if thats the right word, externalIP1 to externalIP2. I know this can be done with configuring the nat of iptables by using DNAT. This is however not exactly what I'm trying to achieve.
    I would like the user to connect to externalIP1 and end up on externalIP2. I believe that with DNAT every packet gets tranferred from ip1 to ip2 internally while i would like a solution that somehow resolves ip1 into ip2.


    Is this even possible?

    The reason for this is rather odd and it is not load related.

    Thanks for your input, it is much appreciated.

    Whatsfordinner?

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    How are the user/client connecting? With an ip addres or are they using a host name? If they are using a host name then setup your DNS so that all hos names point to the same IP Address. If they are using IP Addresses to connect then you aren't going to be able to change this.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Just Joined!
    Join Date
    Oct 2009
    Posts
    3
    I was already afraid of that. They do not connect to a hostname so i cannot change the dns entries.

    Well, it's not the end of the world.

    Thanks!

  4. #4
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    You could use DNAT and SNAT also. DNAT ADDR1 to ADDR2 on incoming traffic and then SNAT the outbound traffic from ADDR2 to ADDR1.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  5. #5
    Just Joined!
    Join Date
    Oct 2009
    Posts
    3
    Yes, I used D- and SNAT temp. The problem however was that the users were still connecting to ADDR1 all the time. I really want something that would redirect users from ADDR1 to ADDR2 like you could with a domain. External redirect instead of an internal solution.

  6. #6
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Don't think you are going to find anything like this.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  7. #7
    Just Joined!
    Join Date
    Oct 2009
    Posts
    1
    Take that, you sweet thing!

Posting Permissions

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