Can I bridge without a bridge?

Can I bridge without a bridge?

Post by buck » Tue, 19 Oct 2004 12:07:37



Hi,

I'm not well tonight, so please cut me a little slack if this is
stupid.

The ISP has assigned a /29 network and there are presently 3 computers
each with its own external IP connected.

I want to insert a new computer that will do a bit of firewalling and
packet shaping, then forward the traffic.  I wish iptables to only
DROP/REJECT, not SNAT/DNAT.  I would describe this as "bridging
without a bridge" because ALL traffic should be forwarded, not just
certain ports.

I'm not good with ASCII art, but here's my attempt to describe what is
desired:

             ISP
               |
 111.222.111.152/29  network
               |
            eth0
    new Linux box
            eth1
               |
  8 port ethernet switch
       |          |          |
    .154   .155   .156

Should I set up aliases on eth0?  (I know "alias" is an outdated term,
but I can't think of the right term.)  If so, how will packets get
forwarded?  In other words, what - if any - additional "route"
commands must be issued?  Please remember, no NAT...

If I shouldn't alias, what should be done?   I tried proxyARP; it Just
Does Not Work, which I think is because there can be only one route
for a given IP/netmask.

gypsy

 
 
 

Can I bridge without a bridge?

Post by David Efflan » Wed, 20 Oct 2004 03:04:09



> Hi,

> I'm not well tonight, so please cut me a little slack if this is
> stupid.

> The ISP has assigned a /29 network and there are presently 3 computers
> each with its own external IP connected.

> I want to insert a new computer that will do a bit of firewalling and
> packet shaping, then forward the traffic.  I wish iptables to only
> DROP/REJECT, not SNAT/DNAT.  I would describe this as "bridging
> without a bridge" because ALL traffic should be forwarded, not just
> certain ports.

> I'm not good with ASCII art, but here's my attempt to describe what is
> desired:

>              ISP
>                |
>  111.222.111.152/29  network
>                |
>             eth0
>     new Linux box
>             eth1
>                |
>   8 port ethernet switch
>        |          |          |
>     .154   .155   .156

> Should I set up aliases on eth0?  (I know "alias" is an outdated term,
> but I can't think of the right term.)  If so, how will packets get
> forwarded?  In other words, what - if any - additional "route"
> commands must be issued?  Please remember, no NAT...

> If I shouldn't alias, what should be done?   I tried proxyARP; it Just
> Does Not Work, which I think is because there can be only one route
> for a given IP/netmask.

Your mistake with proxy_arp was probably the netmask for eth0 interface
or conflicting/missing routing for eth1 hosts.

Your eth0 should be configured with netmask 255.255.255.255, broadcast
same as IP, host route to the gateway on eth0, and default route to that
gateway.

Then your eth1 could use the same IP as eth0, netmask 255.255.255.248.  
Your public boxes on private side would use your eth0/eth1 IP as gateway.

echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp

Then it should work, with eth0 answering incoming arp requests for your
IPs on eth1.  I am doing something similar with a /29 wireless subnet of
my main /24 LAN.  Although, I set proxy_arp in my main network scripts
(which works during boot) something occasionally tends to clear proxy_arp
to zero (maybe my pppoe reconnecting when dropped).

            ISP
             |
    111.222.111.152/32, host route to ISP gw, default to gw
             |
           eth0 proxy_arp enabled
       new Linux box
           eth1
             |
    111.222.111.152/29
             |
  8 port ethernet switch
      |      |      |
    .154   .155   .156

 
 
 

Can I bridge without a bridge?

Post by Moe Tr » Wed, 20 Oct 2004 09:21:21



>I want to insert a new computer that will do a bit of firewalling and
>packet shaping, then forward the traffic.  I wish iptables to only
>DROP/REJECT, not SNAT/DNAT.  I would describe this as "bridging
>without a bridge" because ALL traffic should be forwarded, not just
>certain ports.

Well, you almost hit the right words. The one you are missing is
"transparent", and this is covered in the bridging howtos.

[compton ~]$ grep -il transpa /usr/doc/HOWTO/Bridge*  
/usr/doc/HOWTO/Bridge+Firewall+DSL
/usr/doc/HOWTO/Bridge
[compton ~]$

Quote:>Should I set up aliases on eth0?  (I know "alias" is an outdated term,

Nope - a transparent bridge has no IP addresses - it just passes
packets from one interface to the other.

Quote:>If I shouldn't alias, what should be done?   I tried proxyARP; it Just
>Does Not Work, which I think is because there can be only one route
>for a given IP/netmask.

Right concept. If you have two routes to a place, which one do you use?
The bridge gets around this.

        Old guy

 
 
 

Can I bridge without a bridge?

Post by buck » Wed, 20 Oct 2004 11:26:02




Quote:> Your mistake with proxy_arp was probably the netmask for eth0 interface
> or conflicting/missing routing for eth1 hosts.

> Your eth0 should be configured with netmask 255.255.255.255, broadcast
> same as IP, host route to the gateway on eth0, and default route to that
> gateway.

> Then your eth1 could use the same IP as eth0, netmask 255.255.255.248.  
> Your public boxes on private side would use your eth0/eth1 IP as gateway.

> echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp

> Then it should work, with eth0 answering incoming arp requests for your
> IPs on eth1.  I am doing something similar with a /29 wireless subnet of
>             ISP
>              |
>     111.222.111.152/32, host route to ISP gw, default to gw
>              |
>            eth0 proxy_arp enabled
>        new Linux box
>            eth1
>              |
>     111.222.111.152/29
>              |
>   8 port ethernet switch
>       |      |      |
>     .154   .155   .156

No Joy.  The GW is 153.  Only an unused IP (157 or 158) can be used for
eth0.  Do you see what I've done wrong?  (Do you need a description of
WBTH/WGTFTH?):

|#!/bin/bash -x
|
|# This does I/O and does not generate any errors.
|# However, proxyARP doesn't work.
|
|/usr/sbin/firewall.sh stop   # Set Policy ACCEPT, Flush
|ifconfig eth1 down
|ifconfig eth0 down
|ifconfig lo down
|modprobe -r 3c59x
|modprobe -r 8139too
|ifconfig lo 127.0.0.1
|
|modprobe 8139too
|ifconfig eth0 206.72.89.158 broadcast 206.72.89.158 \
|netmask 255.255.255.255
|
|modprobe 3c59x
|ifconfig eth1 206.72.89.158 broadcast 206.72.89.159 \
|netmask 255.255.255.248
|
|ip route add 206.72.89.153 dev eth0
|route add default gw 206.72.89.153
|echo 1 >/proc/sys/net/ipv4/conf/eth0/proxy_arp
|echo 1 >/proc/sys/net/ipv4/ip_forward
|# The above purportedly will answer arp requests for all IPs on eth1
|iptables -A FORWARD -j LOG

FWIW, 154 155 and 156 all use the same 'ifconfig eth1' and 'default gw'
entries, identical except for IP.  I "wrapped" the long lines for posting.

gypsy
"WBTH/WGTFTH" copyright the author.

 
 
 

Can I bridge without a bridge?

Post by David Efflan » Thu, 21 Oct 2004 23:26:56





>> Your mistake with proxy_arp was probably the netmask for eth0 interface
>> or conflicting/missing routing for eth1 hosts.

>> Your eth0 should be configured with netmask 255.255.255.255, broadcast
>> same as IP, host route to the gateway on eth0, and default route to that
>> gateway.

>> Then your eth1 could use the same IP as eth0, netmask 255.255.255.248.  
>> Your public boxes on private side would use your eth0/eth1 IP as gateway.

>> echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp

>> Then it should work, with eth0 answering incoming arp requests for your
>> IPs on eth1.  I am doing something similar with a /29 wireless subnet of

>>             ISP
>>              |
>>     111.222.111.152/32, host route to ISP gw, default to gw

I thought that IP refered you your eth0 IP, but on further examination and
details is actually your network IP, which on your ISP's modem/router's
internal side would be apparently .153/255.255.255.248 (to reach all your
IPs), if it has no way to set more specific internal routing.

The reason for 255.255.255.255 netmask on Linux eth0 is because only route
in that direction from Linux would be -host route to .153 and default gw
.153.

Quote:>>              |
>>            eth0 proxy_arp enabled
>>        new Linux box
>>            eth1
>>              |
>>     111.222.111.152/29
>>              |
>>   8 port ethernet switch
>>       |      |      |
>>     .154   .155   .156

> No Joy.  The GW is 153.  Only an unused IP (157 or 158) can be used for
> eth0.  Do you see what I've done wrong?  (Do you need a description of
> WBTH/WGTFTH?):

I do not know what WBTH/WGTFTH refers to.

- Show quoted text -

Quote:>|#!/bin/bash -x
>|
>|# This does I/O and does not generate any errors.
>|# However, proxyARP doesn't work.
>|
>|/usr/sbin/firewall.sh stop   # Set Policy ACCEPT, Flush
>|ifconfig eth1 down
>|ifconfig eth0 down
>|ifconfig lo down
>|modprobe -r 3c59x
>|modprobe -r 8139too
>|ifconfig lo 127.0.0.1
>|
>|modprobe 8139too
>|ifconfig eth0 206.72.89.158 broadcast 206.72.89.158 \
>|netmask 255.255.255.255
>|
>|modprobe 3c59x
>|ifconfig eth1 206.72.89.158 broadcast 206.72.89.159 \
>|netmask 255.255.255.248
>|
>|ip route add 206.72.89.153 dev eth0

I am not familiar with "ip route", is that the same as "route add -host"
(ie, how does ip route know if adding a host or net route)?

Quote:>|route add default gw 206.72.89.153

Not sure if the ip_forward needs to be done before the proxy_arp (or if
it matters).

Quote:>|echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp
>|echo 1 > /proc/sys/net/ipv4/ip_forward
>|# The above purportedly will answer arp requests for all IPs on eth1
>|iptables -A FORWARD -j LOG

> FWIW, 154 155 and 156 all use the same 'ifconfig eth1' and 'default gw'
> entries, identical except for IP.  I "wrapped" the long lines for posting.

> gypsy
> "WBTH/WGTFTH" copyright the author. >

Can Linux reach all of the .153 gateway and .154 .155 .156?  The only
thing I can think of offhand is if ip route is setting a net instead of
host route.  But that should be easy enough to tell from route -n.
 
 
 

1. I'm Desperate: Proxy ARP and Bridging without the Bridge

Hi everyone! I have a quick question about Proxy ARP. I've been trying
to get this thing working for days, and I can't seem to find any
documentation on this matter what so ever, so I'm hoping somebody out
there who knows a lot about networking (which isn't me!) can answer my
question!

I have some computers on a network 128.2.24.0, with a netmask of
255.255.252.0 (/22 I think?). The router is at 128.2.24.1. I wanted to
setup a "transparent firewall" with proxy arp and iptables and
friends. Naturally, I made a box with two network interfaces (It has
two IPs, .68, and .69.), and put my laptop on one side for testing,
and the public network is on the other side. I setup a static route
for my laptop on the firewall, and I can ping it from the firewall,
and can ping outside nodes from the firewall. The problem is - when I
enable proxy arp and IP forwarding, it only works for nodes in my
subnet (128.2.24.0/255.255.252.0)! I can ping outside hosts (still in
my subnet) from my laptop, and from machines in my subnet, I can ping
my laptop, too, so proxy ARP seems to be working. When I try to ping a
host on the Internet (not even on the rest of the 128.2.0.0/16
network, it doesn't work! Neither do any nodes outside
128.2.24.0/255.255.252.0. It's like everytime it needs the router to
route traffic, it doesn't work! I placed a protocol analyzer on the
outside, and I see the replies come back from the external test hosts,
but they never reach the other side of my firewall - they are
addressed to the computer on the other side (with a destination mac
address of 0:0:0:0:0:1?), but shouldn't the firewall "proxy" (i.e. act
as it) and accept those packets and forward them on? I even tried
putting the outside interface in promiscious mode! Nothing seems to
work! Do I need to put a route on the 128.2.24.1 router, telling it
about my firewall? But isn't this a "pseudo bridge?" Or is it the
router's ARP cache? I can't force it to expire (I don't have access to
it), so I can't verify that unfortunately. A route isn't an option,
either, so I hope I don't need one. Somebody in the CS department here
has done it, but they have their own CS router, so maybe he added a
route for his firewall on it... I'm lost!

Thanks for any reply and your time,

Jeff.

2. Irwin tape drive

3. Bridging Firewall - got bridging working, How do I firewall?

4. Help on solaris rcp

5. PATCH: Fix CardBus bridge behind a PCI bridge

6. FMTI and ETI (character user interface) on system V release 4.

7. bridging problem -- bridge needs IP address

8. cern_httpd 3.0 and QuickTime movies

9. S1692DL Tiger 2 unknown PCI bridge :unknown Host bridge :unknown PCI Device

10. Configuring PCI<-->PCI bridges behind Cardbus bridges

11. 2.4.21-rc6-ac1 PCMCIA: Cardbus bridge behind transparent P2P bridge

12. Bridge: Linux as a bridge

13. When bridging on OpenBSD, OpenBSD-bridge have problem about arp....