Fedora Core網絡配置相關的文件和命令-Linux系統操作
在向大家詳細介紹Fedora Core網絡配置之前,首先讓大家了解下Fedora Core網絡配置,然后全面介紹Fedora Core網絡配置Linux的基礎知識,包括Fedora的安裝、磁盤分區、Linux的基礎操作,旨在讓讀者對Linux有個初步的認識。涉及文件管理、磁盤管理、用戶與組群管理、man幫助、軟件包管理、文件壓縮和打印機管理。希望對大家有用。
一、Fedora Core網絡配置的工具system-config-network;
1、Fedora Core網絡配置工具system-config-network本工具分為圖形模式和文本命令模式
[root@localhost beinan]# rpm -qa |grep system-config-network
system-config-network-tui-1.3.26-1 注:這個是圖形化的工具;
system-config-network-1.3.26-1 注:這個是文本化的工具;
首先查詢一下看是否已經安裝好這個軟件包,如果沒有安裝,從安裝盤中找出這兩個包安裝上;
[root@localhost beinan]#rpm -ivh system-config-network*
圖形化工具主要是通過如下命令調用:
[root@localhost beinan]# /usr/bin/internet-druid
[root@localhost beinan]# /usr/bin/neat
[root@localhost beinan]# /usr/bin/neat-control 注:網絡設置控制器;是圖形化的
[root@localhost beinan]# /usr/bin/system-config-network-druid
[root@localhost beinan]# /usr/bin/system-control-network
[root@localhost beinan]# /usr/sbin/internet-druid 注:這個是配置internet的工具;
[root@localhost beinan]# /usr/sbin/neat 注:neat 是Fedora Core網絡配置的工具,包含量配置internet的工具比如ADSL等;
[root@localhost beinan]# /usr/sbin/system-config-network-druid 注:是neat的一部份
[root@localhost beinan]# /usr/sbin/system-config-network-gui 注:同neat
文本模式的調用:和圖形界面的差不多;
[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
其實您用neat 工具,足可以把Fedora Core網絡配置起來,這是圖形界面的;如果您想用text模式來配置,應該用 system-config-network-tui;
2、如何用圖形化Fedora Core網絡配置工具;
[root@localhost beinan]#neat
在這里您可以添加網卡,也可以編輯現有的網絡設備;也可以添加adsl的拔號等;您可以點擊[新建]來添加設備;比如網卡和ADSL等; 如果您是通過路由器或者其它機器上網,并且是DHCP自動獲取IP的,您可以選擇DHCP;如果您是通過pppoe拔號上網的,您可以指定網卡的IP;但不要設置網關;配置ADSL的用戶名和密碼:網絡提供商應該給了;比如電信、網通或者鐵通,至于提供商的名稱可以我們自己來隨便設置一個就行;用戶名和密碼要確保正確的;配置好后,我們要先保存,然后激活您添加的設備;這一過程都是極為簡單的;
二、一些與Fedora Core網絡配置相關的文件和命令;
1、如果您在命令行下啟動網絡服務,應該是:
[root@localhost beinan]# /etc/init.d/network start
[root@localhost beinan]# /etc/init.d/network restart
2、Fedora Core網卡的配置文件在 /etc/sysconfig/network-scripts 目錄中;比如eth0的配置文件是由 neat 添加網卡后生成的,文件是ifcfg-eth0;
3、網卡是不是被支持;首先要學會用lspci -v ,查看網卡芯片組信息;用modprobe 內核驅動模塊名 來加載網卡驅動;如果您的系統安裝完成后找不到網卡,可能就要自己來modprobe 模塊,或者自己安裝網卡驅動;內核的硬件設備模塊存放在 /lib/modules/內核版本號,用tab鍵補齊就能看到了/kernel/drivers/比如我的系統內核網卡驅動模塊存放在 /lib/modules/2.6.11-1.1369_FC4/kernel/drivers/net/用 lsmod 來查看是不是已經加載了驅動;如果沒有就用 modprobe 命令來加載,比如加載8139網卡驅動:[root@localhost beinan]# modprobe 8139too應該查看 /etc/modprobe.conf ;比如我用的是8139的網卡,應該在 /etc/modprobe.conf 中有一行;alias eth0 8139too 如果有第二個網卡eth0,還是要加一行;alias eth1 8139too ;當然與您的網卡芯片有關,8139芯片組的網卡,就是內核對應的驅動模塊 8139too支持;
4、ifconfig 和ifup ifdown 的應用
[root@localhost beinan]# ifconfig eth0 on 注:激活網卡eth0
[root@localhost beinan]# ifconfig eth9 down 注:斷開網卡eth0
[root@localhost beinan]# ifup eth0 注:激活網卡eth0
[root@localhost beinan]# ifdown eth0 注:激活網卡eth0
[root@localhost beinan]# ifconfig -a 注:看是否激活了網絡設備;
ifconfig 還能Fedora Core配置網卡的IP等;是一個命令行的配置工具;以后介紹;
5、adsl 拔號軟件命令行配置工具rp-pppoe;(如果您的ADSL不帶路由功能,可以用rp-pppoe來拔號)
注:用neat 完全可以實現此添加adsl拔號上網的功能,如果您用的是usb接口的ADSL ,要先把驅動安裝上,對USB ADSL的支持Linux是有點麻煩;如果是乙太口的,所有的都支持;adsl如果是用pppoe 拔號的也可以用 adsl-setup 來配置;當然您要把網卡的IP配置好,然后再來設置ADSL配置;比如您的網卡eth0可以設置成
ip:192.168.0.1
netmask:255.255.255.0
網關不要配置:
然后來運行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提供商給的用戶名,寫在這里
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通過第一臺機器的第一張網卡eth0提供上網
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這是第二個DNS,也是電信給的。
PASSWORD
Please enter your Password:在這里把 ADSL提供商給的密碼寫上
Please re-enter your Password:確認密碼
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拔號;用 ifup ppp0 或者 adsl-start ;[root@localhost beinan]# adsl-start
6、resolv.conf 文件;
/etc/resolv.conf 文件,只訪問要是用來解析域名的;如果您只能ip訪問或者能ping 通IP ,但不能域名訪問,請編輯這個件;如果您是通過DHCP自動獲取IP的, 這個文件不用改動;如果您是指定IP的,可能忘記了加DNS,要在這個文件添加上,這個文件的內容類似如下的:
nameserver 202.96.128.68
nameserver 202.96.134.188
nameserver 211.64.144.130
nameserver 202.96.134.133
resolv.conf 內容,每行以 nameserver 開頭,然后加上DNS,最好找一個自己城市的DNS,上面的這些也是可以用的;復制上去就行了;
后記:只是簡單的介紹了一下,有時間我好好整理一篇關于Fedora Core網絡配置工具的詳細介紹性的;祝大家好運;
【編輯推薦】