IP Masquerading problem with packet socket.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I have constructed a number of device drivers (dev1 - dev3), which is accessed from 
an userspace program via a packet interface. All devices are connected to a bridge 
(br0) with a static IP address 192.168.0.1/24 and a running DHCP server. Besides this
I have an external interface (eth0) assigned with a dynamic IP address.

Now I would like to make access from the 3 devices to the external interface by using 
IP Masquerading at the same time. I found an example on the web with a similar setup
(see figure 7b) where eth1 and eth2 is exchanged with dev1 - dev3:

http://ebtables.sourceforge.net/br_fw_ia/br_fw_ia.html#section4

I then tried to use the following configuration after the bridge was setup with a running 
DHCP server, the device driver interfaces and a IP address, but without any luck:

iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -d 192.168.0.0/24 -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE

echo '1' > /proc/sys/net/ipv4/ip_forward

I do not know if the problem is related to IP forwarding because (as I know) this is done
in the IP stack and hereby does not work with a AF_PACKET socket, since this is a direct 
layer 2 connection between the device driver and the userspace program. 

Thank you in advance for you help!


Best Regards,

Jeppe Frandsen,
Denmark


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux