Sunteți pe pagina 1din 38

FreeBSD setup environment and IPv6 IOT test SOP

Tida 2012/3/25

Jan. 2012

Agenda
FreeBSD FreeBSD

Confidential Material for Internal Use Only

FreeBSD
FreeBSD is a free Unix-like operating system descended from AT&T UNIX via BSD UNIX. Although for legal reasons FreeBSD cannot be called "UNIX",[1] as the direct descendant of BSD UNIX (many of whose original developers became FreeBSD developers), FreeBSD's internals and system APIs are UNIX-compliant. Thanks to its permissive licensing terms, much of FreeBSDs code base has become an integral part of other operating systems such as Apple's OS X that have subsequently been certified as UNIX-compliant and have formally received UNIX branding.[2] With the exception of the proprietary OS X, FreeBSD is the most widely used BSD-derived operating system in terms of number of installed computers, and is the most widely used freely licensed, open-source BSD distribution, accounting for more than three-quarters of all installed systems running free, open-source BSD derivatives.[3] Characterised in 2005 as "the unknown giant among free operating systems"[2], FreeBSD is a complete operating system. The kernel, device drivers, and all of the userland utilities, such as the shell, are held in the same source code revision tracking tree. (This is in contrast to Linux distributions, for which the kernel, userland utilities, and applications are developed separately, and then packaged together in various ways by others). Third-party application software may be installed using various software installation systems, the two most common being source installation and package installation, both of which use the FreeBSD Ports system.

Confidential Material for Internal Use Only

FreeBSD
FreeBSDGNU GNU ISCCDDLBeerware BSD binary blobAtheros FreeBSD FreeBSD BSDGPL GPL

Confidential Material for Internal Use Only

Agenda
FreeBSD FreeBSD

Confidential Material for Internal Use Only

FreeBSD
Step1.

Step2. Install

Confidential Material for Internal Use Only

FreeBSD
Step3. - keymap selection NO

Step4.- Hostname

Confidential Material for Internal Use Only

FreeBSD
Step5. -distribution select ()

Step6.- partitioning

Confidential Material for Internal Use Only

FreeBSD
Step7. - partition editor HD OS

Step8.- partitioning editor

Confidential Material for Internal Use Only

FreeBSD
Step9. - partition editor HD AutoOS

Step10.- partitioning entire disk

Confidential Material for Internal Use Only

10

FreeBSD
Step11. - partition editor finish

Step12. - confirmation commit

Confidential Material for Internal Use Only

11

FreeBSD
Step13. - ()

Step14. - Network configuration , em0 inter PRO/1000 network connection 7.2.3

Confidential Material for Internal Use Only

12

FreeBSD
Step15. - Local or UTC clock yes

Step16. -

Confidential Material for Internal Use Only

13

FreeBSD
Step17. -

Step18. -

Confidential Material for Internal Use Only

14

FreeBSD
Step19. - system configuration sshd , ntpd , powerd

Step20. - dumpdev configuration NO

Confidential Material for Internal Use Only

15

FreeBSD
Step21. - add user accounts NO

Step22. - final configuration exit

Confidential Material for Internal Use Only

16

FreeBSD
Step23. - manual configuration NO

Step24. - complete reboot

Confidential Material for Internal Use Only

17

FreeBSD
Step25. - root command sysinstall LAN IP

Step26. - sysinstall main menu configure

Confidential Material for Internal Use Only

18

FreeBSD
Step27. - root command sysinstall LAN IP

Step28. - sysinstall main menu configure

Confidential Material for Internal Use Only

19

FreeBSD
Step29. - em0IP

Step30. - Do you want to try IPv6 NO

Confidential Material for Internal Use Only

20

FreeBSD
Step30. - Do you want to try DHCP yes

Confidential Material for Internal Use Only

21

FreeBSD
Step29. -

Confidential Material for Internal Use Only

22

FreeBSD
Step30. Xorg # pkg_add r xorg

Step31. Gnome2 () # pkg_add r gnome2


Step32. : # echo exec gnome-session >~/.xinitrc

Step33. # vi /etc/re.conf gdm_enable=YES hald_enable=YES dbus_enable=YES vi i / ESC vi :wq


Step34. reboot

Confidential Material for Internal Use Only

23

FreeBSD
Step35. ping Step36. Perl-5.12.4 # cd /usr/ports/lang/perl5.12 # make # make install Step37. Expect # cd /usr/ports/lang/p5-Expext # make # make install Step38. Digest-MD5 # cd /usr/ports/security/p5-Digest-MD5 # make # make install Step39. YAML # cd /usr/ports/textproc/p5-YAML # make # make install

Confidential Material for Internal Use Only

24

FreeBSD
Step40. # tar zxvf v6eval-3.3.2.tar.gz Step41 80386.nl/pub/v6eval.txt lib/Cm/CmMain.cc + , - cmd : + + + + + + + + if((in=fopen("/etc/utmp","r"))==NULL) {return;} u=myUtmpEnt(in,ux); fclose(in); if(!u) {return;} struct utmpx ul, *u; const char *tty; tty = ttyname(0); if (tty == NULL) tty = ttyname(1); if (tty == NULL) tty = ttyname(2);

+ -

Confidential Material for Internal Use Only

25

FreeBSD
Step42. # cd v6eval-3.3.2 Step43. # make Step44. # make install Step45. Self test tool # tar vxfz Self_Test_5-0-0.tgz

Step46. vi /etc/devfs.rules
add path bpf0 user root group wheel mode 0660 unhide add path bpf1 user root group wheel mode 0660 unhide add path bpf2 user root group wheel mode 0660 unhide add path bpf3 user root group wheel mode 0660 unhide add path bpf4 user root group wheel mode 0660 unhide add path bpf5 user root group wheel mode 0660 unhide add path bpf6 user root group wheel mode 0660 unhide add path bpf7 user root group wheel mode 0660 unhide Step47. vi /usr/local/v6eval/etc/tn.def # filter ipv6 # Link rl0 00:00:00:00:01:00
Confidential Material for Internal Use Only

26

FreeBSD
Step48. # vi /usr/local.v6eval/etc/nut.def # system manual # TargetName abc # HostName abc # Type host # User root # Password v6eval # Link0 eth0 00:00:92:a7:6d:f5

Step 49. # vi ./config.pl 30

Confidential Material for Internal Use Only

27

FreeBSD
Step50. # vi /urs/local/v6eval/etc/tn.def # Link0 emo 00:00:00:00:01:00 # Link1 rl1 00:00:00:00:01:01 ps. Link0LAN port , Link1WAN port Step51. # vi /urs/local/v6eval/etc/nut.def # Link0 bdg1 IAD LAN port MAC # Link1 eth1 IAD WAN port MAC Ps. a. MAC: MAC 28:10:7B:30:B7:BD 2810:7Bff:fe30:B7BD ff:fe~ b.MAC21282 101000 21 , 101010 = 2a2a10:7Bff:fe30:B7BD Step52. # vi /etc/rc.conf # ipv6_enable=NO # devfs_sys tem_ruleset=devfsrules_unhide_bpf

Confidential Material for Internal Use Only

28

FreeBSD
Step53. DUT WEB UI WAN port

Step54. WEB UI LAN port

Step55. reboot DUT


Confidential Material for Internal Use Only

29

Agenda
FreeBSD FreeBSD

Confidential Material for Internal Use Only

30

FreeBSD
Step1. WAN IP # ipconfig rl1 192.168.2.100 ping 192.168.2.100 and ping 192.168.0.1 telnet control DUT Step2. # cd Self_Test_5-0-0 # make clean # make ipv6ready_p2_router Step3. Spec # cd Self_Test_5-0-0/spec.p2 # make clean # make ipv6ready_p2_router

Step4. Spec17~24 # cd Self_Test_5-0-0/spec.p2 # make clean # make AROPT=-s 17 e 24 ipv6ready_p2_router

Confidential Material for Internal Use Only

31

FreeBSD
Step5. Set static route of NUT manually as followingDUTcmd

Step6. cmd # route A inet6 add 3ffe:501:ffff:110::/64 gw fe80:0200:00ff:fe00:0100 dev eth0

Step7.Set static route of NUT manually as followingDUTcmd

Step8. cmd # route A inet6 del 3ffe:501:ffff:110::/64 gw fe80:0200:00ff:fe00:0100 dev eth0

Confidential Material for Internal Use Only

32

FreeBSD
Step9. Set static route of NUT manually as followingDUTcmd

Step10. cmd # route A inet6 add default gw fe80:0200:00ff:fe00:0100 dev eth0

Step11.Set static route of NUT manually as followingDUTcmd

Step12. cmd # route A inet6 del default gw fe80:0200:00ff:fe00:0100 dev eth0

Confidential Material for Internal Use Only

33

FreeBSD
(WLDX) : killall firewalld killall radvd killall dhcp6s killall dnsmasq killall havp killall og3610_lte_watchdog killall og3610_lte_daemon echo 1 > /proc/sys/net/ipv6/conf/bdg1/disable_ipv6 echo 0 > /proc/sys/net/ipv6/conf/bdg1/disable_ipv6 ip -6 addr add 3ffe:501:ffff:101:bef6:85ff:fe78:22b8/64 dev eth1 ip -6 addr add 3ffe:501:ffff:100:bef6:85ff:fe76:400a/64 dev bdg1

echo 1 > /proc/sys/net/ipv6/conf/all/forwarding echo 1 > /proc/sys/net/ipv6/conf/eth1/forwarding echo 1 > /proc/sys/net/ipv6/conf/bdg1/forwarding echo 2 > /proc/sys/net/ipv6/conf/all/dad_transmits echo 2 > /proc/sys/net/ipv6/conf/eth1/dad_transmits echo 2 > /proc/sys/net/ipv6/conf/bdg1/dad_transmits echo 2 > /proc/sys/net/ipv6/conf/all/accept_dad echo 2 > /proc/sys/net/ipv6/conf/eth1/accept_dad echo 2 > /proc/sys/net/ipv6/conf/bdg1/accept_dad echo 1 > /proc/sys/net/ipv6/conf/all/optimistic_dad echo 1 > /proc/sys/net/ipv6/conf/eth1/optimistic_dad echo 1 > /proc/sys/net/ipv6/conf/bdg1/optimistic_dad echo 1 > /proc/sys/net/ipv6/conf/all/accept_redirects echo 1 > /proc/sys/net/ipv6/conf/eth1/accept_redirects echo 1 > /proc/sys/net/ipv6/conf/bdg1/accept_redirects echo 0 > /proc/sys/net/ipv6/conf/eth1/accept_ra
ip6tables -I INPUT -j ACCEPT ip6tables -I FORWARD -j ACCEPT iptables -I INPUT -j ACCEPT iptables -I FORWARD -j ACCEPT ip6tables -I OUTPUT -p UDP --dport 9303:9303 -j DROP
Confidential Material for Internal Use Only

34

FreeBSD
/var/radvd.conf : interface bdg1 { AdvSendAdvert on; MaxRtrAdvInterval 600; MinRtrAdvInterval 200; AdvDefaultPreference medium; #AdvDefaultLifetime 1800; AdvManagedFlag off; AdvOtherConfigFlag off; AdvLinkMTU 1500; AdvSourceLLAddress on; MinDelayBetweenRAs 3; AdvReachableTime 0; AdvRetransTimer 0; AdvCurHopLimit 64; prefix 3ffe:501:ffff:100::/64 { AdvOnLink on; AdvAutonomous on; AdvRouterAddr off; AdvValidLifetime 2592000; AdvPreferredLifetime 604800; }; }; radvd -C /var/radvd.conf &

Confidential Material for Internal Use Only

35

FreeBSD
3. route -A inet6 add default gw fe80::200:ff:fe00:0100 dev bdg1 route -A inet6 add default gw fe80::200:ff:fe00:a0a0 dev bdg1 section 1 item 73: static route gw change to fe80::200:ff:fe00:a0a0 section 2 item 13-20(17): ip6tables -I INPUT -p icmpv6 --icmpv6-type 135 -j DROP ip6tables -D INPUT -p icmpv6 --icmpv6-type 135 -j DROP section 2 item 40-46(42): ip6tables -I INPUT -p icmpv6 --icmpv6-type 136 -j DROP ip6tables -D INPUT -p icmpv6 --icmpv6-type 136 -j DROP section 2 item 115-120: do not running radvd section 2 item 128-129: M & O flag set to "off", AdvReachableTime & AdvRetransTimer set to "0" section 2 item 130: use default radvd.conf section 2 item 142-143: item 142 hoplimit "0" item 143 hoplimit "15" first run radvd and then add route section 2 item 146: ip -6 addr add 3ffe:501:ffff:0:bef6:85ff:fe76:400a/64 dev bdg1 ip -6 addr add 3ffe:501:ffff::/64 dev bdg1 section 2 item 150: route -A inet6 add 3ffe:501:ffff::/64 gw fe80::200:ff:fe00:a0a0 dev bdg1

Confidential Material for Internal Use Only

36

FreeBSD
section 3: echo 1 > /proc/sys/net/ipv6/conf/bdg1/disable_ipv6 echo 0 > /proc/sys/net/ipv6/conf/bdg1/disable_ipv6 ip -6 addr add 3ffe:501:ffff:101:bef6:85ff:fe78:22b8/64 dev eth1 ip -6 addr add 3ffe:501:ffff:100:bef6:85ff:fe76:400a/64 dev bdg1 echo 1 > /proc/sys/net/ipv6/conf/all/forwarding echo 1 > /proc/sys/net/ipv6/conf/eth1/forwarding echo 1 > /proc/sys/net/ipv6/conf/bdg1/forwarding echo 2 > /proc/sys/net/ipv6/conf/all/dad_transmits echo 2 > /proc/sys/net/ipv6/conf/eth1/dad_transmits echo 2 > /proc/sys/net/ipv6/conf/bdg1/dad_transmits echo 2 > /proc/sys/net/ipv6/conf/all/accept_dad echo 2 > /proc/sys/net/ipv6/conf/eth1/accept_dad echo 2 > /proc/sys/net/ipv6/conf/bdg1/accept_dad echo 1 > /proc/sys/net/ipv6/conf/all/optimistic_dad echo 1 > /proc/sys/net/ipv6/conf/eth1/optimistic_dad echo 1 > /proc/sys/net/ipv6/conf/bdg1/optimistic_dad echo 1 > /proc/sys/net/ipv6/conf/all/accept_redirects echo 1 > /proc/sys/net/ipv6/conf/eth1/accept_redirects echo 1 > /proc/sys/net/ipv6/conf/bdg1/accept_redirects echo 0 > /proc/sys/net/ipv6/conf/eth1/accept_ra section 3 item 11: ip6tables -I INPUT -s :: -p icmpv6 --icmpv6-type 135 -j DROP ip6tables -D INPUT -s :: -p icmpv6 --icmpv6-type 135 -j DROP section 3 item 19: ip6tables -I INPUT -d ff02::1 -p icmpv6 --icmpv6-type 136 -j DROP ip6tables -D INPUT -d ff02::1 -p icmpv6 --icmpv6-type 136 -j DROP section 3 item 28: ip -6 addr add 8000::bef6:85ff:fe76:400a/64 dev bdg1 section 3 item 29: ip -6 addr add fec0::bef6:85ff:fe76:400a/64 dev bdg1 section 4: route -A inet6 add default gw fe80::0200:00ff:fe00:0100 dev bdg1 section 5: route -A inet6 add default gw fe80::0200:00ff:fe00:0100 dev bdg1 section 5 item 9: ip -6 addr add fec0::bef6:85ff:fe76:400a/64 dev bdg1

Confidential Material for Internal Use Only

37

S-ar putea să vă placă și