Annotation of wikisrc/users/imil/cheatsheet.mdwn, revision 1.8

1.6       imil        1: # My NetBSD cheat sheet
                      2: 
                      3: Various tasks I use to do on my NetBSD systems.
                      4: 
                      5: ## Specify an IP address for your NIC
                      6: 
                      7: [[!template  id=programlisting text="""
                      8: $ cat /etc/ifconfig.fxp0
                      9: up
                     10: inet 192.168.0.1 netmask 0xffffff00
1.7       imil       11: """]]
1.6       imil       12: 
                     13: ## Add an IP alias on a NIC
                     14: 
                     15: [[!template  id=programlisting text="""
                     16: $ cat /etc/ifconfig.fxp0
                     17: up
                     18: inet 192.168.0.1 netmask 0xffffff00
                     19: inet 172.16.0.1 netmask 0xffffffff alias
                     20: """]]
                     21: 
                     22: ## NIC will retrieve its IP address via DHCP
                     23: 
                     24: [[!template  id=programlisting text="""
                     25: $ cat /etc/ifconfig.re0
                     26: !dhcpcd $int
                     27: """]]
                     28: 
                     29: ## Add a static route when bringing up NIC
                     30: 
                     31: [[!template  id=programlisting text="""
                     32: $ cat /etc/ifconfig.re0
                     33: up
                     34: !dhcpcd $int
                     35: !route -n add -net 10.0.0.0/8 192.168.0.254
                     36: """]]
                     37: 
                     38: ## Specify a media type for a NIC
                     39: 
                     40: [[!template  id=programlisting text="""
                     41: $ cat /etc/ifconfig.re0
                     42: media 100baseTX up
                     43: !dhcpcd $int
                     44: """]]
                     45: 
                     46: ## Add an IPv6 address to a NIC
                     47: 
                     48: [[!template  id=programlisting text="""
                     49: $ cat /etc/ifconfig.re0
                     50: media 100baseTX up
                     51: !dhcpcd $int
                     52: inet6 2001:dead:beef:1::1 prefixlen 64
                     53: """]]
1.1       imil       54: 
1.8     ! imil       55: ## Very basic pf rules for NAT and firewalling
        !            56: 
        !            57: [[!template  id=programlisting text="""
        !            58: $ cat /etc/pf.conf
        !            59: ext_if="sip0"
        !            60: int_if="re0"
        !            61: 
        !            62: nat on $ext_if from !($ext_if) -> ($ext_if:0)
        !            63: 
        !            64: # allow outgoing traffic (S/A is implied)
        !            65: pass out on $ext_if
        !            66: # block all incoming traffic
        !            67: block in log on $ext_if
        !            68: """]]
        !            69: 
1.1       imil       70: ## Upgrade the system with binaries
                     71: 
1.3       imil       72: [[!template  id=programlisting text="""
1.6       imil       73: # cp /netbsd /netbsd.old
                     74: # tar zxvfp kern-MONOLITHIC.tgz -C /
                     75: # sync; sync
                     76: # shutdown -r now
                     77: # for i in base comp games man misc modules tests text xbase xcomp xetc xfont xserver; do tar zxvfp $i.tgz -C /;done
                     78: # mkdir /tmp/temproot
                     79: # tar zxvfp etc.tgz -C /tmp/temproot
                     80: # postinstall -s /tmp/tmproot check
                     81: # # copy postinstall's requirements
                     82: # etcupdate -s /tmp/tmproot
                     83: # shutdown -r now
1.3       imil       84: """]]
1.1       imil       85: 
                     86: ## Upgrade the system with sources
                     87: 
                     88: * Build the userland
                     89: 
1.3       imil       90: [[!template  id=programlisting text="""
1.6       imil       91: # cd /usr/src
                     92: # ./build.sh -O ../obj -T ../tools -j#jobs -U distribution
1.4       imil       93: """]]
1.1       imil       94: 
                     95: * Build the kernel
                     96: 
1.3       imil       97: [[!template  id=programlisting text="""
1.6       imil       98: # cd /usr/src
                     99: # ./build.sh -O ../obj -T ../tools -j#jobs kernel=YOUR_KERNEL
1.4       imil      100: """]]
1.1       imil      101: 
                    102: * Install the new kernel
                    103: 
1.3       imil      104: [[!template  id=programlisting text="""
1.6       imil      105: # cd /usr/src
                    106: # cp /netbsd /netbsd.old
                    107: # cp /usr/obj/sys/arch/YOUR_ARCH/compile/YOUR_KERNEL/netbsd /
                    108: # shutdown -r now
                    109: # cd /usr/src
                    110: # ./build.sh -O ../obj -T ../tools -U install=/
                    111: # /usr/sbin/etcupdate -s /usr/src
1.4       imil      112: """]]
1.1       imil      113: 
                    114: ## Adobe Flash
                    115: 
1.3       imil      116: [[!template  id=programlisting text="""
1.6       imil      117: # echo "procfs /emul/linux/proc procfs ro,linux" >> /etc/fstab
                    118: # mount /emul/linux/proc
                    119: # cd /usr/pkgsrc/www/nspluginwrapper
                    120: # make install
                    121: # cd /usr/pkgsrc/multimedia/ns-flash
                    122: # make install
                    123: $ nspluginwrapper -i /usr/pkg/lib/netscape/plugins/libflashplayer.so
1.4       imil      124: """]]
1.3       imil      125: 

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb