Hi,
i'm using rc3 jffs2 and did a clean install on my wrt54gs. i'm having strange behaviours of iptables which i can't explain to myself. maybe you could give me a hint.
The problem is, iptables automatically adds to almost each firewall rule a random source ports range restriction. examples:
iptables -t nat -A prerouting_rule -i ppp0 -p tcp --dport 22 -j DNAT --to 192.168.2.2the result (see the source-ports range):
Chain prerouting_rule (1 references)
pkts bytes target prot opt in out source destination
0 0 DNAT tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 tcp spts:0:832 dpt:22 to:192.168.2.2If i delete this rule from the Chain and fire up the exact same command as above, the line is reading:
Chain prerouting_rule (1 references)
pkts bytes target prot opt in out source destination
0 0 DNAT tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 tcp spts:0:964 dpt:22 to:192.168.2.2If you specify a --sport or a range with --sports iptables uses their values, only when no source ports specified it behaves like drunken.
Other examples from iptables -L -vn:
Chain INPUT (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
1 56 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 state INVALID
1217 242K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
0 0 DROP tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spts:0:64 dpts:255:65535 option=!2 flags:0x02/0x02
...
Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 state INVALID
13 672 TCPMSS tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spts:0:68 dpts:255:65535 flags:0x06/0x02 TCPMSS clamp to PMTUWhat the heck is going on? Can someone reproduce this?
The box is running a vanilla rc3 only ntpclient & screen added.
root@OpenWrt:~>ipkg list_installed
base-files - 2 - OpenWrt filesystem structure and scripts
base-files-brcm - 1 - Board/architecture specific files
bridge - 1.0.6-1 - Ethernet bridging tools
busybox - 1.00-2 - Core utilities for embedded Linux systems
dnsmasq - 2.22-2 - A lightweight DNS and DHCP server
dropbear - 0.45-3 - a small SSH 2 server/client designed for small memory environments.
hotplug - 2 - Hotplug script for WDS
ipkg - 0.99.149-2 - lightweight package management system
iptables - 1.3.1-1 - The netfilter firewalling software for IPv4
kernel - 2.4.30-brcm-2 -
kmod-brcm-et - 2.4.30-brcm-2 - Proprietary driver for Broadcom Ethernet chipsets
kmod-brcm-wl - 2.4.30-brcm-2 - Proprietary driver for Broadcom Wireless chipsets
kmod-diag - 2.4.30-brcm-2 - Driver for Router LEDs and Buttons
kmod-ppp - 2.4.30-brcm-2 - PPP support
kmod-pppoe - 2.4.30-brcm-2 - PPP over Ethernet support
kmod-wlcompat - 2.4.30-brcm-3 - Compatibility module for using the Wireless Extension with broadcom's wl
libgcc - 3.4.4-2 - GCC support library
libncurses - 5.2-7 - a terminal handling library and common terminal definitions
mtd - 2 - Tool for modifying the flash chip
ntpclient - 2003_194-1 - NTP client for setting system time from NTP servers.
nvram - 1 - NVRAM utility and libraries for Broadcom hardware
ppp - 2.4.3-6 - a PPP (Point-to-Point Protocol) daemon (with MPPE/MPPC support)
ppp-mod-pppoe - 2.4.3-6 - a PPPoE (PPP over Ethernet) plugin for PPP
screen - 4.0.2-1 - A 'window manager' for the terminal session
uclibc - 0.9.27-2 - Standard C library for embedded Linux systems
wificonf - 4 - Replacement utility for wlconf
wireless-tools - 28.pre7-1 - Tools for setting up WiFi cards using the Wireless Extension
zlib - 1.2.2-2 - an implementation of the deflate compression method (library)
Successfully terminated.root@OpenWrt:~>lsmod
Module Size Used by Tainted: P
pppoe 9384 1
pppox 1372 1 [pppoe]
ppp_generic 21892 3 [pppoe pppox]
slhc 6352 0 [ppp_generic]
wlcompat 14688 0 (unused)
wl 423640 0 (unused)
et 32064 0 (unused)
diag 2560 0 (unused)(Last edited by thermoman on 21 Sep 2005, 19:14)
