Networking Forums

Networking Forums > Computer Networking > Linux Networking > IP aliases and iptables forwarding

Reply
Thread Tools Display Modes

IP aliases and iptables forwarding

 
 
Yejjou
Guest
Posts: n/a

 
      04-27-2006, 03:36 PM
Hello every body
I made one linux red hat server with only 1 ethernet interface eth0
and 2 ip aliases, something like that :
eth0 -> 10.0.0.1
eth0:1 -> 10.0.0.10
eth0:2 -> 10.0.0.20


i want to redirect a trafic on my network as :

if destination ip is 10.0.0.10 ---> forward to 10.8.0.1
and if destination ip is 10.0.0.20 ---> forward to 10.16.0.1

I try that :

iptables -t nat -A PREROUTING -d 10.0.0.10 -j DNAT --to-destination
10.8.0.1

but it doesnot work can some one help me ?
tanx

 
Reply With Quote
 
 
 
 
Andy Furniss
Guest
Posts: n/a

 
      04-28-2006, 10:14 PM
Yejjou wrote:
> Hello every body
> I made one linux red hat server with only 1 ethernet interface eth0
> and 2 ip aliases, something like that :
> eth0 -> 10.0.0.1
> eth0:1 -> 10.0.0.10
> eth0:2 -> 10.0.0.20
>
>
> i want to redirect a trafic on my network as :
>
> if destination ip is 10.0.0.10 ---> forward to 10.8.0.1
> and if destination ip is 10.0.0.20 ---> forward to 10.16.0.1
>
> I try that :
>
> iptables -t nat -A PREROUTING -d 10.0.0.10 -j DNAT --to-destination
> 10.8.0.1
>
> but it doesnot work can some one help me ?
> tanx
>


If your subnet is /8 then you need to do more because 10.8.0.1 will try
to reply directly.

http://www.faqs.org/docs/iptables/ta...tml#DNATTARGET

Andy.

 
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
Parked Domains, Aliases, Domain Redirection and Domain Forwarding Ajayk Linux Networking 0 05-27-2006 04:42 PM
ip forwarding and iptables Angel Tsankov Linux Networking 1 05-17-2006 01:01 AM
Forwarding with iptables crancran@gmail.com Linux Networking 0 02-18-2006 03:56 PM
iptables port forwarding anonymous Linux Networking 1 01-22-2004 09:25 AM
port forwarding with iptables Allan Bruce Linux Networking 9 09-24-2003 04:31 PM



1 2 3 4 5 6 7 8 9 10 11