




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、Mobile-box安裝配置手冊(cè)目錄目錄一、OS安裝配置31.基礎(chǔ)環(huán)境3二、CentOS內(nèi)核編譯配置31.系統(tǒng)環(huán)境準(zhǔn)備32.配置內(nèi)核文件33.編譯安裝內(nèi)核64.修改Grub引導(dǎo)順序65.外部電源按鍵響應(yīng)7三、DHCP服務(wù)器81.配置并啟動(dòng)wlan網(wǎng)卡82.安裝DHCP83.DHCP配置84.開(kāi)機(jī)啟動(dòng)DHCP9四、3G網(wǎng)絡(luò)配置91.硬件信息92.系統(tǒng)環(huán)境93.初始化配置文件94.修改配置文件95.撥號(hào)上網(wǎng)106.開(kāi)機(jī)撥號(hào)腳本107.添加拔號(hào)程序自動(dòng)修改/etc/resolv.conf腳本118.華為USB3G無(wú)線網(wǎng)卡安裝11五、無(wú)線共享HostAP131.準(zhǔn)備132.下載133.編譯及安裝144
2、.配置145.Hostap開(kāi)機(jī)自啟腳本15六、NAT、防火墻與上網(wǎng)通道配置171.NAT設(shè)置172.防火墻設(shè)置173.上網(wǎng)通道設(shè)置17七、DNS服務(wù)配置181.安裝182.配置183.禁止IPV6 功能194.開(kāi)機(jī)啟動(dòng)19八、計(jì)劃任務(wù)19九、外網(wǎng)網(wǎng)卡與管理地址配置201.外網(wǎng)網(wǎng)卡配置202.管理地址配置203.路徑別名配置21一、 OS安裝配置1. 基礎(chǔ)環(huán)境OS:CentOS 6.4 64bit Kernel 3.12.1SSD:16GHHD:320GRAM:2G/boot500M/100Gswap內(nèi)存容量*2/srv/disk01剩余空間二、 CentOS內(nèi)核編譯配置1. 系統(tǒng)環(huán)境準(zhǔn)備下載地
3、址:版本:3.12.x安裝必須的組件# yum install gcc gcc-c+ libstdc+ tcl tcl-devel usb_modeswitch usb_modeswitch-data glibc glibc-devel zlib zlib-devel texinfo tk-devel curl curl-devel openssl-devel perl cpio expat-devel gettext-devel autoconf ncurses-devel hmaccalc screen zlib-devel binutils-devel elf
4、utils-libelf-devel kernel-devel kernel-headersqt-devel vim setuptool ntsysv iptables system-config-securitylevel-tui system-config-network-tui ntpdate bc setuptool ntsysv iptables system-config-securitylevel-tui system-config-network-tui usbutils bind-utils ntp vim* libusb* wget *zip* lrzsz man* rsy
5、nc* elinks*更新系統(tǒng)內(nèi)核到最新.-可選配置#yum -y update#yum -y patch2. 配置內(nèi)核文件# wget /pub/linux/kernel/v3.x/linux-3.12.1.tar.xz# tar xf linux-3.12.1.tar.xz# cd linux-3.12.7# cp /boot/config-2.6.32-358.el6.x86_64 .config# make menuconfig 注:此處可以直接使用下面的配置文件(拖動(dòng)到桌面,上傳到對(duì)應(yīng)目錄下即可)命令獲取:wget ftp:/root:mob
6、ile.qian-50/yunwei/.config在“Device Drivers“中添加刪除設(shè)備支持,無(wú)線設(shè)備一般在“Deivce Drivers”“Wirlesss device”下面。編譯進(jìn)去Atheros Communications Inc. AR9300 Wireless LAN adapter驅(qū)動(dòng)程序:ath9k 110305 0 mac80211 466799 1 ath9kath9k_common 3193 1 ath9kath9k_hw 439260 2 ath9k,ath9k_commonath 18328 3 ath9k,ath9k_commo
7、n,ath9k_hwcfg80211 465617 3 ath9k,mac80211,ath注:需要在內(nèi)核中打開(kāi)ipv4的NATNetworking options-Network packet filtering framework (Netfilter)-IP: Netfilter Configuration-IP tables support (required for filtering/masq/NAT)-IPv4 NAT需在Power management and ACPI options中添加ACPI的button模塊è用作為電源按鍵響應(yīng)模塊.即:遞歸路徑:Power
8、management and ACPI optionsàACPI (Advanced Configuration and Power Interface) Support(此處的button實(shí)際應(yīng)該為M,否則對(duì)應(yīng)的模塊不會(huì)被安裝)遞歸路徑:Device DriversàNetwork device supportàWireless LANàAtheros Wireless Cards遞歸路徑:Networking supportàNetworking optionsàNetwork packet filtering framework
9、 (Netfilter)àIP: Netfilter Configuration3. 編譯安裝內(nèi)核# make bzImage # make modules# make modules_install# make install4. 修改Grub引導(dǎo)順序# vi /etc/grub.confdefault=0-修改guid,命令:# python replaceGuid.py $(date "+%Y-%m%d-%H%M-%S00")附件:獲取鏈接:wget ftp:/root:mobile.qian-50/yunwei/replaceGui
10、d.py將會(huì)被修改Guid的文件:/usr/local/apache-tomcat-7.0.42/webapps/ROOT/WEB-INF/classes/perties/usr/local/cssh/config/conf.py重啟系統(tǒng)。5. 外部電源按鍵響應(yīng)1) 安裝acpid軟件包不要使用系統(tǒng)自帶的acpid(版本過(guò)低,在kernel-3.0以上無(wú)法運(yùn)行),更新內(nèi)核為3.12.1版本后,仍會(huì)提示:無(wú)視,忽略依賴關(guān)系強(qiáng)制安裝:需要的acpid RPM包:# wget ftp:/root:mobile.qian-50/yunwei/acpid-
11、2.0.19-2.0.1.el6.centos.alt.x86_64.rpm2) 修改acpid事件響應(yīng)配置root1037U # cat /etc/acpi/events/powerconf # ACPID config to power down machine if powerbutton is pressed, but only if# no gnome-power-manager is runningevent=button/power.*action=/etc/acpi/actions/power.sh根據(jù)需要,添加電源響應(yīng)事件。例如這里需要增加一個(gè)按電源鍵就關(guān)機(jī)的事件,那么需要修
12、改powerconf中的action如下:#action=/etc/acpi/actions/power.shaction=/sbin/halt修改完成,啟動(dòng)acpi服務(wù)/etc/init.d/acpid start如果無(wú)法啟動(dòng),建議重啟系統(tǒng)。查看acpid狀態(tài):/etc/init.d/acpid status三、 DHCP服務(wù)器1. 配置并啟動(dòng)wlan網(wǎng)卡# vim /etc/sysconfig/network-scripts/ifcfg-wlan0DEVICE=wlan0TYPE=EthernetONBOOT=yesBOOTPROTO=noneIPADDR=NETMA
13、SK=2. 安裝DHCP# yum install dhcp -y3. DHCP配置# vim /etc/dhcp/dhcpd.confdefault-lease-time 3600;max-lease-time 3600;ddns-update-style none;log-facility local7;subnet netmask range 54; option domain-name-servers ; option routers 192
14、.168.3.1; option broadcast-address 55; default-lease-time 3600; max-lease-time 3600;# vim /etc/sysctl.conf#直接添加在最后net.ipv4.tcp_keepalive_time = 600net.ipv4.tcp_keepalive_probes = 3net.ipv4.tcp_keepalive_intvl = 15執(zhí)行命令使配置生效# sysctl p4. 開(kāi)機(jī)啟動(dòng)DHCP# chkconfig add dhcpd# chkconfig level 345 dhc
15、pd on# service dhcpd start四、 3G網(wǎng)絡(luò)配置1. 硬件信息# lsusb 查看3G上網(wǎng)卡型號(hào)Bus 001 Device 002: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem2. 系統(tǒng)環(huán)境OS:CentOS 6.4 x64# yum -y install wvdial ppp 3. 初始化配置文件# wvdialconf /etc/wvdial.conf如果提示找不到3G USB網(wǎng)卡設(shè)備即ttyUSB0,則跳轉(zhuǎn)至“步驟8華為USB3G無(wú)線網(wǎng)卡安裝”,按操作完成后,再返回這里
16、。4. 修改配置文件# vi /etc/wvdial.confDialer Defaults;Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0; Init3 = AT+CGDCONT=2,"IP","3gnet"Modem Type = Analog ModemPhone = *99# ISDN = 0Username = anyInit1 = ATZPassword = any Modem = /dev/ttyUSB0 Baud = 9600New PPPD = yes Auto Reconnect =
17、 on 5. 撥號(hào)上網(wǎng)# wvdial 撥號(hào)信息省略,一般如果出現(xiàn)“l(fā)ocal IP address xx.xx.xxx.xxx”時(shí),則表示撥號(hào)成功。如果提示找不到3G USB網(wǎng)卡設(shè)備即ttyUSB0,則跳轉(zhuǎn)至“步驟8華為USB3G無(wú)線網(wǎng)卡安裝”,按操作完成后,再返回這里。6. 開(kāi)機(jī)撥號(hào)腳本# vi /etc/init.d/wvdial# chmod +x /etc/init.d/wvdial#!/bin/bash# wcdma 3g wvdial# chkconfig:345 20 80# description: Wvdial to 3G PPPoE.# # It is use to WC
18、DMA 3G# processname:Wvdial# Source function library.#/etc/rc.d/init.d/functionscase "$1" instart)echo "Starting Wvdial."/usr/bin/wvdial &stop)echo "Stoping Wvdial."killall -9 pppdkillall -9 wvdial;*)echo "Usage:$0start|stop"exit 1;esacexit 07. 添加拔號(hào)程序自動(dòng)修改/e
19、tc/resolv.conf腳本修改/etc/ppp/peers/wvdialnoauthname wvdialusepeerdns添加如下內(nèi)容到/etc/ppp/ip-up.local:#!/bin/bash# This sample code shows you one way to modify your setup to allow automatic# configuration of your resolv.conf for peer supplied DNS addresses when using# the usepeerdns' option.# In my case
20、 I just added this to my /etc/ppp/ip-up.local script. You may need to # create an executable script if one does not exist.# Nick Walker (nickwalker)#. /etc/sysconfig/network-scripts/network-functionsif -n "$USEPEERDNS" -a -f /var/run/ppp/resolv.conf ; thenrm -f /var/run/ppp/resolv.previf -
21、f /etc/resolv.conf ; then#cp /etc/resolv.conf /var/run/ppp/resolv.prevcp /var/run/ppp/resolv.conf /var/run/ppp/resolv.prevrscf=/var/run/ppp/resolv.newgrep domain /var/run/ppp/resolv.prev > $rscfgrep search /var/run/ppp/resolv.prev >> $rscfgrep nameserver /var/run/ppp/resolv.prev >> $r
22、scfchange_resolv_conf $rscfrm -f $rscfelsechange_resolv_conf /var/run/ppp/resolv.conffifi修改文件屬性chmod 777 /etc/ppp/ip-up.local。8. 華為USB3G無(wú)線網(wǎng)卡安裝http:/www.draisberghof.de/usb_modeswitch/下載· Download usb-modeswitch-2.1.1.tar.bz2, dated from 2014-03-27; a Debian package should be available soon
23、 at the Debian Repository. Many architectures are supported there (like amd64 or ia64).· Download the usb-modeswitch-data package (2014-03-27). It contains the device database and the rules file, including full paths. You need program releases from 2.1.0 upward because of newly i
24、ntroduced parameters.· Don't forget libusb-1.x if it's not on your system. In most distributions there is most likely a package named "libusb1-dev" or "libusb1-devel" (or similar).下載完成后,解壓并安裝:1) tar xvf usb-modeswitch-2.1.1.tar.bz2cd usb-modeswitch-2.1.1mak
25、e install快速鏈接:wget ftp:/root:mobile.qian-50/yunwei/usb_modem/usb-modeswitch-2.1.1.tar.bz22) tar xvf usb-modeswitch-data-20140327_.tar.bz2cd usb-modeswitch-data-20140327make install #這里的文件是編譯后的代碼,不需要再次install,因此跳過(guò)這一步cp -r usb_modeswitch.d /etc/快速鏈接wget ftp:/root:mobile.qian-50
26、/yunwei/usb_modem/usb-modeswitch-data-20140327 .tar.bz23) 修改 /etc/usb_modeswitch.d/12d1:14fe ,修改后內(nèi)容如下:#wei ET128 for ChinaMobile TD-SCDMADefaultVendor= 0x12d1DefaultProduct= 0x14feTargetVendor= 0x12d1TargetProduct= 1001heckSuccess=20MessageContent="5553424312345678000000000000001106200000010000
27、0000000000000000"把網(wǎng)卡插上,運(yùn)行l(wèi)susb,應(yīng)該會(huì)有這樣的輸出:Bus 002 Device 006: ID 12d1: 14fe Huawei Technologies Co., Ltd.插入E261(網(wǎng)卡型號(hào)),這時(shí)已經(jīng)自動(dòng)切換為modem,不需要像網(wǎng)上寫(xiě)的那樣執(zhí)行usb-modeswitch -W,這一步完全沒(méi)有必要,此時(shí)lsusb顯示Bus 001 Device 015: ID 12d1:1436 Huawei Technologies Co., Ltd.執(zhí)行命令,使修改生效:usb_modeswitch -c /etc/usb_modeswitch.d/1
28、2d1:14fe返回“步驟5 撥號(hào)上網(wǎng)”五、 無(wú)線共享HostAP1. 準(zhǔn)備# yum install libusb-devel libnl libnl-devel git2. 下載# git clone git:/w1.fi/srv/git/hostap.gitGit下載需要大量時(shí)間,可使用后面的附件。# tar xvf hostapd-2.1.tar.gz# cd hostapd-2.1/hostapd# cp defconfig .config編輯.config文件,修改如下的內(nèi)容:# Driver interface for Host AP driverCONFIG_DRIVER_HO
29、STAP=y# Driver interface for drivers using the nl80211 kernel interfaceCONFIG_DRIVER_NL80211=y# IEEE 802.11n (High Throughput) supportCONFIG_IEEE80211N=yCONFIG_NO_RADIUS=yCONFIG_NO_ACCOUNTING=y#dynamic channel selectCONFIG_ACS=y3. 編譯及安裝# make# cp hostapd /usr/local/sbin/# cp hostapd_cli /usr/local/s
30、bin/注:也可以直接將其他已編譯完成的文件直接拷貝到新系統(tǒng)中。4. 配置# vi /etc/hostapd.conf /創(chuàng)建hostapd的配置文件#basic configctrl_interface=/var/run/hostapdctrl_interface_group=0interface=wlan0driver=nl80211ssid=LeBa#LeBa僅代表wifi顯示名稱(按照規(guī)定,出廠時(shí),應(yīng)統(tǒng)一為此ssid)# 802.11g, 54Mb 2.4GHzhw_mode=g#for HT40- channel need in 5-13, HT40+ channel need in
31、 1-7#channel=0為自動(dòng)選擇,啟動(dòng)是會(huì)有“Failed to check if DFS is required”的警告信息,不必理會(huì),不影響正常使用channel=5 # 802.11n, 150Mb 2.4/5GHz#ieee80211n=1#ht_capab=HT40-SHORT-GI-20SHORT-GI-40TX-STBCTR-#STBC1LDPCDSSS_CCK-40#wmm_enabled=1# 802.11n 優(yōu)化配置#wmm_enabled=1#wmm_ac_be_aifs=3#wmm_ac_be_cwmin=4#wmm_ac_be_cwmax=10#wmm_ac_b
32、e_txop_limit=0#wmm_ac_be_acm=0# other configmax_num_sta=255beacon_int=100dtim_period=1ignore_broadcast_ssid=0#set passwrod#auth_algs=1#wpa=2#wpa_passphrase=Wifi密碼#wpa_key_mgmt=WPA-PSK#wpa_pairwise=TKIP#rsn_pairwise=CCMP# hostapd /etc/hostapd.conf 打印如下內(nèi)容,則說(shuō)明hostap正常啟動(dòng)了。Configuration file: /etc/hostap
33、d.confUsing interface wlan0 with hwaddr 7c:dd:90:42:ba:02 and ssid "JiaYouZhan"5. Hostap開(kāi)機(jī)自啟腳本# vi /etc/rc.d/init.d/hostapdd#!/bin/bash# Hostapd startup scrip# chkconfig:- 20 80# description: Hostapd is a softAP.# It is used to WIFI.# processname:hostapd# Source function library.#/etc/rc.d
34、/init.d/functionscase "$1" instart)echo "Starting Hostapd."#ifdown wlan0#ifup wlan0screen -d -m -S hostapdd /usr/local/sbin/hostapd /etc/hostapd.conf;stop)echo "Stoping Hostapd."#ifdown wlan0#ifup wlan0/usr/bin/killall -9 hostapd/usr/bin/killall -9 screen;restart)echo &
35、quot;Restarting Hostapd."/etc/init.d/dhcpd stopifdown wlan0ifup wlan0/usr/bin/killall -9 hostapd/usr/bin/killall -9 screenscreen -d -m -S hostapdd /usr/local/sbin/hostapd /etc/hostapd.confservice dhcpd start;status)if ps -ef | grep hostapd | grep -Ev grep >> /dev/null 2>&1; thenech
36、o "hostapd is running."elseecho "hostapd is not running, Please use $0 start to start!"fi;*)echo "Usage:$0start|stop|restart|status"exit 1;esacexit 0# chmod +x /etc/rc.d/init.d/hostapd六、 NAT、防火墻與上網(wǎng)通道配置1. NAT設(shè)置# vi /etc/sysctl.conf Net.ipv4.ip_forward = 1 /將0改成1# echo “1
37、” > /proc/sys/net/ipv4/ip_forward# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE2. 防火墻設(shè)置當(dāng)前的防火墻可執(zhí)行腳本文件位于/usr/local/apache-tomcat-7.0.42/webapps/ROOT/WEB-INF/classes目錄下:這三個(gè)文件的的作用:config_iptables.sh當(dāng)前正在使用的腳本;config_iptables_eth0.sh使用有線時(shí)需要的腳本;config_iptables_ppp0.sh使用3G網(wǎng)卡時(shí)需要的腳本;其中的config_iptab
38、les.sh會(huì)在開(kāi)機(jī)時(shí)自動(dòng)執(zhí)行,可根據(jù)需要(移動(dòng)型或固定型),從另外兩個(gè)eth0和ppp0腳本文件拷貝。3. 上網(wǎng)通道設(shè)置上網(wǎng)通道的配置文件是/usr/local/apache-tomcat-7.0.42/webapps/ROOT/WEB-INF/classes/perties#Thu May 22 17:13:13 CST 2014data.clean.cron=0 0/1 * * * ?sys.attachment.save.path=/cscmdfile=pertiesinternet.channel.freetrial=180networ
39、k.channel=3# 1 有線通道# 3 3G通道resource.base.path=/usr/local/apache-tomcat-7.0.42/webapps/ROOT/user.sync.cron=0 0/1 * * * ?heartbeat.cron=0 0/1 * * * ?mobileServer.host=http:/jyz.qian-log.sync.cron=0 0/1 * * * ?version=1.3.4internet.channel.open=trueinternet.channel.rate=6file.download.max.retry=3connec
40、t.max.retry=3七、 DNS服務(wù)配置1. 安裝# yum install bind* -y2. 配置當(dāng)前1.3.4版本中的DNS解析的配置文件較多,列表如下:/etc/named.conf/etc/named.rfc1912.zones/var/named/3.168.192.zone/var/named/.zone/var/named/as568.zone/var/named/as.zone/var/named/.zone/var/named/.zone/var/named/.zone/var/named/.zone/var/named/.zone/var/named/.zone/
41、var/named/www.airport.us.zone/var/named/.zone/var/named/.zone/var/named/.zone/var/named/.zone/var/named/.zone/var/named/www.thinkdifferent.us.zone手工修改較為麻煩, 這里提供打包后的named.tar.bz2文件, 使用時(shí),只需要在Linux的根目錄下, 使用root 執(zhí)行命令# cd /# tar xvf /tmp/named.tar.bz2命令會(huì)自動(dòng)將相關(guān)文件解壓縮到對(duì)應(yīng)的路徑附件:也可直
42、接用命令獲取:wget ftp:/root:mobile.qian-50/yunwei/named.tar.bz23. 禁止IPV6 功能# vi /etc/sysconfig/network#增加一行NETWORKING_IPV6=no # vim /etc/modprobe.d/dist.conf#末尾增加如下兩行alias ipv6 offalias net-pf-10 off修改/etc/sysconfig/named添加OPTIONS=”-4” 重啟named服務(wù)#/etc/init.d/named restartstop 相關(guān) 服務(wù)#service ip6tables stop#service dhcpd6 stop#chkconfig del ip6tables#chkconfig del dhcpd64. 開(kāi)機(jī)啟動(dòng)# chkconfig -level 345 named on# service named start八、 計(jì)劃任務(wù)# c
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 出租責(zé)任合同范本
- 買賣合同和定制合同范本
- 傭金類合同范本
- 電氣控制PLC習(xí)題(含答案)
- 廠房檢查合同范本
- 上海旅游心得體會(huì)
- 三年級(jí)第一學(xué)期語(yǔ)文教學(xué)計(jì)劃
- 三八婦女節(jié)工會(huì)活動(dòng)策劃方案
- 亞克力板材合同范本
- 廠房帶看合同范本
- 好習(xí)慣成就好人生
- 大學(xué)物理馬文蔚版PPT
- 內(nèi)蒙古自治區(qū)高層建筑工程結(jié)構(gòu)抗震基本參數(shù)表(2022年版)
- FZ/T 07010-2021綠色設(shè)計(jì)產(chǎn)品評(píng)價(jià)技術(shù)規(guī)范針織服裝
- 2023年北京市中學(xué)生數(shù)學(xué)競(jìng)賽高一年級(jí)復(fù)賽試題及解答
- 乙酰基乙烯酮(雙烯酮;二乙烯酮;雙乙烯酮)的理化性質(zhì)及危險(xiǎn)特性表
- 酒店機(jī)房巡視簽到表
- API-650-1鋼制焊接石油儲(chǔ)罐
- 鼠疫演練腳本
- 變壓器試驗(yàn)精品課件
- 危險(xiǎn)化學(xué)品從業(yè)單位安全生產(chǎn)標(biāo)準(zhǔn)化宣貫
評(píng)論
0/150
提交評(píng)論