Networking Forums

Networking Forums > Computer Networking > Linux Networking > iptables SNAT & DNAT won't accept name

Reply
Thread Tools Display Modes

iptables SNAT & DNAT won't accept name

 
 
Ming-Ching Tiew
Guest
Posts: n/a

 
      10-08-2004, 04:11 AM

I would like to use ***NAME*** instead of IP address
in the "--to NAMEort" part of iptable command, but
it fails, example :-

iptables -t nat -A PREROUTING ..... -j SNAT NAMEort

does not work. However,

iptables -t nat -A PREROUTING ..... -j SNAT IPort

works. So now, is it expected behaviour and how do I work
around it ?




 
Reply With Quote
 
 
 
 
lfree
Guest
Posts: n/a

 
      10-08-2004, 06:48 AM
> I would like to use ***NAME*** instead of IP address
> in the "--to NAMEort" part of iptable command, but
> it fails, example :-
>
> iptables -t nat -A PREROUTING ..... -j SNAT NAMEort
>
> does not work. However,
>
> iptables -t nat -A PREROUTING ..... -j SNAT IPort
>
> works. So now, is it expected behaviour and how do I work
> around it ?


check DNS¡£

 
Reply With Quote
 
Ming-Ching Tiew
Guest
Posts: n/a

 
      10-08-2004, 07:37 AM

"lfree" <(E-Mail Removed)> wrote in message news:ck5dif$som$(E-Mail Removed)...
> > I would like to use ***NAME*** instead of IP address
> > in the "--to NAMEort" part of iptable command, but
> > it fails, example :-
> >
> > iptables -t nat -A PREROUTING ..... -j SNAT NAMEort
> >
> > does not work. However,
> >
> > iptables -t nat -A PREROUTING ..... -j SNAT IPort
> >
> > works. So now, is it expected behaviour and how do I work
> > around it ?

>
> check DNS¡£


I won't post here if it is due to DNS.

You got to try it yourself,

iptables -t nat -A PREROUTING ... -j SNAT --to NAMEort

is wrong syntax,

iptables -t nat -A PREROUTING ... -j SNAT --to IPort

is correct syntax,

iptables -t nat -A PREROUTING -s NAME1 -d NAME2 ....

is also correct syntax.





 
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
Suggest an assignment using iptables and SNAT/DNAT jeniffer Linux Networking 0 05-05-2006 04:21 AM
iptables: fake ip using DNAT and SNAT =?ISO-8859-1?Q?Bj=F8rnar_Lib=E6k?= Linux Networking 19 04-08-2006 12:08 AM
Selective SNAT using IPtables? Justin Todd Linux Networking 2 12-16-2005 04:36 AM
iptables SNAT and DNAT on same packets chris-usenet@roaima.co.uk Linux Networking 6 07-08-2005 09:19 AM
SNAT/DNAT works but doesn't look right. Looking for feedback. Gary Smith Linux Networking 0 09-24-2003 10:31 PM



1 2 3 4 5 6 7 8 9 10 11