Find the answer to your Linux question:
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 25
Hello, I've a dedicated server on LA, and I want to connect to this server via VPN ( poptop server ) to keep my static ip when I'm on trip ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2007
    Posts
    16

    4 ip and nat problem


    Hello,
    I've a dedicated server on LA, and I want to connect to this server via VPN ( poptop server ) to keep my static ip when I'm on trip and to keep my wireless packets safe.

    but my dedicated server has 4 ips ( one on eth0 and others virtually on eth0:0 eth0:1 eth0:2 ), I want to connect to vpn with each one when I need to one of theme.

    so the problem is this iptables rule:
    iptables --table nat --append POSTROUTING \
    --out-interface eth0 --jump MASQUERADE

    this rule will forward all of my packets ( independent of which ip I've connected to ) from eth0, so in websites my ip always is the ip of eth0 but I need to some times it be eth0:0 's ip and so on....

    I need better iptables rules...
    tnx

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Question 1: If these ip addresses are public why are you using MASQ?

    Question 2: If these are private addresses using one public address how do you expect ot connect to them without using different ports?

    Question 3: How do you figure you are going to keep your Static ip whaen you are away?

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Just Joined!
    Join Date
    Sep 2007
    Posts
    16
    Quote Originally Posted by Lazydog View Post
    Question 1: If these ip addresses are public why are you using MASQ?

    Question 2: If these are private addresses using one public address how do you expect ot connect to them without using different ports?

    Question 3: How do you figure you are going to keep your Static ip whaen you are away?
    Wow, How can you think this way?

    I'm now connecting to these ips on the same port and currently I'm using vpn to keep my static ips when I'm away, and these 4 are valid static public ips.

    any other question?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Quote Originally Posted by phpcs View Post
    Wow, How can you think this way?
    Simple, I work on networks for a living.

    I'm now connecting to these ips on the same port and currently I'm using vpn to keep my static ips when I'm away, and these 4 are valid static public ips.

    any other question?
    Yes, are these private addresses or public?

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  6. #5
    Just Joined!
    Join Date
    Sep 2007
    Posts
    16
    Quote Originally Posted by Lazydog View Post
    Yes, are these private addresses or public?
    public, as I said.

  7. #6
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Sorry, missed that. Wife talking in my other ear.

    OK, you should not be using MASQ then if the ip addresses are public.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  8. #7
    Just Joined!
    Join Date
    Sep 2007
    Posts
    16
    Quote Originally Posted by Lazydog View Post
    Sorry, missed that. Wife talking in my other ear.

    OK, you should not be using MASQ then if the ip addresses are public.
    I'm kinda newbie in iptables, so would you please tell what rule to use instead?

  9. #8
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Either post what you already have or send them to me in a private message. I cannot begin to tell you what to change without knowing your setup.

    Also let me know how everything is connected as this will be needed to ensure the firewall rules are setup properly.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  10. #9
    Just Joined!
    Join Date
    Sep 2007
    Posts
    16
    Quote Originally Posted by Lazydog View Post
    post what you already have
    what do you mean by this words?

  11. #10
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    he wants you to post your current iptables rules so he can look at them

Page 1 of 3 1 2 3 LastLast

Posting Permissions

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