LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 03-06-2008, 04:21 PM   #1
initialdrifteg6
Member
 
Registered: Sep 2004
Location: France, Kentucky
Distribution: debian
Posts: 173

Rep: Reputation: 38
IPTABLES - Invalid argument


I'm trying to redirect anyone who is not authenticated on my network to a different IP address. All authenticated users are assigned an IP address on the network 192.168.0.0 and all of the unauthenticated users are assigned an IP address on the network 192.168.1.0. The DHCP server is working properly and is assigning the IP addresses correctly, but i'm having issues getting the iptables command to work properly.

The commands i'm trying as root:

/sbin/iptables -A PREROUTING -s 192.168.1.0/255/255/255/0 -p tcp -j DNAT --to-destination 64.111.96.38

this command is returning

iptables: Invalid argument

my dhcp configuration file looks like this

ddns-updates off;
ddns-update-style interim;
authoritative;
shared-network local {
subnet 192.168.0.0 netmask 255.255.255.0 {
deny unknown-clients;
range 192.168.0.2 192.168.0.10;
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 74.128.1.33 , 74.128.1.31;
option broadcast-address 192.168.0.255;
host MacbookPro {
hardware ethernet 00:19:e3:aa:84:aa;
}
host iPhone {
hardware ethernet 00:1c:b3:aa:a3:aa;
}
host blacknight {
hardware ethernet 00:14:6c:aa:9a:aa;
}
}
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.110;
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.0.1;
allow unknown-clients;

}
}




any thoughts? thanks
 
Old 03-06-2008, 06:23 PM   #2
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 475

Rep: Reputation: 73
Quote:
Originally Posted by initialdrifteg6 View Post
The commands i'm trying as root:

/sbin/iptables -A PREROUTING -s 192.168.1.0/255/255/255/0 -p tcp -j DNAT --to-destination 64.111.96.38

this command is returning

iptables: Invalid argument
(assuming the 255/255/255/0 really is 255.255.255.0)
it most likely returns because there is not PREROUTING chain on the (default) filter table. You probably want to use the nat table.

try:
Code:
/sbin/iptables -t nat -A PREROUTING -s 192.168.1.0/255.255.255.0 -p tcp -j DNAT --to-destination 64.111.96.38
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
message sending failed : Error[22 ] invalid argument .....but each and every argument rakeshranjanjha Linux - Software 2 01-07-2008 11:22 PM
iptables: Invalid argument pk_kala Linux - Server 4 06-23-2007 02:21 AM
iptables: Invalid argument pk_kala Ubuntu 0 03-15-2007 04:32 AM
Iptables, invalid argument, problem with modprobe ivanatora Linux - Software 1 05-11-2005 05:55 AM
[ Invalid Argument on 'iptables' ] benleung Linux - Security 1 09-23-2003 12:25 AM


All times are GMT -5. The time now is 08:22 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration