fedora下一些与网络配置相关的文件和命令

http://thethe.blog.51cto.com/498901/145966/

1、如果您在命令行下启动网络服务,应该是:

[root@localhost beinan]# /etc/init.d/network start
[root@localhost beinan]# /etc/init.d/network restart
2、网卡的配置文件在 /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 还能配置网卡的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,上面的这些也是可以用的;复制上去就行了;

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值