Networking Forums

Networking Forums > Computer Networking > Linux Networking > help with iptables command

Reply
Thread Tools Display Modes

help with iptables command

 
 
richard noel fell
Guest
Posts: n/a

 
      09-26-2003, 05:48 PM
I have a linux machine, redhat 9, connected via cable modem to the
internet on eth0. Connected to eth1 is a laptop running xp. I am
attempting to use ip masquerade to allow the xp machine to connect to
the outside world via the linux machine. Here are the commands I give to
set up iptables.

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 MASQUERADE

I get the following error message after issuing the second command:
Bad argument 'MASQUERADE'

I copied this sequence of commands for a book telling one how to
interconned a windows and linux machine in a LAN. Of course, I have gone
to the iptables man pages, but cannot figure out what the error is. Can
anyone enlighten me as to what the correct command is? I am at a loss now.
Thanks for any help,
Dick Fell

 
Reply With Quote
 
 
 
 
Walter Schiessberg
Guest
Posts: n/a

 
      09-26-2003, 06:07 PM
richard noel fell wrote on 26.09.2003 19:48:


> I have a linux machine, redhat 9, connected via cable modem to the
> internet on eth0. Connected to eth1 is a laptop running xp. I am
> attempting to use ip masquerade to allow the xp machine to connect to
> the outside world via the linux machine. Here are the commands I give to
> set up iptables.
>
> echo 1 > /proc/sys/net/ipv4/ip_forward
> iptables -t nat -A POSTROUTING -o eth0 MASQUERADE
>
> I get the following error message after issuing the second command:
> Bad argument 'MASQUERADE'
>


Try iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
^^

Cheers

Walter

 
Reply With Quote
 
richard noel fell
Guest
Posts: n/a

 
      09-26-2003, 06:10 PM
Walter -
Thanks very much.
Dick Fell

Walter Schiessberg wrote:

> richard noel fell wrote on 26.09.2003 19:48:
>
>
>> I have a linux machine, redhat 9, connected via cable modem to the
>> internet on eth0. Connected to eth1 is a laptop running xp. I am
>> attempting to use ip masquerade to allow the xp machine to connect to
>> the outside world via the linux machine. Here are the commands I give
>> to set up iptables.
>>
>> echo 1 > /proc/sys/net/ipv4/ip_forward
>> iptables -t nat -A POSTROUTING -o eth0 MASQUERADE
>>
>> I get the following error message after issuing the second command:
>> Bad argument 'MASQUERADE'
>>

>
> Try iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
> ^^
>
> Cheers
>
> Walter
>


 
Reply With Quote
 
W Cardwell
Guest
Posts: n/a

 
      09-26-2003, 06:31 PM
You need to add a "-j" (for "jump") to the second line, i.e.

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

--

wcardwell at nc dot rr dot com


 
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 command ignored? AAW Linux Networking 8 09-28-2007 10:11 PM
Questions related to iptables command jeniffer Linux Networking 5 11-08-2006 11:52 AM
I need to allow to login to Linux pc from particular IP addr only - Can I do that with IPtables command? GS Linux Networking 8 01-29-2006 11:08 PM
NIS yppasswd command and iptables?? RPC: unable to receive Ryan Hubbard Linux Networking 5 05-10-2004 06:39 PM
What's wrong with this iptables command? Alec Waters Linux Networking 4 11-18-2003 07:53 AM



1 2 3 4 5 6 7 8 9 10 11