在windows下的ad-hoc直連模式只須要修改成計算機點對點方式便可,在Fedora下進行ad-hoc配置過程以下: # ifconfig wlan0 down # iwconfig wlan0 mode ad-hoc # iwconfig wlan0 essid 「adhoc」 # ifconfig wlan0 192.168.0.1 netmask 255.255.255.0 # iptables -F # iptables -P INPUT ACCEPT # iptables -P FORWARD ACCEPT # iptables -t nat -A POSTROUTING -o etho -j MASQUERADE #echo 1 > /proc/sys/net/ipv4/ip_forward 或者直接配置無線網卡配置程序: # vi /etc/sysconfig/network-scripts/ifcfg-wlan0 DEVICE=wlan0 BOOTPROTO=static BROADCAST=192.168.0.255 HWADDR=9B:A2:CF:44:E4:E3 IPADDR=192.168.0.1 NETMASK=255.255.255.0 NETWORK=192.168.0.0 ONBOOT=no MODE=Ad-hoc ESSID=adhoc CHANNEL=3 保存後重啓網絡服務便可。iptables部分和上面同樣。 用iwconfig命令查看無線網卡狀態: [root@myfedora ~]# iwconfig wlan0 wlan0 IEEE 802.11abg ESSID:"adhoc" Mode:Ad-Hoc Frequency:2.412 GHz Cell: 9B:A2:CF:44:E4:E3 Tx-Power=15 dBm Retry long limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:off Link Quality:0 Signal level:0 Noise level:0 Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 一切搞定了,其餘電腦就能夠直接連接這臺電腦的無線網卡進行共享上網了。