CentOS7命令行安裝Mininet完整指南
準(zhǔn)備工作
確保系統(tǒng)已更新至最新版本:
sudo yum update -y
安裝必要依賴
安裝編譯工具與基礎(chǔ)組件:
sudo yum install -y git make gcc automake autoconf libtool python3-devel
安裝Open vSwitch
執(zhí)行以下命令安裝OVS組件:
sudo yum install -y openssl-devel
git clone https://github.com/openvswitch/ovs.git
cd ovs
./boot.sh
./configure --prefix=/usr --with-linux=/lib/modules/$(uname -r)/build
make
sudo make install
sudo /sbin/modprobe openvswitch
安裝Mininet
通過(guò)GitHub倉(cāng)庫(kù)獲取最新源碼:
git clone https://github.com/mininet/mininet.git
cd mininet
sudo ./util/install.sh -n
驗(yàn)證安裝結(jié)果
運(yùn)行基礎(chǔ)網(wǎng)絡(luò)測(cè)試:
sudo mn --test pingall
成功顯示"Results: 0% dropped"表示安裝完成。
故障排查
- 依賴缺失時(shí)重新執(zhí)行
yum install
命令 - 確保內(nèi)核頭文件路徑正確
- 檢查Python3環(huán)境是否配置
環(huán)境清理(可選)
sudo rm -rf /usr/local/bin/mn
sudo rm -rf /usr/local/lib/python3.*/site-packages/mininet*