joerg@Ubuntu-11:~/freetz-trunk_7390/source/target-mips_uClibc-0.9.32.1/ebtables-v2.0.10-4$ file static
static: ELF 32-bit MSB executable, MIPS, MIPS32 rel2 version 1, statically linked, with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70403, not stripped
joerg@Ubuntu-11:~/freetz-trunk_7390/source/target-mips_uClibc-0.9.32.1/ebtables-v2.0.10-4$
joerg@Ubuntu-11:~/freetz-trunk_7390/source/target-mips_uClibc-0.9.32.1/ebtables-v2.0.10-4$ mips-linux-strip --remove-section={.comment,.note,.pdr} static
joerg@Ubuntu-11:~/freetz-trunk_7390/source/target-mips_uClibc-0.9.32.1/ebtables-v2.0.10-4$
joerg@Ubuntu-11:~/freetz-trunk_7390/source/target-mips_uClibc-0.9.32.1/ebtables-v2.0.10-4$ file static
static: ELF 32-bit MSB executable, MIPS, MIPS32 rel2 version 1 (SYSV), statically linked, with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70403, stripped
joerg@Ubuntu-11:~/freetz-trunk_7390/source/target-mips_uClibc-0.9.32.1/ebtables-v2.0.10-4$
joerg@Ubuntu-11:~/freetz-trunk_7390/source/target-mips_uClibc-0.9.32.1/ebtables-v2.0.10-4$ qemu-mips-static ./static
ebtables v2.0.10-4 (December 2011)
Usage:
ebtables -[ADI] chain rule-specification [options]
ebtables -P chain target
ebtables -[LFZ] [chain]
ebtables -[NX] [chain]
ebtables -E old-chain-name new-chain-name
Commands:
--append -A chain : append to chain
--delete -D chain : delete matching rule from chain
--delete -D chain rulenum : delete rule at position rulenum from chain
--change-counters -C chain
[rulenum] pcnt bcnt : change counters of existing rule
--insert -I chain rulenum : insert rule at position rulenum in chain
--list -L [chain] : list the rules in a chain or in all chains
--flush -F [chain] : delete all rules in chain or in all chains
--init-table : replace the kernel table with the initial table
--zero -Z [chain] : put counters on zero in chain or in all chains
--policy -P chain target : change policy on chain to target
--new-chain -N chain : create a user defined chain
--rename-chain -E old new : rename a chain
--delete-chain -X [chain] : delete a user defined chain
--atomic-commit : update the kernel w/t table contained in <FILE>
--atomic-init : put the initial kernel table into <FILE>
--atomic-save : put the current kernel table into <FILE>
--atomic-file file : set <FILE> to file
Options:
--proto -p [!] proto : protocol hexadecimal, by name or LENGTH
--src -s [!] address[/mask]: source mac address
--dst -d [!] address[/mask]: destination mac address
--in-if -i [!] name[+] : network input interface name
--out-if -o [!] name[+] : network output interface name
--logical-in [!] name[+] : logical bridge input interface name
--logical-out [!] name[+] : logical bridge output interface name
--set-counters -c chain
pcnt bcnt : set the counters of the to be added rule
--modprobe -M program : try to insert modules using this program
--concurrent : use a file lock to support concurrent scripts
--version -V : print package version
Environment variable:
EBTABLES_ATOMIC_FILE : if set <FILE> (see above) will equal its value
Standard targets: DROP, ACCEPT, RETURN or CONTINUE;
The target can also be a user defined chain.
Supported chains for the filter table:
INPUT FORWARD OUTPUT
joerg@Ubuntu-11:~/freetz-trunk_7390/source/target-mips_uClibc-0.9.32.1/ebtables-v2.0.10-4$
joerg@Ubuntu-11:~/freetz-trunk_7390/source/target-mips_uClibc-0.9.32.1/ebtables-v2.0.10-4$
Doch, Freetz kann das.Der Freetz Buildaufruf gibt nicht den notwendien static-Aufruf mit.
Auch hier, das ist mit Freetz möglich. Schau mal nach own-files...., aber das ins Freetz Image zu integrieren, als Static Variante, wäre schon besser.
Das geht mit der ebtables.mk-Datei.ja, und wie?
Und warum nicht? Du kannst auch nichts Anderes als der Kollege machen.Also, ich möchte nicht die vom Kollegen static gelinkte Datei in mein Image als "own" Datei übernehmen,
Die Freetz Entwicklung hat andere Sorgen. ;-)... sondern ebtables über make menuconfig auswählen, static linken, ins Image übernehmen lassen und dann das ganze gerne in die Freetz Entwicklung abgeben, damit ein neues interessantes Tool die Freetz Umgebung erweitert.
root@fritz:/var/mod/root# ebtables -L --Lc
Bridge table: filter
Bridge chain: INPUT, entries: 0, policy: ACCEPT
Bridge chain: FORWARD, entries: 0, policy: ACCEPT
Bridge chain: OUTPUT, entries: 0, policy: ACCEPT
root@fritz:/var/mod/root# ebtables -A INPUT -s 00:11:22:33:44:55 -j DROP
root@fritz:/var/mod/root#
root@fritz:/var/mod/root# ebtables -L --Lc
Bridge table: filter
Bridge chain: INPUT, entries: 1, policy: ACCEPT
-s 0:11:22:33:44:55 -j DROP , pcnt = 0 -- bcnt = 0
Bridge chain: FORWARD, entries: 0, policy: ACCEPT
Bridge chain: OUTPUT, entries: 0, policy: ACCEPT
root@fritz:/var/mod/root#
root@fritz:/var/mod/root#
root@fritz:/var/mod/root## auf dem PC MAC geändert und gepingt, s.u.
root@fritz:/var/mod/root#
root@fritz:/var/mod/root#
Bridge table: filter
Bridge chain: INPUT, entries: 1, policy: ACCEPT
-s 0:11:22:33:44:55 -j DROP , pcnt = 3 -- bcnt = 138
Bridge chain: FORWARD, entries: 0, policy: ACCEPT
Bridge chain: OUTPUT, entries: 0, policy: ACCEPT
root@fritz:/var/mod/root# arp -an
? (192.168.178.12) at 00:11:22:33:44:66 [ether] on lan
root@fritz:/var/mod/root#
joerg@Ubuntu-11:~/freetz-trunk$ ping 192.168.178.2
PING 192.168.178.2 (192.168.178.2) 56(84) bytes of data.
64 bytes from 192.168.178.2: icmp_req=1 ttl=64 time=0.664 ms
64 bytes from 192.168.178.2: icmp_req=2 ttl=64 time=0.595 ms
64 bytes from 192.168.178.2: icmp_req=3 ttl=64 time=0.646 ms
64 bytes from 192.168.178.2: icmp_req=4 ttl=64 time=0.600 ms
^C
--- 192.168.178.2 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2997ms
rtt min/avg/max/mdev = 0.595/0.626/0.664/0.034 ms
joerg@Ubuntu-11:~/freetz-trunk$ sudo ifconfig eth0:12 192.168.178.12 hw ether 00:11:22:33:44:55
joerg@Ubuntu-11:~/freetz-trunk$ ping 192.168.178.2
PING 192.168.178.2 (192.168.178.2) 56(84) bytes of data.
^C
--- 192.168.178.2 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2015ms
joerg@Ubuntu-11:~/freetz-trunk$ sudo ifconfig eth0:12 192.168.178.12 hw ether 00:11:22:33:44:66
joerg@Ubuntu-11:~/freetz-trunk$ ping 192.168.178.2
PING 192.168.178.2 (192.168.178.2) 56(84) bytes of data.
64 bytes from 192.168.178.2: icmp_req=1 ttl=64 time=2.73 ms
64 bytes from 192.168.178.2: icmp_req=2 ttl=64 time=0.916 ms
^C
--- 192.168.178.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.916/1.826/2.736/0.910 ms
joerg@Ubuntu-11:~/freetz-trunk$
root@fritz:/var/mod/root# ebtables
ebtables v2.0.10-4 (December 2011)
Usage:
ebtables -[ADI] chain rule-specification [options]
ebtables -P chain target
ebtables -[LFZ] [chain]
ebtables -[NX] [chain]
ebtables -E old-chain-name new-chain-name
Commands:
--append -A chain : append to chain
--delete -D chain : delete matching rule from chain
--delete -D chain rulenum : delete rule at position rulenum from chain
--change-counters -C chain
[rulenum] pcnt bcnt : change counters of existing rule
--insert -I chain rulenum : insert rule at position rulenum in chain
--list -L [chain] : list the rules in a chain or in all chains
--flush -F [chain] : delete all rules in chain or in all chains
--init-table : replace the kernel table with the initial table
--zero -Z [chain] : put counters on zero in chain or in all chains
--policy -P chain target : change policy on chain to target
--new-chain -N chain : create a user defined chain
--rename-chain -E old new : rename a chain
--delete-chain -X [chain] : delete a user defined chain
--atomic-commit : update the kernel w/t table contained in <FILE>
--atomic-init : put the initial kernel table into <FILE>
--atomic-save : put the current kernel table into <FILE>
--atomic-file file : set <FILE> to file
Options:
--proto -p [!] proto : protocol hexadecimal, by name or LENGTH
--src -s [!] address[/mask]: source mac address
--dst -d [!] address[/mask]: destination mac address
--in-if -i [!] name[+] : network input interface name
--out-if -o [!] name[+] : network output interface name
--logical-in [!] name[+] : logical bridge input interface name
--logical-out [!] name[+] : logical bridge output interface name
--set-counters -c chain
pcnt bcnt : set the counters of the to be added rule
--modprobe -M program : try to insert modules using this program
--concurrent : use a file lock to support concurrent scripts
--version -V : print package version
Environment variable:
EBTABLES_ATOMIC_FILE : if set <FILE> (see above) will equal its value
Standard targets: DROP, ACCEPT, RETURN or CONTINUE;
The target can also be a user defined chain.
Supported chains for the filter table:
INPUT FORWARD OUTPUT
root@fritz:/var/mod/root# ebtables -A INPUT -s 00:11:22:33:44:55 -j DROP
modprobe: can't load module ebtables (kernel/net/bridge/netfilter/ebtables.ko): invalid module format
The kernel doesn't support the ebtables 'filter' table.
root@fritz:/var/mod/root#
root@fritz:/var/mod/root# modprobe ebtables.ko
modprobe: can't load module ebtables.ko (kernel/net/bridge/netfilter/ebtables.ko): invalid module format
root@fritz:/var/mod/root#
root@fritz:/var/mod/root# cd /lib/modules/2.6.28.10/kernel/net/bridge/netfilter/
root@fritz:/lib/modules/2.6.28.10/kernel/net/bridge/netfilter# ls
ebtables.ko
root@fritz:/lib/modules/2.6.28.10/kernel/net/bridge/netfilter#
root@fritz:/lib/modules/2.6.28.10/kernel/net/bridge/netfilter# modprobe ebtables
.ko -v
modprobe: can't load module ebtables.ko (kernel/net/bridge/netfilter/ebtables.ko): invalid module format
root@fritz:/lib/modules/2.6.28.10/kernel/net/bridge/netfilter#
root@fritz:/var/mod/root# modprobe ebtables -D
insmod /lib/modules/2.6.28.10/kernel/net/bridge/netfilter/ebtables.ko
root@fritz:/var/mod/root#
freetz@freetz-linux:~$ file freetz-trunk/build/modified/filesystem/lib/modules/2.6.28.10/kernel/net/bridge/netfilter/ebtables.ko
freetz-trunk/build/modified/filesystem/lib/modules/2.6.28.10/kernel/net/bridge/netfilter/ebtables.ko: ELF 32-bit MSB relocatable, MIPS, MIPS32 rel2 version 1 (SYSV), with unknown capability 0x41000000 = 0xf676e75, not stripped
freetz@freetz-linux:~$
...
avm_pa: telephony inactive
ebtables: exports duplicate symbol ebt_do_table (owned by kernel)
ebtables: exports duplicate symbol ebt_do_table (owned by kernel)
ebtables: exports duplicate symbol ebt_do_table (owned by kernel)
ebtables: exports duplicate symbol ebt_do_table (owned by kernel)
ebtables: exports duplicate symbol ebt_do_table (owned by kernel)
# block DHCP incoming/outgoing width ebtables
echo "create ebtables rules"
ebtables -A INPUT --in-interface tap0 --protocol 0x0800 --ip-protocol udp --ip-source-port 67:68 -j DROP
ebtables -A INPUT --in-interface tap0 --protocol 0x0800 --ip-protocol udp --ip-destination-port 67:68 -j DROP
ebtables -A FORWARD --in-interface tap0 --protocol 0x0800 --ip-protocol udp --ip-destination-port 67:68 -j DROP
ebtables -A FORWARD --in-interface tap0 --protocol 0x0800 --ip-protocol udp --ip-source-port 67:68 -j DROP