From: Jacob Gorm Hansen Subject: Network filtering setup Date: Fri, 22 Dec 2006 15:25:59 +0100 Message-ID: <1166797559.4895.9.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org hi, back in Xen 1.x days I had this wonderful setup where I did not have to bother with vifs and bridges or fake MAC addresses, and the following piece of C in dom0: void setup_vfr_rules_for_vif(int dom,int vif,char* guest_ip) { int f = open("/proc/xen/vfr",O_WRONLY); char s[256]; sprintf(s,"ADD ACCEPT dstaddr=%s dstaddrmask=255.255.255.255 src=ANY dstdom=%d dstidx=%d proto=any\n", guest_ip,dom,0 ); write(f,s,strlen(s)); sprintf(s,"ADD ACCEPT srcaddr=%s srcaddrmask=255.255.255.255 srcdom= %d srcidx=%d dst=PHYS proto=any\n",guest_ip,dom,0 ); write(f,s,strlen(s)); close(f); } Would allow a domU to send and receive IP traffic through eth0, including somehow magically getting ARP request answered our routed to the right place. I have been trying various things to get the same effect in Xen 3.x, but to be honest my iptables knowledge is a bit rusty, so all I have been able to come up with is a routed setup, but that only seems to work when all the peers have the host hardcoded into their routing tables. Does anyone have the perfect setup (list of iptables commands I suppose) for this, preferable without bridging at the Ethernet layer? NAT/Masquerading is not an option, as I prefer not to have any state kept in dom0. Thanks, Jacob