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

首頁(yè) > 系統(tǒng) > Linux > 正文

在UBUNTU命令行下自己手動(dòng)配置網(wǎng)絡(luò)

2024-08-28 00:22:14
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
LINUX下的網(wǎng)絡(luò)配置命令是ifconfig類似于WINDOWS命令行中的ipconfig。可以使用ifconfig命令來(lái)配置并查看網(wǎng)絡(luò)接口的配置情況。
例如:
(1) 配置eth0的IP地址, 同時(shí)激活該設(shè)備。
#ifconfig eth0 192.168.1.10 netmask 255.255.255.0 up
(2) 配置eth0別名設(shè)備eth0:1的IP地址,并添加路由。
#ifconfig eth0   192.168.1.3
#route add –host 192.168.1.3 dev eth0:1
(3) 激活設(shè)備。
#ifconfig eth0 up
(4) 禁用設(shè)備。
#ifconfig eth0 down
(5) 查看指定的網(wǎng)絡(luò)接口的配置。
#ifconfig eth0
(6) 查看所有的網(wǎng)絡(luò)接口配置。
#ifconfig
2、 route
可以使用route命令來(lái)配置并查看內(nèi)核路由表的配置情況。
例如:
(1) 添加到主機(jī)的路由。
#route add –host 192.168.1.2 dev eth0:0
#route add –host 10.20.30.148 gw 10.20.30.40
(2) 添加到網(wǎng)絡(luò)的路由。
#route add –net 10.20.30.40 netmask 255.255.255.248 eth0
#route add –net 10.20.30.48 netmask 255.255.255.248 gw 10.20.30.41
#route add –net 192.168.1.0/24 eth1
(3) 添加默認(rèn)網(wǎng)關(guān)。
#route add default gw 192.168.1.1
(4) 查看內(nèi)核路由表的配置。
#route
(5)刪除路由。
#route del –host 192.168.1.2 dev eth0:0
#route del –host 10.20.30.148 gw 10.20.30.40
#route del –net 10.20.30.40 netmask 255.255.255.248 eth0
#route del –net 10.20.30.48 netmask 255.255.255.248 gw 10.20.30.41
#route del –net 192.168.1.0/24 eth1
#route del default gw 192.168.1.1
對(duì)于1和2兩點(diǎn)可使用下面的語(yǔ)句實(shí)現(xiàn):
Ifconfig eth0 172.16.19.71 netmask 255.255.255.0
Route 0.0.0.0 gw 172.16.19.254
Service network restart
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 铜梁县| 南皮县| 定兴县| 彰化市| 阿勒泰市| 肇东市| 河曲县| 岱山县| 平利县| 黑河市| 鹿泉市| 衡东县| 新竹县| 缙云县| 寿阳县| 文安县| 绥阳县| 抚顺市| 三原县| 罗江县| 东至县| 郁南县| 万全县| 万年县| 甘泉县| 滦平县| 晋中市| 中西区| 永康市| 马公市| 阳西县| 罗甸县| 扶风县| 阿克| 伊宁市| 龙川县| 双城市| 太康县| 德令哈市| 九龙县| 精河县|