国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 操作系統(tǒng) > 正文

inter 千M網(wǎng)卡驅(qū)動安裝和啟用vlan.Polling抗拒絕服務(wù)

2020-10-23 22:27:10
字體:
供稿:網(wǎng)友

建立一個文件夾把驅(qū)動復(fù)制到里面
#mkdir /usr/local/src/em
解壓縮
#tar xvfz em-5.1.5.tar.gz
#cd em-5.1.5
編譯模塊
# make
安裝編譯好的模塊
#make install
如果你想啟動的時候自動加載模塊修改
ee /boot/loader.conf
添加if_em_load="YES"
------------------------------------------------------
編譯驅(qū)動到內(nèi)核
cd /usr/local/src/em/em-5.1.5/src
cp if_em* /usr/src/sys/dev/em
cp Makefile.kernel /usr/src/sys/modules/em/Makefile
修改/usr/src/sys/conf/files.i386 文件添加以下兩行到文件
內(nèi)

dev/em/if_em.c optional em 
dev/em/if_em_hw.c optional em 
修改你的內(nèi)核配置文件。確定有
device em

編譯安裝內(nèi)核。。。reboot.完成

-----------------------------------------------------------
下面說下有關(guān)網(wǎng)卡設(shè)置的參數(shù)
ifconfig_em<interface_num>="<ifconfig_settings>"
ifconfig em<interface_num> <IP_address> media 100baseTX mediaopt  full-duplex
驅(qū)動所支持的模式:

   autoselect      -  Enables auto-negotiation for speed and duplex.

   10baseT/UTP     -  Sets speed to 10 Mbps. Use the ifconfig mediaopt 
                      option to select full-duplex mode.

   100baseTX       -  Sets speed to 100 Mbps. Use the ifconfig mediaopt
                      option to select full-duplex mode.

   1000baseTX      -  Sets speed to 1000 Mbps. In this case, the driver
                      supports only full-duplex mode.

   1000baseSX      -  Sets speed to 1000 Mbps. In this case, the driver
                      supports only full-duplex mode.

ifconfig em<interface_num> <hostname or IP address> mtu 9000
route get <destination_IP_address>

[color=Red]VLANS設(shè)置[/color]建立vlan
#ifconfig <vlan_name> create
網(wǎng)卡的配置:
ifconfig <vlan_name> <ip_address> netmask <subnet_mask> vlan  <vlan_id> vlandev 

<physical_interface>
例如:
ifconfig vlan10 10.0.0.1 netmask 255.255.255.0 vlan10 vlandev em0
刪除VLAN
#ifconfig <vlan_name> destroy

[color=Red]Polling模式:本來網(wǎng)卡工作模式:需要的時候請求中斷。但在拒絕服務(wù)攻擊情況下,包數(shù)太多,就不太

可行,polling模式就是讓cpu定期去取網(wǎng)卡內(nèi)存中的數(shù)據(jù)包。雖然平時看上去這種方法比較效率低,但在

拒絕服務(wù)攻擊情況下就比較好用。[/color]
在內(nèi)核中確保:
options DEVICE_POLLING
可選:
options HZ=1000
polling在sysctl中參數(shù)的含義
kern.polling.enable=1           打開polling模式
kern.polling.burst                  每個時間片,系統(tǒng)在每個網(wǎng)卡可以抓的最多的包值,不可以改的值,根據(jù)其

他值系統(tǒng)自己算的
kern.polling.burst_max          每次取多少內(nèi)存中的包默認(rèn)150,是 一個參數(shù),和內(nèi)核里面的HZ相乘(HZ * 

burst_max)就是每秒cpu極限可以抓的包量   默認(rèn)HZ=1000
kern.polling.each_burst         沒搞懂用處,默認(rèn)5 好像用處不大
kern.polling.idle_poll=1          man 中推薦打開選項
kern.polling.reg_frac             多久檢測一次網(wǎng)卡錯誤 默認(rèn)20
kern.polling.user_frac=10      cpu預(yù)留給userland  tasks的量 默認(rèn)50, 做防火墻推薦少留一點
kern.polling.handlers              有多少網(wǎng)卡注冊了polling服務(wù)  不用改

注:HZ的含義以及burst_max的關(guān)系,HZ就是赫茲,時間的倒數(shù),就是多久cpu去取一次網(wǎng)卡內(nèi)存中的包
HZ越大,CPU去取的時間間隔越短,burst_max就是每次取多少內(nèi)存中的包。
這個參數(shù)需要自行測試,HZ越大,在大流量下用top看中斷就越多
感覺范圍在500-2000比較合適,再大就。。。。。
在內(nèi)核中為:options HZ=500   (我設(shè)置500,burst_max設(shè)置150,可保證我的服務(wù)器穩(wěn)定和抗攻擊能力比較好)
 

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 来安县| 上思县| 平武县| 临清市| 石棉县| 玉屏| 乐业县| 桂阳县| 乌拉特前旗| 来宾市| 通江县| 郸城县| 沿河| 云阳县| 白水县| 岗巴县| 潜江市| 五大连池市| 略阳县| 九龙坡区| 兴隆县| 通海县| 吴川市| 汝阳县| 衡山县| 利津县| 全椒县| 米林县| 吐鲁番市| 佛山市| 商南县| 双鸭山市| 西乌| 无锡市| 秭归县| 石门县| 汾西县| 丰原市| 峨边| 益阳市| 揭阳市|