Difference between revisions of "Netbsd vpn gateway basic setup"

From ENTS
Jump to: navigation, search
m
m (prep to recompile the kernel)
(15 intermediate revisions by one user not shown)
Line 1: Line 1:
vanilla install
+
 
 +
===basic setup after vanilla install===
  
 
---
 
---
Line 6: Line 7:
  
 
change the path for the pkgsrc repo to:<br />  
 
change the path for the pkgsrc repo to:<br />  
ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/5.0/All/
+
ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/5.0/All/
 +
 
 +
pkg_add lynx<br />
 +
pkg_add pico<br />
 +
pkg_add screen
  
 
---
 
---
Line 12: Line 17:
 
vi /etc/ifconfig.fxp0
 
vi /etc/ifconfig.fxp0
  
192.168.0.20x netmask 255.255.255.0  
+
192.168.0.20{1,2} netmask 255.255.255.0  
  
 
---
 
---
Line 18: Line 23:
 
vi /etc/sysctl.conf  
 
vi /etc/sysctl.conf  
  
net.inet.ip.forwarding=1
+
net.inet.ip.forwarding=1
  
 
---
 
---
Line 24: Line 29:
 
vi /etc/resolv.conf
 
vi /etc/resolv.conf
  
nameserver 64.59.184.13
+
nameserver 64.59.184.13
  
 
---
 
---
Line 30: Line 35:
 
vi /etc/rc.conf
 
vi /etc/rc.conf
  
hostname=chaosvpn{1,2}.440bx.net<br />
+
hostname=chaosvpn{1,2}.440bx.net<br />
defaultroute=192.168.0.1<br />
+
defaultroute=192.168.0.1<br />
sshd=yes
+
sshd=yes
  
 
---
 
---
  
useradd -m -G wheel chaosvpn_user<br />
+
useradd -m -G wheel chaosvpn_user<br />
passwd joe
+
passwd chaosvpn_user
 +
 
 +
---
 +
 
 +
continue with the steps at:
 +
 
 +
https://wiki.hamburg.ccc.de/ChaosVPN:NetBSDHowto
 +
 
 +
 
 +
---
 +
 
 +
===prep to recompile the kernel===
 +
 
 +
make directories
 +
 
 +
mkdir /usr/src
 +
chown chaosvpn_user /usr/src
 +
 
 +
get the actual source
 +
 +
ftp -i ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-5.2/source/sets/
 +
mget *.tgz
 +
 +
extract
 +
 
 +
for i in *.tgz
 +
do
 +
tar -xzf $i
 +
done
 +
 
 +
after you realize youve extracted to the wrong dir
 +
 
 +
mv /usr/src/usr/src/* /usr/src
 +
 
 +
copy config stuff
 +
 
 +
cd /usr/src/sys/arch/i386
 +
cp GENERIC i686_CVPN_x300
 +
 
 +
start editing
 +
 
 +
pico i686_CVPN_x300
 +
 
 +
reference
 +
 
 +
http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html
 +
 
 +
CFLAGS:
 +
 
 +
CPUFLAGS="-march=pentium3m -mtune=pentium3m"
 +
 +
Uncommented:
 +
 
 +
PERFCTRS #since this is going to be non-smp kernel (may or may not ever use this)
 +
GATEWAY
 +
IPSEC
 +
IPSEC_ESP
 +
IPSEC_NAT_T
 +
 
 +
Might dig more into "tuning" later.
 +
 
 +
Time to start building the new kernel
 +
 
 +
config ./i686_CVPN_x300
 +
cd ../compile/i686_CVPN_x300
 +
make depend && make

Revision as of 14:26, 31 July 2013

basic setup after vanilla install

---

vi /root/.profile

change the path for the pkgsrc repo to:

ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/5.0/All/
pkg_add lynx
pkg_add pico
pkg_add screen

---

vi /etc/ifconfig.fxp0

192.168.0.20{1,2} netmask 255.255.255.0 

---

vi /etc/sysctl.conf

net.inet.ip.forwarding=1

---

vi /etc/resolv.conf

nameserver 64.59.184.13

---

vi /etc/rc.conf

hostname=chaosvpn{1,2}.440bx.net
defaultroute=192.168.0.1
sshd=yes

---

useradd -m -G wheel chaosvpn_user
passwd chaosvpn_user

---

continue with the steps at:

https://wiki.hamburg.ccc.de/ChaosVPN:NetBSDHowto


---

prep to recompile the kernel

make directories

mkdir /usr/src
chown chaosvpn_user /usr/src

get the actual source

ftp -i ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-5.2/source/sets/
mget *.tgz

extract

for i in *.tgz
do
tar -xzf $i 
done

after you realize youve extracted to the wrong dir

mv /usr/src/usr/src/* /usr/src

copy config stuff

cd /usr/src/sys/arch/i386
cp GENERIC i686_CVPN_x300

start editing

pico i686_CVPN_x300

reference

http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html

CFLAGS:

CPUFLAGS="-march=pentium3m -mtune=pentium3m"

Uncommented:

PERFCTRS #since this is going to be non-smp kernel (may or may not ever use this)
GATEWAY
IPSEC
IPSEC_ESP
IPSEC_NAT_T

Might dig more into "tuning" later.

Time to start building the new kernel

config ./i686_CVPN_x300
cd ../compile/i686_CVPN_x300
make depend && make
Personal tools
Namespaces

Variants
Actions
Navigation
Members
Toolbox