NetBSD-Bugs archive

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

Re: kern/53199: stateful npf



The following reply was made to PR kern/53199; it has been noted by GNATS.

From: Patrick Welche <prlw1%cam.ac.uk@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/53199: stateful npf
Date: Fri, 4 May 2018 15:05:04 +0100

 --liOOAslEiF7prFVr
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 The attached rump based script works. Trying the same on a NetBSD-8.99.15/amd64
 webserver with two wm(4), and morden.no as the client, doesn't.
 
 Running out of ideas...
 
 --liOOAslEiF7prFVr
 Content-Type: application/x-sh
 Content-Disposition: attachment; filename="web.sh"
 Content-Transfer-Encoding: quoted-printable
 
 # =0A# webserver 192.168.0.1 ----- client 192.168.0.2=0A# =0A=0Asock_webser=
 ver=3Dunix:///tmp/sockwebserver=0Asock_client=3Dunix:///tmp/sockclient=0A=
 =0Awire1=3D/tmp/netbus1=0A=0A#inetserver=3D"rump_server -lrumpnet -lrumpnet=
 _net -lrumpnet_netinet -lrumpnet_shmif"=0Ainetserver=3Drump_allserver=0A=0A=
 ${inetserver} ${sock_webserver}=0Aexport RUMP_SERVER=3D${sock_webserver}=0A=
 rump.ifconfig shmif0 create=0Arump.ifconfig shmif0 linkstr $wire1=0Arump.if=
 config shmif0 inet 192.168.0.1 netmask 0xffffff00=0A=0Acat > /tmp/npf.conf =
 << EOF=0Aset bpf.jit off=0A=0Agroup "ext" on shmif0 {=0A  block in all=0A  =
 pass stateful in proto tcp flags S/SA from any to 192.168.0.1 port 80=0A}=
 =0A=0Agroup default {=0A  pass all =0A}=0AEOF=0A=0Aexport 'RUMPHIJACK=3Dpat=
 h=3D/rump,blanket=3D/dev/npf,socket=3Dall:nolocal,sysctl=3Dyes'=0Aenv LD_PR=
 ELOAD=3D/usr/lib/librumphijack.so \=0A  /sbin/npfctl validate /tmp/npf.conf=
 =0Aenv LD_PRELOAD=3D/usr/lib/librumphijack.so \=0A  /sbin/npfctl reload /tm=
 p/npf.conf=0Aenv LD_PRELOAD=3D/usr/lib/librumphijack.so \=0A  /sbin/npfctl =
 start=0A=0Acat > /tmp/webserver.html << EOF=0A<html>=0A<head>=0A<title>webs=
 erver</title>=0A</head>=0A<body>=0AHello from webserver!=0A</body>=0A</html=
 >=0AEOF=0A=0Aenv LD_PRELOAD=3D/usr/lib/librumphijack.so \=0A  /usr/libexec/=
 httpd -d -P httpd.pid -i 192.168.0.1 -f -b -s /tmp &=0A=0A${inetserver} ${s=
 ock_client}=0Aexport RUMP_SERVER=3D$sock_client=0Arump.ifconfig shmif0 crea=
 te=0Arump.ifconfig shmif0 linkstr $wire1=0Arump.ifconfig shmif0 inet 192.16=
 8.0.2 netmask 0xffffff00=0Aenv LD_PRELOAD=3D/usr/lib/librumphijack.so \=0A =
  /usr/bin/ftp -4 -n -d -o out 'http://192.168.0.1/webserver.html'=0A=0Akill=
  `cat httpd.pid`=0A=0Afor box in ${sock_webserver} ${sock_client}; do=0A	ex=
 port RUMP_SERVER=3D${box}=0A	rump.halt=0Adone=0A
 --liOOAslEiF7prFVr--
 



Home | Main Index | Thread Index | Old Index