All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Crocker <matthew@crocker.com>
To: lartc@vger.kernel.org
Subject: [LARTC] Virtual Routers  would this work?
Date: Sat, 01 Mar 2003 15:27:13 +0000	[thread overview]
Message-ID: <marc-lartc-104653245629920@msgid-missing> (raw)

Hello all,

  I need a virtual firewall/router solution.  I'm thinking of a 
netscreen 1000 but I want to know if it can be done in Linux.

Here is my idea:

1 Linux box
2 GigE interfaces

1 interface setup with a public IP address ($PUBIP)
1 interface setup with 802.1q VLAN trunking with 100 vlans assigned 
($VLAN1-$VLAN100)

a /25 subnet routed to $PUBIP from my core routers

All $VLAN interfaces setup with IP 192.168.1.1/24

Inbound traffic on $VLAN gets marked with a fwmark ($VLAN1 = fw1, 
$VLAN2 = fw2)
Outbound traffic gets NAT'ed based on the fwmark to an IP in the subnet

Returning traffic gets marked based on the dest IP (one of the subnets) 
with the same fwmark for the appropriate VLAN

returning packets are 'unNAT'ed' and then routed down the correct VLAN 
based on the fwmark on the packet.

Questions:

How will Linux react if I put 192.168.1.1 on >1 interfaces?
Does the unNAT'ing of the packets destroy the fwmark?
Is there a way of handling kernel based packets (ICMP, ARP responses) 
so they go out the correct interface?
Example: an ARP (who has 192.168.1.1) from in on VLAN5,  How can I get 
the kernel to send its response on VLAN5?

I see the packet flow as something like.


Client (192.168.1.100) sends SYN to www.redhat.com:80
Client has default gw of 192.168.1.1
Client is on 802.1q VLAN10
Client puts packet on Ethernet VLAN10 with MAC address of Linux box
Packet enters Linux box on VLAN10 Source:ClientIP Dest:www.redhat.com:80
Packet gets marked by iptables rule.  FWMARK = 10
Packet gets routed out to upstream gateway
Packet gets NAT'ed to SUBNETIP10 based on FWMARK 10
Packet now looks like  src: SUBNETIP10:NATPORT  dst:REDHAT:80

Response packet from redhat flows
Packet enters Linux box src REDHAT:80 dst SUBNETIP10:NATPORT
Packet gets tagged with fwmark based on SUBNETIP to FWMARK 10
Packet gets unNAT'ed by kernel NAT table
Packet looks like src REDHAT:80 dst CLIENTIP:CLIENTPORT fwmark:10
iproute2 setup routes CLIENTIP to the correct client on the correct 
VLAN (vlan10)
arp lookup assigned correct MAC address and sends the packet to the 
switch on VLAN10

Problems I can see biting me:

ARP tables.  Can the kernel maintain seperate ARP tables for each VLAN? 
  Each VLAN can have a machine with IP 192.168.1.100

ICMPs:  What happens when a client tries to ping the linux box 
(192.168.1.1).  If I fwmark all incoming packets on a VLAN will the 
kernel respond with a packet using the same fwmark?

ARP requests:  Same as the ICMPs.  Will the kernel be able to answer an 
ARP request to 192.168.1.1

IPs :  I'm sure the kernel will bitch about assigning 192.168.1.1 on a 
bunch on Interfaces.


Any ideas?

--
Matthew Crocker
Vice President
Crocker Communications

w.  413-746-2760
f. 413-746-3704
e. matthew@crocker.com

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

             reply	other threads:[~2003-03-01 15:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-01 15:27 Matthew Crocker [this message]
2003-03-01 19:02 ` [LARTC] Virtual Routers would this work? Martin A. Brown
2003-03-03 14:35 ` Matthew Crocker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-lartc-104653245629920@msgid-missing \
    --to=matthew@crocker.com \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.