red hat enterprise linux如何连接无线网络

作者&投稿:崇金 (若有异议请与网页底部的电邮联系)
red hat enterprise linux 6怎么网络配置~

Linux系统最简单的静态网络配置

使用的是red hat enterprise 5 系统
现想用Source CRT远程登录red hat系统,实现Windows主机上远程操作Linux主机的目的
Source CRT为Windows上使用的串口/远程登录的客户端
使用Source CRT远程登录Linux主机有Telnet和SSH两种服务,区别在于SSH带有数据加密功能
那么Linux主机上要装有SSH服务端,并且开启了服务
1,查看是否装有SSH服务端:
[root@localhost ~]# sshd -v
sshd: illegal option -- v
OpenSSH_4.3p2, OpenSSL 0.9.8b 04 May 2006
这里表面已经装有了SSH服务端,否则的话先下载SSH服务端安装
2,查看服务是否开启:
[root@localhost ssh]# service sshd restart
停止 sshd: [失败]
启动 sshd:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for '/etc/ssh/ssh_host_rsa_key' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_rsa_key
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for '/etc/ssh/ssh_host_dsa_key' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /etc/ssh/ssh_host_dsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.
大体上看出是密匙之类的问题,没有这个密匙,进入/etc/ssh,里面有ssh_host_dsa_key,ssh_host_rsa_key,难道是权限问题?
好吧再次生成密匙看看:
[root@localhost ~]# ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
Generating public/private dsa key pair.
/etc/ssh/ssh_host_dsa_key already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /etc/ssh/ssh_host_dsa_key.
Your public key has been saved in /etc/ssh/ssh_host_dsa_key.pub.
The key fingerprint is:
4c:63:cb:78:d9:29:fd:30:c5:c6:37:1f:81:48:93:77 root@localhost.localdomain
[root@localhost ~]# ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
Generating public/private rsa key pair.
/etc/ssh/ssh_host_rsa_key already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /etc/ssh/ssh_host_rsa_key.
Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub.
The key fingerprint is:
5a:19:3a:84:95:39:d3:91:07:68:46:90:93:85:ad:d8 root@localhost.localdomain
再次:
[root@localhost ssh]# service sshd restart
还是不行,看来是权限问题了,事实上,Ssh服务的所在文件权限太大,也不能启动该服务。
解决办法如下 :
[root@localhost /]# cd /etc/ssh
[root@localhost ssh]# ls -l
总计 204
-rwxrwxrwx 1 root root 132839 2007-07-13 moduli
-rwxrwxrwx 1 root root 1827 2007-07-13 ssh_config
-rwxrwxrwx 1 root root 3301 2007-07-13 sshd_config
-rwxrwxrwx 1 root root 668 06-10 09:10 ssh_host_dsa_key
-rwxrwxrwx 1 root root 612 06-10 09:10 ssh_host_dsa_key.pub
-rwxrwxrwx 1 root root 963 2010-10-12 ssh_host_key
-rwxrwxrwx 1 root root 627 2010-10-12 ssh_host_key.pub
-rwxrwxrwx 1 root root 1675 06-10 09:11 ssh_host_rsa_key
-rwxrwxrwx 1 root root 408 06-10 09:11 ssh_host_rsa_key.pub
果然权限全是777,太大了,改权限吧:
[root@localhost ssh]# chmod 600 sshd_config ssh_host_dsa_key
[root@localhost ssh]# chmod 600 ssh_host_key ssh_host_rsa_key
[root@localhost ssh]# chmod 620 moduli
[root@localhost ssh]# chmod 644 ssh_config ssh_host_dsa_key.pub
[root@localhost ssh]# chmod 644 ssh_host_rsa_key
修改权限后如下:
总计 204
-rw--w---- 1 root root 132839 2007-07-13 moduli
-rw-r--r-- 1 root root 1827 2007-07-13 ssh_config
-rw------- 1 root root 3301 2007-07-13 sshd_config
-rw------- 1 root root 668 06-10 09:10 ssh_host_dsa_key
-rw-r--r-- 1 root root 612 06-10 09:10 ssh_host_dsa_key.pub
-rw------- 1 root root 963 2010-10-12 ssh_host_key
-rwxrwxrwx 1 root root 627 2010-10-12 ssh_host_key.pub
-rw-r--r-- 1 root root 1675 06-10 09:11 ssh_host_rsa_key
-rwxrwxrwx 1 root root 408 06-10 09:11 ssh_host_rsa_key.pub
重新开启ssh服务,可以了:
[root@localhost ssh]# /etc/rc.d/init.d/sshd start
[root@localhost ssh]# service sshd restart
这两个命令是等同的,使用其一即可

永久开启相关服务:可在终端下输入:setup
查看Linux主机IP:ifconfig
修改Linux主机IP:ifconfig eth0 ***.***.***.***
开网关:ifconfig eth0 up
关网关:ifconfig eth0 down

Windows上运行Source CRT,配置如下:
说明主机名为Linux主机的IP,要求与Windows主机在同一个IP段内即可

Redhat中配置无线网络使用iwconfig。

iwconfig是Linux Wireless Extensions(LWE)的用户层配置工具之一。LWE是Linux下对无线网络配置的工具,
包括内核的支持、用户层配置工具和驱动接口的支持三部分。目前很多无线网卡都支持LWE,而且主流的Linux发

布版本,比如Redhat Linux、Ubuntu Linux都已经带了这个配置工具。

用法: iwconfig interface [essid {NN|on|off}]
[nwid {NN|on|off}]
[mode {managed|ad-hoc|...}
[freq N.NNNN[k|M|G]]
[channel N]
[ap {N|off|auto}]
[sens N]
[nick N]
[rate {N|auto|fixed}]
[rts {N|auto|fixed|off}]
[frag {N|auto|fixed|off}]
[enc {NNNN-NNNN|off}]
[power {period N|timeout N}]
[retry {limit N|lifetime N}]
[txpower N {mW|dBm}]
[commit]
说明:iwconfig是LWE最主要的工具,可以对无线网卡的大部分参数进行配置。
参数:
essid:设置无线网卡的ESSID(Extension Service Set ID)。通过ESSID来区分不同的无线网络,正常情况下

只有相同ESSID的无线站点
才可以互相通讯,除非想监听无线网络。其后的参数为双引号括起的ESSID字符串,或者是any/on/off

,如果ESSID字符串中包含
any/no/off,则需要在前面加"--"。
示例:
#ifconfig eth0 up/down 启动/禁用无线网卡
#iwconfig eth0 essid any 允许任何ESSID,也就是混杂模式
#iwconfig eth0 essid "My Network" 设置ESSID为"My Network"
#iwconfig eth0 essid -- "ANY" 设置ESSID为"ANY"
#iwconfig eth0 key [1] 设置key id
#iwconfig eth0 key 1231231234 设置password为1231231234
#iwpriv eth0 auth 2 设置认证方式为Shared
#iwpriv eth0 enc 2 设置加密方式为WEP
#iwlist eth0 scanning 搜索周围存在的无线网络
iwconfig eth0 nwid AB34
iwconfig eth0 nwid o
iwconfig eth0 nickname “My Linux Node”
iwconfig eth0 txpower off
iwconfig eth0 rts 250
iwconfig eth0 rts off
iwconfig eth0 mode Managed
iwconfig eth0 mode Ad-Hoc
iwconfig eth0 freq 2422000000
iwconfig eth0 freq 2.422G
iwconfig eth0 channel 3
iwconfig eth0 channel auto
iwconfig eth0 ap 00:60:1D:01:23:45
iwconfig eth0 ap any
iwconfig eth0 ap off
iwconfig eth0 rate 11M
iwconfig eth0 rate auto
iwconfig eth0 rate 5.5M auto
iwconfig eth0 txpower 15
iwconfig eth0 txpower 30mW
iwconfig eth0 txpower auto
iwconfig eth0 txpower off
iwconfig eth0 sens -80
iwconfig eth0 sens 2
iwconfig eth0 retry 16
iwconfig eth0 retry lifetime 300m
iwconfig eth0 retry min limit 8

nwid: Network ID,只用于pre-802.11的无线网卡,802.11网卡利用ESSID和AP的MAC地址来替换nwid,现在

基本上不用设置。
示例:
#iwconfig eth0 nwid AB34
#iwconfig eth0 nwid off

nick: Nickname,一些网卡需要设置该参数,但是802.11协议栈、MAC都没有用到该参数,一般也不用设置。
示例:
#iwconfig eth0 nickname "My Linux Node"

mode:设置无线网卡的工作模式,可以是
Ad-hoc:不带AP的点对点无线网络
Managed:通过多个AP组成的网络,无线设备可以在这个网络中漫游
Master:设置该无线网卡为一个AP
Repeater:设置为无线网络中继设备,可以转发网络包
Secondary:设置为备份的AP/Repeater
Monitor:监听模式
Auto:由无线网卡自动选择工作模式

示例:
#iwconfig eth0 mode Managed
#iwconfig eth0 mode Ad-Hoc

freq/channel:设置无线网卡的工作频率或者频道,小于1000的参数被认为是频道,大于10000的参数被认为

是频率。频率单位为Hz,
可以在数字后面附带k, M, G来改变数量级,比如2.4G。频道从1开始。使用lwlist工具可以查

看无线网卡支持的频率
和频道。参数off/auto指示无线网络自动挑选频率。
注意:如果是Managed模式,AP会指示无线网卡的工作频率,因此该设置的参数会被忽略。Ad-hoc模式

下只使用该设定的频率初始无线网络,如果加入已经存在的Ad-hoc网络则会忽略该设置的频率参数。
示例:
#iwconfig eth0 freq 2422000000
#iwconfig eth0 freq 2.422G
#iwconfig eth0 channel 3
#iwconfig eth0 channel auto
ap:连接到指定的AP或者无线网络,后面的参数可以是AP的MAC地址,也可以是iwlist scan出来的标识符。如

果是Ad-hoc,则连接到
一个已经存在的Ad-hoc网络。使用off参数让无线网卡不改变当前已连接的AP下进入自动模式。any/auto

参数,无线网卡自动选择
最好的AP。
注意:如果无线信号低到一定程度,无线网络会进入自动选择AP模式。
示例:
#iwconfig eth0 ap 00:60:1D:01:23:45
#iwconfig eth0 ap any
#iwconfig eth0 ap off
rate/bit:如果无线网卡支持多速率,则可以通过该命令设置工作的速率。小于1000的参数由具体的无线网卡

驱动定义,一般是传输速
率的索引值,大于1000的为速率,单位bps,可以在数字后面附带k, M, G来指定数量级。auto参数

让无线网卡自动选择速率
fixed参数让无线网卡不使用自动速率模式。

示例:
#iwconfig eth0 rate 11M
#iwconfig eth0 rate auto
#iwconfig eth0 rate 5.5M auto //自动选择5.5M以下的速率

txpower:如果无线网卡支持多发射功率设定,则使用该参数设定发射,单位为dBm,如果指定为W(毫瓦),只

转换公式为:
dBm=30+log(W)。参数on/off可以打开和关闭发射单元,auto和fixed指定无线是否自动选择发射功

率。
示例:
#iwconfig eth0 txpower 15
#iwconfig eth0 txpower 30mW
#iwconfig eth0 txpower auto
#iwconfig eth0 txpower off

sens:设置接收灵敏度的下限,在该下限之下,无线网卡认为该无线网络信号太差,不同的网卡会采取不同的

措施,一些现代的无线网卡
会自动选择新的AP。正的参数为raw data,直接传给无线网卡驱动处理,一般认为是百分比。负值表示

dBm值。

示例:
#iwconfig eth0 sens -80
#iwconfig eth0 sens 2

retry:设置无线网卡的重传机制。limit ‘value’ 指定最大重传次数;lifetime ‘value’指定最长重试时间

,单位为秒,可以附带m和u来
指定单位为毫秒和微秒。如果无线网卡支持自动模式,则在limit和lifetime之前还可以附加min和max

来指定上下限值。

示例:
#iwconfig eth0 retry 16
#iwconfig eth0 retry lifetime 300m
#iwconfig eth0 retry min limit 8

rts:指定RTS/CTS握手方式,使用RTS/CTS握手会增加额外开销,但如果无线网络中有隐藏无线节点或者有很

多无线节点时可以提高性能。
后面的参数指定一个使用该机制的最小包的大小,如果该值等于最大包大小,则相当于禁止使用该机制。

可以使用auto/off/fixed
参数。

示例:
#iwconfig eth0 rts 250
#iwconfig eth0 rts off

frag:设置发送数据包的分片大小。设置分片会增加额外开销,但在噪声环境下可以提高数据包的到达率。一

般情况下该参数小于最大包
大小,有些支持Burst模式的无线网卡可以设置大于最大包大小的值来允许Burst模式。还可以使用

auto/fixed/off参数。

示例:
#iwconfig eth0 frag 512
#iwconfig eth0 frag off

key/enc[ryption]:设置无线网卡使用的加密密钥,此处为设置WEP模式的加密key,如果要使用WPA,需要

wpa_supplicant工具包。
密钥参数可以是 XXXX-XXXX-XXXX-XXXX 或者 XXXXXXXX 格式的十六进制数值,也可以是s:xxxxxx的

ASCII字符。如果在密钥参数之前
加了[index],则只是设置该索引值对应的密钥,并不改变当前的密钥。直接指定[index]值可以设置当

前使用哪一个密钥。指定on/
off可以控制是否使用加密模式。open/restricted指定加密模式,取决于不同的无线网卡,大多数无线

网卡的open模式不使用加密且
允许接收没有加密的数据包,restricted模式使用加密。可以使用多个key参数,但只有最后一个生效


WEP密钥可以是40bit,用10个十六进制数字或者5个ASCII字符表示,也可以是128bit,用26个十六

进制数字或者13个ASCII字符表
示。
示例:
#iwconfig eth0 key 0123-4567-89
#iwconfig eth0 key [3] 0123-4567-89
#iwconfig eth0 key s:password [2]
#iwconfig eth0 key [2]
#iwconfig eth0 key open
#iwconfig eth0 key off
#iwconfig eth0 key restricted [3] 0123456789
#iwconfig eth0 key 01-23 key 45-67 [4] key [4]

power:设置无线网卡的电源管理模式。period ‘value’ 指定唤醒的周期,timeout ‘value’指定进入休眠的

等待时间,这两个参数之前可以
加min和max修饰,这些值的单位为秒,可以附加m和u来指定毫秒和微秒。off/on参数指定是否允许电

源管理,all/unicast/multicast
指定允许唤醒的数据包类型。

示例:
#iwconfig eth0 power period 2
#iwconfig eth0 power 500m unicast
#iwconfig eth0 power timeout 300u all
#iwconfig eth0 power off
#iwconfig eth0 power min period 2 power max period 4

commit:提交所有的参数修改给无线网卡驱动。有些无线网卡驱动会先缓存无线网卡参数修,使用这个命令来

让无线网卡的参数修改生效。不过一般不需要使用该命令,因为无线网卡驱动最终都会是参数的修改生效,一般

在debug时会用到。

-------------------------------------------------------------------------
iwlist eth1 scan 搜索无线网络:
显示搜到的网络(此处只显示一个):
eth1 Scan completed :
Cell 01 - Address: 00:04:E2:E3:04:FC
ESSID:"ap_demo"
Mode:Managed
Frequency:2.437 GHz
Quality:0/0 Signal level=-61 dBm Noise level=-96 dBm
Encryption key:on
Bit Rate:1 Mb/s
Bit Rate:2 Mb/s
Bit Rate:5.5 Mb/s
Bit Rate:11 Mb/s
Bit Rate:6 Mb/s
Bit Rate:9 Mb/s
Bit Rate:12 Mb/s
Bit Rate:18 Mb/s
Bit Rate:24 Mb/s
Bit Rate:36 Mb/s
Bit Rate:48 Mb/s
Bit Rate:54 Mb/s
Cell 02 ……
---------------------------------------------------------------------------
设置板子的channel
iwlist eth1 channel 11
-----------------------------------------------------------------------------
设置模式:
iwconfig eth1 mode managed

通过MAC 设置AP:
iwconfig eth1 ap 00:0A:EB:CA:79:B0
连接到WEP on 的AP:
iwconfig eth1 key s:12345 等效于 iwconfig eth1 enc 3132333435(12345的hex值) (为什么

AP64bit的口令是40bit呢)
iwconfig eth1 key on
iwconfig eth1 essid sychip_demo
断开WEP:
iwconfig eth1 enc off

查看IP:
ifconfig eth1
设置IP:
ifconfig eth1 10.3.1.74

把IP: 129.158.215.204 , netmask: 255.255.255.0分配给rh0,
# ifconfig rh0 129.158.215.204 netmask 255.255.255.0
获取IP;
ifconfig eth1 dhcp start (从eth1走,不需要ip即可dhcp)
udhcpc -i eth1
udhcpc --help

路由处理:
若要删除以 10. 起始的 IP 路由表中的所有路由,请键入:
route delete 10.*
route del default
route add -net 10.3.0.0 netmask 255.255.0.0 eth1 (eth1获得IP之前,使用此命令显示:No such

device)

和连接有线一个道理。前提是你有无线网卡。
然后输入密码连接就行了。
如果没有设置DHCP的话需要你设置一个IP地址。


孝义市18620022187: redhat linux enterprise 有什么特点 -
蒯舍颈痛: Redhat应该说是在国内使用人群最多的Linux版本,甚至有人将Redhat等同于Linux,而有些老鸟更是只用这一个版本的Linux.所以这个版本的特点就是使用人群数量大,资料非常多,言下之意就是如果你有什么不明白的地方,很容易找到人来问,而且网上的一般Linux教程都是以Redhat为例来讲解的.Redhat系列的包管理方式采用的是基于RPM包的YUM包管理方式,包分发方式是编译好的二进制文件.稳定性方面非常好,适合于服务器使用

孝义市18620022187: redhat linux enterprise 版本
蒯舍颈痛: RedHead enterprise 是企业版的,主要是用在服务器上的..我用过的从开始的RedHead enterprise3 到 RedHead enterprise 5 现在用RedHead enterprise5 update1..我想楼主你问的可能是RedHead Linux有多少个版本吧..

孝义市18620022187: 电脑进入welcome to red hat enterprise linux server,怎么使其正常开机 -
蒯舍颈痛: 您好,系统不能正常启动的原因多了. 您尝试从单用户切换到多用户,运行命令 # init 3 然后看看系统日志说什么?通过日志是判断问题出在哪个环节的主要方法 假如我的回答对您有所帮助,望采纳!

孝义市18620022187: red hat enterprise linux 5是什么软件 -
蒯舍颈痛: 红帽企业版,Linux中的一个发行版本,Linux主要用于服务器.

孝义市18620022187: 急!!!求高手!!!网页出现Red Hat Enterprise Linux Test Page怎么办? -
蒯舍颈痛: 这个属于域名解析问题,你查看一下/etc/hosts 文件 是不是有这个域名,如果有整行删除,其次在在把你的web服务停止, service httpd stop, 差不多就解决了,或者 你在ping 一下这个域名,看解析的ip地址 是什么? 一步一步排错.

孝义市18620022187: red hat enterprise linux 怎么用ssh开启 -
蒯舍颈痛: 使用的是red hat enterprise 5 系统 现想用Source CRT远程登录red hat系统,实现Windows主机上远程操作Linux主机的目的 Source CRT为Windows上使用的串口/远程登录的客户端 使用Source CRT远程登录Linux主机有Telnet和SSH两...

孝义市18620022187: RedHat enterprise linux as 5.4 开机引导问题 grub
蒯舍颈痛: 一个是red hat linux 一个是windows xp sp2,开机的时候峁┮桓?grub来引导启动! 今天把xp给重装了 但重装之后发现居然以前的grub失效了,启动之后直接进windows了!也就是说linux 没了! 原因很简单 重装xp后,mbr被xp写入信息导致grub...

孝义市18620022187: 安装Red Hat Enterprise Linux 5? -
蒯舍颈痛: 安装软件下载 Red Hat Enterprise Linux 5 Server通过五张CD或者一张DVD介质来进行操作系统安装软件的版本发售.如果您没有通过Red Hat官方获取到安装序列号,将只有核心服务器或 Desktop会被安装.但是其他功能可以在以后被手工安...

孝义市18620022187: Red Hat Enterprise Linux 跟RedHat Fedora Core 有什么区别 -
蒯舍颈痛: Red Hat Enterprise Linux (RHEL) 4.0 xSeries: x86-32 这个 xSeries 是什么不知到,不过后面这个 x86-32 表明是普通 x86 的 32 位架构,现在的机器基本都能装,不过 RHEL 4.0 这个很老了,可能会有没驱动而不能使用某些新硬件的问题,RH 一...

孝义市18620022187: Red Hat Enterprise Linux 5.5 版本区别
蒯舍颈痛: Red Hat Enterprise Linux Server 5.5主要针对企事业单位用作服务器是所用,他们所要求的硬件条件特高;个人学习使用一般用Red Hat Enterprise Linux Client 5.5.他们都有图形界面,不过后者的桌面设计更人性化,不同的是使用Red Hat Enterprise Linux Client 5.5的客户可以免费从他们的技术社区下载东西,即可以获得免费的技术支持;而使用Red Hat Enterprise Linux Server 5.5的客户若需获得技术支持须支付一定的费用

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 星空见康网