Fedora Core網(wǎng)絡(luò)配置相關(guān)的文件和命令-Linux系統(tǒng)操作
在向大家詳細(xì)介紹Fedora Core網(wǎng)絡(luò)配置之前,首先讓大家了解下Fedora Core網(wǎng)絡(luò)配置,然后全面介紹Fedora Core網(wǎng)絡(luò)配置Linux的基礎(chǔ)知識(shí),包括Fedora的安裝、磁盤(pán)分區(qū)、Linux的基礎(chǔ)操作,旨在讓讀者對(duì)Linux有個(gè)初步的認(rèn)識(shí)。涉及文件管理、磁盤(pán)管理、用戶與組群管理、man幫助、軟件包管理、文件壓縮和打印機(jī)管理。希望對(duì)大家有用。
一、Fedora Core網(wǎng)絡(luò)配置的工具system-config-network;
1、Fedora Core網(wǎng)絡(luò)配置工具system-config-network本工具分為圖形模式和文本命令模式
[root@localhost beinan]# rpm -qa |grep system-config-network
system-config-network-tui-1.3.26-1 注:這個(gè)是圖形化的工具;
system-config-network-1.3.26-1 注:這個(gè)是文本化的工具;
首先查詢一下看是否已經(jīng)安裝好這個(gè)軟件包,如果沒(méi)有安裝,從安裝盤(pán)中找出這兩個(gè)包安裝上;
[root@localhost beinan]#rpm -ivh system-config-network*
圖形化工具主要是通過(guò)如下命令調(diào)用:
[root@localhost beinan]# /usr/bin/internet-druid
[root@localhost beinan]# /usr/bin/neat
[root@localhost beinan]# /usr/bin/neat-control 注:網(wǎng)絡(luò)設(shè)置控制器;是圖形化的
[root@localhost beinan]# /usr/bin/system-config-network-druid
[root@localhost beinan]# /usr/bin/system-control-network
[root@localhost beinan]# /usr/sbin/internet-druid 注:這個(gè)是配置internet的工具;
[root@localhost beinan]# /usr/sbin/neat 注:neat 是Fedora Core網(wǎng)絡(luò)配置的工具,包含量配置internet的工具比如ADSL等;
[root@localhost beinan]# /usr/sbin/system-config-network-druid 注:是neat的一部份
[root@localhost beinan]# /usr/sbin/system-config-network-gui 注:同neat
文本模式的調(diào)用:和圖形界面的差不多;
[root@localhost beinan]# /usr/bin/system-config-network
[root@localhost beinan]# /usr/bin/system-config-network-cmd
[root@localhost beinan]# /usr/sbin/neat-tui
[root@localhost beinan]# /usr/sbin/system-config-network
[root@localhost beinan]# /usr/sbin/system-config-network-cmd
[root@localhost beinan]# /usr/sbin/system-config-network-tui
其實(shí)您用neat 工具,足可以把Fedora Core網(wǎng)絡(luò)配置起來(lái),這是圖形界面的;如果您想用text模式來(lái)配置,應(yīng)該用 system-config-network-tui;
2、如何用圖形化Fedora Core網(wǎng)絡(luò)配置工具;
[root@localhost beinan]#neat
在這里您可以添加網(wǎng)卡,也可以編輯現(xiàn)有的網(wǎng)絡(luò)設(shè)備;也可以添加adsl的拔號(hào)等;您可以點(diǎn)擊[新建]來(lái)添加設(shè)備;比如網(wǎng)卡和ADSL等; 如果您是通過(guò)路由器或者其它機(jī)器上網(wǎng),并且是DHCP自動(dòng)獲取IP的,您可以選擇DHCP;如果您是通過(guò)pppoe拔號(hào)上網(wǎng)的,您可以指定網(wǎng)卡的IP;但不要設(shè)置網(wǎng)關(guān);配置ADSL的用戶名和密碼:網(wǎng)絡(luò)提供商應(yīng)該給了;比如電信、網(wǎng)通或者鐵通,至于提供商的名稱可以我們自己來(lái)隨便設(shè)置一個(gè)就行;用戶名和密碼要確保正確的;配置好后,我們要先保存,然后激活您添加的設(shè)備;這一過(guò)程都是極為簡(jiǎn)單的;
二、一些與Fedora Core網(wǎng)絡(luò)配置相關(guān)的文件和命令;
1、如果您在命令行下啟動(dòng)網(wǎng)絡(luò)服務(wù),應(yīng)該是:
[root@localhost beinan]# /etc/init.d/network start
[root@localhost beinan]# /etc/init.d/network restart
2、Fedora Core網(wǎng)卡的配置文件在 /etc/sysconfig/network-scripts 目錄中;比如eth0的配置文件是由 neat 添加網(wǎng)卡后生成的,文件是ifcfg-eth0;
3、網(wǎng)卡是不是被支持;首先要學(xué)會(huì)用lspci -v ,查看網(wǎng)卡芯片組信息;用modprobe 內(nèi)核驅(qū)動(dòng)模塊名 來(lái)加載網(wǎng)卡驅(qū)動(dòng);如果您的系統(tǒng)安裝完成后找不到網(wǎng)卡,可能就要自己來(lái)modprobe 模塊,或者自己安裝網(wǎng)卡驅(qū)動(dòng);內(nèi)核的硬件設(shè)備模塊存放在 /lib/modules/內(nèi)核版本號(hào),用tab鍵補(bǔ)齊就能看到了/kernel/drivers/比如我的系統(tǒng)內(nèi)核網(wǎng)卡驅(qū)動(dòng)模塊存放在 /lib/modules/2.6.11-1.1369_FC4/kernel/drivers/net/用 lsmod 來(lái)查看是不是已經(jīng)加載了驅(qū)動(dòng);如果沒(méi)有就用 modprobe 命令來(lái)加載,比如加載8139網(wǎng)卡驅(qū)動(dòng):[root@localhost beinan]# modprobe 8139too應(yīng)該查看 /etc/modprobe.conf ;比如我用的是8139的網(wǎng)卡,應(yīng)該在 /etc/modprobe.conf 中有一行;alias eth0 8139too 如果有第二個(gè)網(wǎng)卡eth0,還是要加一行;alias eth1 8139too ;當(dāng)然與您的網(wǎng)卡芯片有關(guān),8139芯片組的網(wǎng)卡,就是內(nèi)核對(duì)應(yīng)的驅(qū)動(dòng)模塊 8139too支持;
4、ifconfig 和ifup ifdown 的應(yīng)用
[root@localhost beinan]# ifconfig eth0 on 注:激活網(wǎng)卡eth0
[root@localhost beinan]# ifconfig eth9 down 注:斷開(kāi)網(wǎng)卡eth0
[root@localhost beinan]# ifup eth0 注:激活網(wǎng)卡eth0
[root@localhost beinan]# ifdown eth0 注:激活網(wǎng)卡eth0
[root@localhost beinan]# ifconfig -a 注:看是否激活了網(wǎng)絡(luò)設(shè)備;
ifconfig 還能Fedora Core配置網(wǎng)卡的IP等;是一個(gè)命令行的配置工具;以后介紹;
5、adsl 拔號(hào)軟件命令行配置工具rp-pppoe;(如果您的ADSL不帶路由功能,可以用rp-pppoe來(lái)拔號(hào))
注:用neat 完全可以實(shí)現(xiàn)此添加adsl拔號(hào)上網(wǎng)的功能,如果您用的是usb接口的ADSL ,要先把驅(qū)動(dòng)安裝上,對(duì)USB ADSL的支持Linux是有點(diǎn)麻煩;如果是乙太口的,所有的都支持;adsl如果是用pppoe 拔號(hào)的也可以用 adsl-setup 來(lái)配置;當(dāng)然您要把網(wǎng)卡的IP配置好,然后再來(lái)設(shè)置ADSL配置;比如您的網(wǎng)卡eth0可以設(shè)置成
ip:192.168.0.1
netmask:255.255.255.0
網(wǎng)關(guān)不要配置:
然后來(lái)運(yùn)行adsl-setup
[root@LinuxSir02 root]# adsl-setup
Welcome to the ADSL client setup. First, I will run some checks on
your system to make sure the PPPoE client is installed properly...
LOGIN NAME
Enter your Login Name (default root): ADSL提供商給的用戶名,寫(xiě)在這里
INTERFACE
Enter the Ethernet interface connected to the ADSL modem
For Solaris, this is likely to be something like /dev/hme0.
For Linux, it will be ethX, where 'X' is a number.
(default eth0): eth0這是ADSL通過(guò)第一臺(tái)機(jī)器的第一張網(wǎng)卡eth0提供上網(wǎng)
Do you want the link to come up on demand, or stay up continuously?
If you want it to come up on demand, enter the idle time in seconds
after which the link should be dropped. If you want the link to
stay up permanently, enter 'no' (two letters, lower-case.)
NOTE: Demand-activated links do not interact well with dynamic IP
addresses. You may have some problems with demand-activated links.
Enter the demand value (default no):在這里按一下回車就行了。
DNS
Please enter the IP address of your ISP's primary DNS server.
If your ISP claims that 'the server will provide dynamic DNS addresses',
enter 'server' (all lower-case) here.
If you just press enter, I will assume you know what you are
doing and not modify your DNS setup.
Enter the DNS information here: 202.96.134.133 這是DSN,最好用你本地電信給的
Please enter the IP address of your ISP's secondary DNS server.
If you just press enter, I will assume there is only one DNS server.
Enter the secondary DNS server address here: 202.96.168.68這是第二個(gè)DNS,也是電信給的。
PASSWORD
Please enter your Password:在這里把 ADSL提供商給的密碼寫(xiě)上
Please re-enter your Password:確認(rèn)密碼
USERCTRL
Please enter 'yes' (two letters, lower-case.) if you want to allow
normal user to start or stop DSL connection (default yes): yes
FIREWALLING
Please choose the firewall rules to use. Note that these rules are
very basic. You are strongly encouraged to use a more sophisticated
firewall setup; however, these will provide basic security. If you
are running any servers on your machine, you must choose 'NONE' and
set up firewalling yourself. Otherwise, the firewall rules will deny
access to all standard servers like Web, e-mail, ftp, etc. If you
are using SSH, the rules will block outgoing SSH connections which
allocate a privileged source port.
The firewall choices are:
0 - NONE: This script will not set any firewall rules. You are responsible
for ensuring the security of your machine. You are STRONGLY
recommended to use some kind of firewall rules.
1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation
2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway
for a LAN
Choose a type of firewall (0-2): 2
Start this connection at boot time
Do you want to start this connection at boot time?
Please enter no or yes (default no):yes
** Summary of what you entered **
Ethernet Interface: eth0
User name: ADSL用戶名
Activate-on-demand: No
Primary DNS: 202.96.134.133
Secondary DNS: 202.96.168.68
Firewalling: MASQUERADE
User Control: yes
Accept these settings and adjust configuration files (y/n)?y
激活 adsl拔號(hào);用 ifup ppp0 或者 adsl-start ;[root@localhost beinan]# adsl-start
6、resolv.conf 文件;
/etc/resolv.conf 文件,只訪問(wèn)要是用來(lái)解析域名的;如果您只能ip訪問(wèn)或者能ping 通IP ,但不能域名訪問(wèn),請(qǐng)編輯這個(gè)件;如果您是通過(guò)DHCP自動(dòng)獲取IP的, 這個(gè)文件不用改動(dòng);如果您是指定IP的,可能忘記了加DNS,要在這個(gè)文件添加上,這個(gè)文件的內(nèi)容類似如下的:
nameserver 202.96.128.68
nameserver 202.96.134.188
nameserver 211.64.144.130
nameserver 202.96.134.133
resolv.conf 內(nèi)容,每行以 nameserver 開(kāi)頭,然后加上DNS,最好找一個(gè)自己城市的DNS,上面的這些也是可以用的;復(fù)制上去就行了;
后記:只是簡(jiǎn)單的介紹了一下,有時(shí)間我好好整理一篇關(guān)于Fedora Core網(wǎng)絡(luò)配置工具的詳細(xì)介紹性的;祝大家好運(yùn);
【編輯推薦】