Networking Forums  

Go Back   Networking Forums > Networking Newsgroups > Linux Networking

iptables SNAT & DNAT won't accept name

Reply
 
Thread Tools Display Modes
  #1  
Old 10-08-2004, 05:11 AM
Default iptables SNAT & DNAT won't accept name




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 ?






Ming-Ching Tiew
Reply With Quote
  #2  
Old 10-08-2004, 07:48 AM
lfree
Guest
 
Posts: n/a
Default Re: iptables SNAT & DNAT won't accept name

> 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
  #3  
Old 10-08-2004, 08:37 AM
Ming-Ching Tiew
Guest
 
Posts: n/a
Default Re: iptables SNAT & DNAT won't accept name


"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

Tags
accept, dnat, iptables, snat

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
Forum Jump


All times are GMT. The time now is 01:18 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.