Packet change and redirect using ebtables

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Packet change and redirect using ebtables
# 1  
Old 04-06-2011
Packet change and redirect using ebtables

Hey all
I need your help with ebtables. I want to redirect traffic through local interfaces.
I have am Ubuntu linux machine with several NICs.
(I understand that ebtables is the same for RH)...
eth0 and eth1 are part of a bridge (br0) and they are connected to tap device. On eth0 I get traffic from network 10.10.10.0/24 to the internet.
Through eth1 I get the responses, internet addresses to 10.10.10.0/24.
None of the packets are destined to the linux host (on L3 and L2 as well).
My goal is to separate the traffic to other interfaces.
Every packet that enters eth0 with source ip 10.10.10.0/24 should be routed or redirected to eth3 (Packet should have the same source and destination IP but the frame should now contain a new SRC MAC, eth3's MAC).
The same applies to traffic that is coming in from eth1. I want to route it to eth4.
eth0 and eth1 are unidirectional, that means that I can't change the traffic and I'm only intercepting it.
Can you please help me build this filter using ebtables ?
I had no luck so far.
Thanks !!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Packet loss coming with big packet size ping

(5 Replies)
Discussion started by: Vishal_dba
5 Replies

2. IP Networking

Berkley Packet Filter

Hi Folks! Im trying to write a packet capture filter on a opnet device. The syntax there to write this filter is BPF. What I wanna do is to capture everything, but from a certain ip-range I just wanna capture the header and not the payload. For your understanding: We are writing our backup to... (1 Reply)
Discussion started by: ati
1 Replies

3. UNIX for Advanced & Expert Users

Delete all ebtables rules

Hi All, I configured a bridged debian firewall using bridging utilities. This works fine & I have been monitoring all users connecting to the internet & bandwidth usage. There are 2 interfaces eth0 & eth1 which i have configured as bridged interface br0. Today, I installed squid on the... (1 Reply)
Discussion started by: coolatt
1 Replies

4. Homework & Coursework Questions

filter packet

Exercise: Protection of WEB and DNS servers using the context-free rules for packet filtering: - Protect your WEB-server, so that would be for him can be accessed by browsers, and could go to dns. - Protect your primary DNS-server so that it could be to contact clients and secondary servers.... (1 Reply)
Discussion started by: numeracy
1 Replies

5. Cybersecurity

filter packet

Exercise: Protection of WEB and DNS servers using the context-free rules for packet filtering: - Protect your WEB-server, so that would be for him can be accessed by browsers, and could go to dns. - Protect your primary DNS-server so that it could be to contact clients and secondary servers.... (1 Reply)
Discussion started by: numeracy
1 Replies

6. IP Networking

Packet decoding

Hi, wondering if anyone can suggest a tool to me that will let me either cut & paste hex or type it in for packet decoding. I want to be able to decode a packet as done with tcpdump or wireshark, but I want to be able to manually input the hex myself. (2 Replies)
Discussion started by: Breakology
2 Replies

7. Programming

packet capture

can anyone tell me how can i capture the packets. i have tried ethernet software to capture them but its not doing what i want it to do it (1 Reply)
Discussion started by: dazdseg
1 Replies

8. Programming

Packet capturing using pcap

Hi, i am using a linux CentOS machine. I have 2 real network interfaces eth0, eth1 and 2 virtual interfaces tap0 and tap1. I am using PCAP library to capture the packets on theses interfaces. If i specify the interface as "any", i cannot find a way to know from which interface the packet... (1 Reply)
Discussion started by: rahulnitk2004
1 Replies

9. Programming

Real Packet Counter

Hello Experts, I want to program a realtime Packet counter, that is consist of two threads, first is packet counter engine and second is a (QTWidget)QT gui program(main process) for painting a real time chart, which classes or events are suitable for doing that? (OpenGL or Paint event or ...).note... (0 Replies)
Discussion started by: galaxy.ice
0 Replies

10. IP Networking

Seeing IP packet

Hi, Is there any way that i can directly take out the IP packet and see its contents. Waiting for your answer .............. Bye (4 Replies)
Discussion started by: manjunath
4 Replies
Login or Register to Ask a Question
iptables_selinux(8)					      SELinux Policy iptables					       iptables_selinux(8)

NAME
iptables_selinux - Security Enhanced Linux Policy for the iptables processes DESCRIPTION
Security-Enhanced Linux secures the iptables processes via flexible mandatory access control. The iptables processes execute with the iptables_t SELinux type. You can check if you have these processes running by executing the ps com- mand with the -Z qualifier. For example: ps -eZ | grep iptables_t ENTRYPOINTS
The iptables_t SELinux type can be entered via the iptables_exec_t file type. The default entrypoint paths for the iptables_t domain are the following: /sbin/ip6?tables.*, /sbin/ip6?tables-multi.*, /sbin/ip6?tables-restore.*, /usr/sbin/ip6?tables.*, /usr/sbin/ip6?tables-multi.*, /usr/sbin/ip6?tables-restore.*, /sbin/ipchains.*, /usr/sbin/ipchains.*, /sbin/ipset, /sbin/ipvsadm, /sbin/ebtables, /usr/sbin/ipset, /usr/sbin/ipvsadm, /usr/libexec/ipset, /sbin/ipvsadm-save, /usr/sbin/ebtables, /sbin/xtables-multi, /sbin/ipvsadm-restore, /sbin/ebtables- restore, /usr/sbin/ipvsadm-save, /usr/sbin/xtables-multi, /usr/sbin/ipvsadm-restore, /usr/sbin/ebtables-restore PROCESS TYPES
SELinux defines process types (domains) for each process running on the system You can see the context of a process using the -Z option to ps Policy governs the access confined processes have to files. SELinux iptables policy is very flexible allowing users to setup their ipta- bles processes in as secure a method as possible. The following process types are defined for iptables: iptables_t Note: semanage permissive -a iptables_t can be used to make the process type iptables_t permissive. SELinux does not deny access to permis- sive process types, but the AVC (SELinux denials) messages are still generated. BOOLEANS
SELinux policy is customizable based on least access required. iptables policy is extremely flexible and has several booleans that allow you to manipulate the policy and run iptables with the tightest access possible. If you want to allow users to resolve user passwd entries directly from ldap rather then using a sssd server, you must turn on the authlo- gin_nsswitch_use_ldap boolean. Disabled by default. setsebool -P authlogin_nsswitch_use_ldap 1 If you want to allow all daemons the ability to read/write terminals, you must turn on the daemons_use_tty boolean. Disabled by default. setsebool -P daemons_use_tty 1 If you want to deny any process from ptracing or debugging any other processes, you must turn on the deny_ptrace boolean. Enabled by default. setsebool -P deny_ptrace 1 If you want to allow dhcpc client applications to execute iptables commands, you must turn on the dhcpc_exec_iptables boolean. Disabled by default. setsebool -P dhcpc_exec_iptables 1 If you want to allow all domains to use other domains file descriptors, you must turn on the domain_fd_use boolean. Enabled by default. setsebool -P domain_fd_use 1 If you want to allow all domains to have the kernel load modules, you must turn on the domain_kernel_load_modules boolean. Disabled by default. setsebool -P domain_kernel_load_modules 1 If you want to allow all domains to execute in fips_mode, you must turn on the fips_mode boolean. Enabled by default. setsebool -P fips_mode 1 If you want to enable reading of urandom for all domains, you must turn on the global_ssp boolean. Disabled by default. setsebool -P global_ssp 1 If you want to allow confined applications to run with kerberos, you must turn on the kerberos_enabled boolean. Enabled by default. setsebool -P kerberos_enabled 1 If you want to allow system to run with NIS, you must turn on the nis_enabled boolean. Disabled by default. setsebool -P nis_enabled 1 If you want to allow confined applications to use nscd shared memory, you must turn on the nscd_use_shm boolean. Disabled by default. setsebool -P nscd_use_shm 1 NSSWITCH DOMAIN
If you want to allow users to resolve user passwd entries directly from ldap rather then using a sssd server for the iptables_t, you must turn on the authlogin_nsswitch_use_ldap boolean. setsebool -P authlogin_nsswitch_use_ldap 1 If you want to allow confined applications to run with kerberos for the iptables_t, you must turn on the kerberos_enabled boolean. setsebool -P kerberos_enabled 1 MANAGED FILES
The SELinux process type iptables_t can manage files labeled with the following file types. The paths listed are the default paths for these file types. Note the processes UID still need to have DAC permissions. etc_runtime_t /[^/]+ /etc/mtab.* /etc/blkid(/.*)? /etc/nologin.* /etc/.fstab.hal..+ /halt /poweroff /fastboot /etc/cmtab /forcefsck /.autofsck /.suspended /fsckoptions /.autorelabel /etc/killpower /etc/securetty /etc/nohotplug /etc/ioctl.save /etc/fstab.REVOKE /etc/network/ifstate /etc/sysconfig/hwconf /etc/ptal/ptal-printd-like /etc/sysconfig/iptables.save /etc/xorg.conf.d/00-system-setup-keyboard.conf /etc/X11/xorg.conf.d/00-system-setup-keyboard.conf initrc_tmp_t iptables_tmp_t iptables_var_run_t psad_tmp_t psad_var_log_t /var/log/psad(/.*)? shorewall_var_lib_t /var/lib/shorewall(/.*)? /var/lib/shorewall6(/.*)? /var/lib/shorewall-lite(/.*)? system_conf_t /etc/yum.repos.d(/.*)? /etc/sysctl.conf(.old)? /etc/sysconfig/ip6?tables.* /etc/sysconfig/ipvsadm.* /etc/sysconfig/ebtables.* /etc/sysconfig/system-config-firewall.* FILE CONTEXTS
SELinux requires files to have an extended attribute to define the file type. You can see the context of a file using the -Z option to ls Policy governs the access confined processes have to these files. SELinux iptables policy is very flexible allowing users to setup their iptables processes in as secure a method as possible. STANDARD FILE CONTEXT SELinux defines the file context types for the iptables, if you wanted to store files with these types in a diffent paths, you need to exe- cute the semanage command to sepecify alternate labeling and then use restorecon to put the labels on disk. semanage fcontext -a -t iptables_exec_t '/srv/iptables/content(/.*)?' restorecon -R -v /srv/myiptables_content Note: SELinux often uses regular expressions to specify labels that match multiple files. The following file types are defined for iptables: iptables_exec_t - Set files with the iptables_exec_t type, if you want to transition an executable to the iptables_t domain. Paths: /sbin/ip6?tables.*, /sbin/ip6?tables-multi.*, /sbin/ip6?tables-restore.*, /usr/sbin/ip6?tables.*, /usr/sbin/ip6?tables-multi.*, /usr/sbin/ip6?tables-restore.*, /sbin/ipchains.*, /usr/sbin/ipchains.*, /sbin/ipset, /sbin/ipvsadm, /sbin/ebtables, /usr/sbin/ipset, /usr/sbin/ipvsadm, /usr/libexec/ipset, /sbin/ipvsadm-save, /usr/sbin/ebtables, /sbin/xtables-multi, /sbin/ipvsadm-restore, /sbin/ebta- bles-restore, /usr/sbin/ipvsadm-save, /usr/sbin/xtables-multi, /usr/sbin/ipvsadm-restore, /usr/sbin/ebtables-restore iptables_initrc_exec_t - Set files with the iptables_initrc_exec_t type, if you want to transition an executable to the iptables_initrc_t domain. Paths: /etc/rc.d/init.d/ip6?tables, /etc/rc.d/init.d/ebtables iptables_tmp_t - Set files with the iptables_tmp_t type, if you want to store iptables temporary files in the /tmp directories. iptables_unit_file_t - Set files with the iptables_unit_file_t type, if you want to treat the files as iptables unit content. Paths: /usr/lib/systemd/system/ppp.*, /usr/lib/systemd/system/ipset.*, /usr/lib/systemd/system/vsftpd.*, /usr/lib/systemd/system/proftpd.*, /usr/lib/systemd/system/iptables.*, /usr/lib/systemd/system/ip6tables.* iptables_var_run_t - Set files with the iptables_var_run_t type, if you want to store the iptables files under the /run or /var/run directory. Note: File context can be temporarily modified with the chcon command. If you want to permanently change the file context you need to use the semanage fcontext command. This will modify the SELinux labeling database. You will need to use restorecon to apply the labels. COMMANDS
semanage fcontext can also be used to manipulate default file context mappings. semanage permissive can also be used to manipulate whether or not a process type is permissive. semanage module can also be used to enable/disable/install/remove policy modules. semanage boolean can also be used to manipulate the booleans system-config-selinux is a GUI tool available to customize SELinux policy settings. AUTHOR
This manual page was auto-generated using sepolicy manpage . SEE ALSO
selinux(8), iptables(8), semanage(8), restorecon(8), chcon(1), sepolicy(8) , setsebool(8) iptables 14-06-10 iptables_selinux(8)