PVE(Proxmox VE) 多網口的識別
前言: |
這是篇關於網卡(多個網口)在PVE
系統內的識別分享貼,透過ethtool
指令可以很方便地找出每個網口相對應的位置。
操作步驟: |
以Intel EXPI9402PTBLK 82571GB Network Adapter
作範例
安裝ethtool
指令
apt update && apt install ethtool -y
ethtool
可用於查看網絡設備的驅動參數和硬件配置。
看查網卡在PVE
伺服器的裝置名稱
ip -c a
其中enp1s0f0
和enp1s0f1
是網卡的两個網口,對應的MAC
地址分別為00:24:81:7e:ce:cb
和00:24:81:7e:ce:ca
方法A |
透過ethtool
識別在PVE
系統內的裝置名稱和相對應網口位置。
輸入以下指令,查找第一個裝置名稱enp1s0f0
的實體網口 (網口有指示燈)
ethtool --identify enp1s0f0
輸入以下指令,查找第二個裝置名稱enp1s0f1
的實體網口 (網口有指示燈)
ethtool --identify enp1s0f1
方法B |
如果網卡不支援ethtool --identify
指令(指示燈)作識別,可以使用以下方法。
分別啟用两個網口enp1s0f0
和 enp1s0f1
ifup enp1s0f0
ifup enp1s0f1
將上網線(Cat5e
)分別插入到網卡(Intel EXPI9402PTBLK 82571GB
)其中一個網口及上網線另一邊插入其他通電網口,如交換機、路由器、電腦等等。
這時輸入指令查看網口狀態
ethtool enp1s0f0
如圖示,Link detected: yes 代表找到的網口為enp1s0f0
,
反之顯示為Link detected: no 即找到沒有插線的網口 enp1s0f1
設備位置 |
當要直通指定網口時,透過ethtool
可以很容易地找到網口在PVE
系統內的位置。
查看伺服器所有物理網卡及位置
lspci | grep -in 'eth'
查看第一個網口enp1s0f0
的位置
ethtool -i enp1s0f0
查看第二個網口enp1s0f1
的位置
ethtool -i enp1s0f1
圖示中,第一個網口enp1s0f0
的位置是01:00.0
,第二個網口enp1s0f1
的位置是01:00.1
。
最後在虛擬機內直通指定網卡或者網口
硬件直通及分組 |
BIOS中確保開啟硬體直通相關選項(VT-d & VMX)
在PVE的Terminal編輯grub文件
vi /etc/default/grub
修改 GRUB_CMDLINE_LINUX_DEFAULT="quiet"
為
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt pcie_acs_override=downstream,multifunction"
參數 | 描述 |
---|---|
quiet | 用於在系統啟動時隱藏大部分啟動訊息,提供更簡潔的啟動過程。 |
intel_iommu=on | 啟用 Intel 的 IOMMU (Input-Output Memory Management Unit),允許虛擬機直接使用物理硬體。 |
iommu=pt | 啟用被動模式的 IOMMU,只為直通裝置啟用地址轉換,其餘裝置則以預設方式運作,減少性能損失。 |
pcie_acs_override=downstream,multifunction | 強制啟用 PCIe 的 ACS (Access Control Services),在不支援 ACS 的硬體上特別有用。 |
downstream | 啟用下游端口的隔離。 |
multifunction | 允許多功能設備的功能分離,對於某些設備(如 多網口網卡、GPU)需要進一步分離時很有用。 |
更新grub
update-grub
結語: |
利用ethtool
識別多網口的網卡真的非常方便。最後可以制作一張對應的表格,方便往後查找。
實體網卡 | MAC Address | PVE 裝置名稱 | 設備位置(用於直通) | VM內名稱 |
---|---|---|---|---|
第一個網口 | 00:24:81:7E:CE:CB | enp1s0f0 | 01:00.0 | LAN |
第二個網口 | 00:24:81:7E:CE:CA | enp1s0f1 | 01:00.1 | WAN |
參考資料: |
相關貼文: |
Howdy would you mind stating which blog platform you're working
with? I'm looking to start my own blog soon but I'm having a tough time
choosing between BlogEngine/Wordpress/B2evolution and Drupal.
The reason I ask is because your design seems different then most blogs and I'm looking for something unique.
P.S Apologies for getting off-topic but I had to ask!
homepage
Hiya! Quick question that's entirely off topic. Do you know how to make your site mobile friendly?
My blog looks weird when viewing from my apple iphone. I'm trying to find a theme or plugin that might
be able to resolve this issue. If you have any suggestions, please share.
Many thanks!
casino en ligne
Ahaa, its nice dialogue about this post here at this blog, I have read all
that, so now me also commenting here.
casino en ligne
I'm gone to convey my little brother, that he should also
visit this blog on regular basis to obtain updated from hottest gossip.
web site
Excellent beat ! I would like to apprentice whilst you amend your website, how could i subscribe for a weblog web site?
The account aided me a appropriate deal. I have been a little bit
familiar of this your broadcast offered vibrant transparent concept
casino en ligne
Hello! I've been following your blog for some time now and finally got the courage to go ahead and give you a
shout out from Huffman Tx! Just wanted to say keep up the good job!
casino en ligne fiable
First of all I would like to say wonderful blog! I had a quick
question in which I'd like to ask if you do not mind.
I was interested to find out how you center yourself and clear your thoughts before writing.
I've had a hard time clearing my thoughts in getting my thoughts
out there. I truly do take pleasure in writing however it just seems
like the first 10 to 15 minutes are usually wasted just trying to figure out how to
begin. Any suggestions or tips? Thank you!
meilleur casino en ligne
This is the perfect web site for anyone who wishes to find out about this topic.
You understand so much its almost tough to argue
with you (not that I really will need to…HaHa). You certainly put a new spin on a topic that has been discussed for ages.
Wonderful stuff, just wonderful!
casino en ligne francais
Appreciation to my father who informed me on the topic of this weblog, this webpage is genuinely remarkable.
homepage
I am not sure where you're getting your information, but
great topic. I needs to spend some time learning more or understanding more.
Thanks for great info I was looking for this info for my mission.
web site
Excellent website you have here but I was curious if you knew of any message
boards that cover the same topics talked about here?
I'd really like to be a part of group where I can get
opinions from other experienced people that share the same interest.
If you have any recommendations, please let me know. Thanks!
webpage
You should take part in a contest for one of the finest sites
online. I will highly recommend this website!
web page
My partner and I stumbled over here different website and thought I might as
well check things out. I like what I see so i am just following you.
Look forward to checking out your web page yet again.
web site
Excellent way of telling, and pleasant article to take data about my presentation focus, which i
am going to deliver in institution of higher education.
website
Have you ever considered publishing an ebook or guest authoring on other
sites? I have a blog based on the same ideas you discuss and would really
like to have you share some stories/information. I know my visitors would appreciate your work.
If you're even remotely interested, feel free to shoot
me an email.
casino en ligne
I have read so many content about the blogger lovers except this piece of writing is actually a good piece of writing, keep it up.
meilleur casino en ligne
I all the time used to study piece of writing in news
papers but now as I am a user of net thus from now
I am using net for content, thanks to web.
casino en ligne France
Hello, of course this article is genuinely nice and I have learned lot of
things from it about blogging. thanks.
casino en ligne
It's a pity you don't have a donate button! I'd definitely donate to this brilliant blog!
I guess for now i'll settle for bookmarking
and adding your RSS feed to my Google account. I look forward to fresh updates
and will talk about this site with my Facebook group. Chat soon!
https://www.lavozdemichoacan.com.mx/entretenimiento/como-saber-cuando-un...
Hello, I think your site might be having browser compatibility issues.
When I look at your website in Safari, it looks fine but when opening in Internet Explorer, it
has some overlapping. I just wanted to give you a quick heads up!
Other then that, amazing blog!
homepage
Inventonslemondedapres : l'allié des joueurs qui
recherchent des casinos en ligne aux interfaces modernes et ergonomiques.