Networking Forums

Networking Forums > Computer Networking > Linux Networking > ip address redirect with iptables

Reply
Thread Tools Display Modes

ip address redirect with iptables

 
 
adam
Guest
Posts: n/a

 
      09-08-2005, 05:02 PM
i'm using a linux box as a router. I have a cisco 2500 forwarding
a /28 to my linux router. i want one of those address to be
redirected to a different internal IP. Like so:
216.199.233.17 ---> linux box ----> 172.31.7.5

essentially i want the linux box to 'switch' the ip. Can this be done?
 
Reply With Quote
 
 
 
 
adam
Guest
Posts: n/a

 
      09-08-2005, 05:10 PM
On Thu, 08 Sep 2005 10:02:49 -0700, adam wrote:

> i'm using a linux box as a router. I have a cisco 2500 forwarding
> a /28 to my linux router. i want one of those address to be
> redirected to a different internal IP. Like so:
> 216.199.233.17 ---> linux box ----> 172.31.7.5
>
> essentially i want the linux box to 'switch' the ip. Can this be done?



This rule will allow me to ping 216.199.233.17 from the linux box,
but not the outside world, i need to translate the internal address
back to the external address if i want to reach it from the outside
world, which i don't know how to do, here's the rule that kind of
makes it work:
iptables -t nat -A OUTPUT -p all -d 216.199.233.17 -j DNAT
--to-destination 172.31.7.5

 
Reply With Quote
 
Llanzlan Klazmon
Guest
Posts: n/a

 
      09-09-2005, 02:02 AM
adam <(E-Mail Removed)> wrote in news(E-Mail Removed):

> i'm using a linux box as a router. I have a cisco 2500 forwarding
> a /28 to my linux router. i want one of those address to be
> redirected to a different internal IP. Like so:
> 216.199.233.17 ---> linux box ----> 172.31.7.5
>
> essentially i want the linux box to 'switch' the ip. Can this be done?


Yes. Read up the doc at:

http://www.netfilter.org/documentati...NAT-HOWTO.html

Klazmon.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables? redirect? M3ntos Linux Networking 3 05-20-2005 08:16 AM
Iptables {DNAT,REDIRECT} Akede Linux Networking 1 10-07-2004 03:06 AM
Iptables SSL redirect Fritz Bayer Linux Networking 6 07-20-2004 06:08 AM
iptables:redirect in an intranet? M F Linux Networking 0 11-15-2003 10:29 AM
iptables redirect = ! ipsec0 DaemonB Linux Networking 0 09-02-2003 07:23 AM



1 2 3 4 5 6 7 8 9 10 11