Flashrd

From Noisebridge
(Difference between revisions)
Jump to: navigation, search
(Tunnel configuration)
Line 1: Line 1:
 +
----
 +
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 +
----
 +
=[http://egebyromedu.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=
 +
----
 +
=[http://egebyromedu.co.cc CLICK HERE]=
 +
----
 +
</div>
 
== flashrd ==
 
== flashrd ==
  
Line 13: Line 21:
 
Mount the flash cards, boot into single user mode, or boot the flash card using qemu, then modify /etc/ttys as follows:
 
Mount the flash cards, boot into single user mode, or boot the flash card using qemu, then modify /etc/ttys as follows:
  
<pre>
+
&lt;pre&gt;
 
19c19
 
19c19
< tty00 "/usr/libexec/getty std.9600" unknown off
+
&lt; tty00 &quot;/usr/libexec/getty std.9600&quot; unknown off
 
---
 
---
> tty00 "/usr/libexec/getty std.9600" vt220 on secure
+
&gt; tty00 &quot;/usr/libexec/getty std.9600&quot; vt220 on secure
</pre>
+
&lt;/pre&gt;
  
 
Add this to /flash/etc/boot.conf: (/flash is on /dev/wd0a)
 
Add this to /flash/etc/boot.conf: (/flash is on /dev/wd0a)
  
<pre>
+
&lt;pre&gt;
 
set timeout 5
 
set timeout 5
 
stty com0 9600
 
stty com0 9600
 
set tty com0
 
set tty com0
</pre>
+
&lt;/pre&gt;
  
 
Plug the flash cards into the existing devices, boot as follows:
 
Plug the flash cards into the existing devices, boot as follows:
  
<pre>
+
&lt;pre&gt;
boot> set tty com0
+
boot&gt; set tty com0
 
switching console to com0
 
switching console to com0
                         >> OpenBSD/i386 BOOT 3.02
+
                         &gt;&gt; OpenBSD/i386 BOOT 3.02
boot> boot
+
boot&gt; boot
 
booting hd0a:/bsd: 10707316+1055248 [52+360656+344597]=0xbe4014
 
booting hd0a:/bsd: 10707316+1055248 [52+360656+344597]=0xbe4014
entry point at 0x200120</pre>
+
entry point at 0x200120&lt;/pre&gt;
  
 
== Usage notes ==
 
== Usage notes ==
  
To boot the older flash images, "boot -s" and then "/stand/rc" or "sh /etc/rc".  If you need to use the network, remember to do "pfctl -d".  
+
To boot the older flash images, &quot;boot -s&quot; and then &quot;/stand/rc&quot; or &quot;sh /etc/rc&quot;.  If you need to use the network, remember to do &quot;pfctl -d&quot;.  
  
 
Once you have a serial console on the new image, copy /etc/hostname.*, /etc/ssh/*key*, and /root/.ssh/authorized_keys to the new image from the old image.  Upon reboot you should be able to log in.
 
Once you have a serial console on the new image, copy /etc/hostname.*, /etc/ssh/*key*, and /root/.ssh/authorized_keys to the new image from the old image.  Upon reboot you should be able to log in.
  
 
Files to copy from /etc:
 
Files to copy from /etc:
<pre>
+
&lt;pre&gt;
 
hosts x
 
hosts x
 
dhcpd.conf x
 
dhcpd.conf x
Line 63: Line 71:
 
mygate x
 
mygate x
 
dnsmasq.conf x
 
dnsmasq.conf x
</pre>
+
&lt;/pre&gt;
  
 
Packages to install:
 
Packages to install:
<pre>
+
&lt;pre&gt;
 
export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/4.7/packages/i386/
 
export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/4.7/packages/i386/
 
pkg_add -v dnsmasq lsof curl bash iperf isc-dhcp-server net-snmp ngrep bwm-ng
 
pkg_add -v dnsmasq lsof curl bash iperf isc-dhcp-server net-snmp ngrep bwm-ng
</pre>
+
&lt;/pre&gt;
 
   
 
   
 
== Tunnel configuration ==
 
== Tunnel configuration ==
Line 78: Line 86:
  
 
/etc/hostname.sisX:
 
/etc/hostname.sisX:
<pre>
+
&lt;pre&gt;
 
inet6 2001:05a8:0004:5630::0001/64
 
inet6 2001:05a8:0004:5630::0001/64
</pre>
+
&lt;/pre&gt;
  
 
/etc/rc.conf.local:
 
/etc/rc.conf.local:
<pre>
+
&lt;pre&gt;
rtadvd_flags="sisX"
+
rtadvd_flags=&quot;sisX&quot;
</pre>
+
&lt;/pre&gt;
  
 
/etc/rtadvd.conf:
 
/etc/rtadvd.conf:
<pre>
+
&lt;pre&gt;
sis1:addr="2001:5a8:4:5630::":prefixlen#64
+
sis1:addr=&quot;2001:5a8:4:5630::&quot;:prefixlen#64
</pre>
+
&lt;/pre&gt;
  
 
/etc/hostname.gif0:
 
/etc/hostname.gif0:
<pre>
+
&lt;pre&gt;
 
tunnel 75.101.62.88 208.201.234.221
 
tunnel 75.101.62.88 208.201.234.221
 
inet6 alias 2001:5a8:0:1::ac7 prefixlen 127
 
inet6 alias 2001:5a8:0:1::ac7 prefixlen 127
</pre>
+
&lt;/pre&gt;
  
 
/etc/pf.conf:
 
/etc/pf.conf:
You also have to make sure that any nat rules for your regular IPv4 traffic explicitly say "inet" only instead of all protocols, otherwise pf will try to nat the ipv6 packets too.
+
You also have to make sure that any nat rules for your regular IPv4 traffic explicitly say &quot;inet&quot; only instead of all protocols, otherwise pf will try to nat the ipv6 packets too.
<pre>
+
&lt;pre&gt;
 
pass in quick on gif0 inet6 keep state
 
pass in quick on gif0 inet6 keep state
 
pass in quick on $ext_if proto ipv6
 
pass in quick on $ext_if proto ipv6
 
pass out quick on $ext_if proto ipv6
 
pass out quick on $ext_if proto ipv6
</pre>
+
&lt;/pre&gt;

Revision as of 18:05, 23 November 2010


flashrd

flashrd is an OpenBSD installer tailored for flash-backed devices that have at least 1Gb of flash and 128Mb of RAM. Here's the project's homepage.

Installing flashrd

Download the flashrd binary images.

Backup the existing flash cards using dd.

dd the new flashrd images to the existing flash cards.

Mount the flash cards, boot into single user mode, or boot the flash card using qemu, then modify /etc/ttys as follows:

<pre> 19c19 < tty00 "/usr/libexec/getty std.9600" unknown off --- > tty00 "/usr/libexec/getty std.9600" vt220 on secure </pre>

Add this to /flash/etc/boot.conf: (/flash is on /dev/wd0a)

<pre> set timeout 5 stty com0 9600 set tty com0 </pre>

Plug the flash cards into the existing devices, boot as follows:

<pre> boot> set tty com0 switching console to com0

                        >> OpenBSD/i386 BOOT 3.02

boot> boot booting hd0a:/bsd: 10707316+1055248 [52+360656+344597]=0xbe4014 entry point at 0x200120</pre>

Usage notes

To boot the older flash images, "boot -s" and then "/stand/rc" or "sh /etc/rc". If you need to use the network, remember to do "pfctl -d".

Once you have a serial console on the new image, copy /etc/hostname.*, /etc/ssh/*key*, and /root/.ssh/authorized_keys to the new image from the old image. Upon reboot you should be able to log in.

Files to copy from /etc: <pre> hosts x dhcpd.conf x resolv.conf x myname x rc.conf.local x pf.conf x localtime x snmpd.conf x rtadvd.conf x hostname.* master.passwd x ntpd.conf x passwd x ttys x sysctl.conf x mygate x dnsmasq.conf x </pre>

Packages to install: <pre> export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/4.7/packages/i386/ pkg_add -v dnsmasq lsof curl bash iperf isc-dhcp-server net-snmp ngrep bwm-ng </pre>

Tunnel configuration

Sonic has a example ipv6 tunnel configuration generator for OpenBSD, but it only gives the pre-4.7 syntax. Here's how r00ter is configured, and these settings should work for any 4.7 or up installation, including recent flashrd builds.

Note that regardless of what the ISP tells you to use as your subnet, you have to use a prefix length of /64 for automatic address configuration to work. If you have a DHCPv6 server you can do whatever you want, though.

/etc/hostname.sisX: <pre> inet6 2001:05a8:0004:5630::0001/64 </pre>

/etc/rc.conf.local: <pre> rtadvd_flags="sisX" </pre>

/etc/rtadvd.conf: <pre> sis1:addr="2001:5a8:4:5630::":prefixlen#64 </pre>

/etc/hostname.gif0: <pre> tunnel 75.101.62.88 208.201.234.221 inet6 alias 2001:5a8:0:1::ac7 prefixlen 127 </pre>

/etc/pf.conf: You also have to make sure that any nat rules for your regular IPv4 traffic explicitly say "inet" only instead of all protocols, otherwise pf will try to nat the ipv6 packets too. <pre> pass in quick on gif0 inet6 keep state pass in quick on $ext_if proto ipv6 pass out quick on $ext_if proto ipv6 </pre>

Personal tools