Objectively speaking, there are two laptops in the House that need to access the Internet, one Wired Broadband Access Line. Notebook A: ora14 sends wireless signals as A router; notebook B: Win7 connects to the Ad-hoc wireless network established by Fedora14 and acts as A client to access the Internet. Ad-hoc: A special wireless network application mode. A group of computers connect to a wireless network card to connect to each other and share resources without using an AccessPoint. Ad-Hoc structure
Objective situation
There are two laptops in the House to access the Internet, one Wired Broadband Access Line. Notebook A: Fedora 14 sends wireless signals as A router; notebook B: Win 7 connects to the Ad-hoc wireless network established by Fedora 14, and accesses the Internet as A client.
Ad-hoc
Ad-hoc: A special wireless network application mode. A group of computers connect to a wireless network card to connect to each other and share resources without accessing Point. The Ad-Hoc structure is a peer-to-peer network structure that eliminates the need for Wireless AP construction. As long as the computers with wireless NICs installed can achieve wireless interconnection with each other; the principle is that a computer host in the network establishes a point-to-point connection, which is equivalent to a virtual AP, and other computers can directly use this point-to-point connection for network interconnection and sharing. In the establishment of a home wireless LAN, I think everyone knows that the simplest thing is to implement wireless interconnection between two computers with wireless NICs. One computer can share bandwidth when connected to the Internet.
Configure in command line
Configure wireless network card
# Vi/etc/sysconfig/network-scripts/ifcfg-wlan0
DEVICE = wlan0
BOOTPROTO = static
BROADCAST = 192.168.0.255
HWADDR = 00: 23: 4E: D9: B5: 50
IPADDR = 192.168.1.11
NETMASK = 255.255.255.0
NETWORK = 192.168.1.0
ONBOOT = no
MODE = Ad-hoc
ESSID = adhoc
CHANNEL = 3
Save and restart the network server
#/Etc/init. d/network restart
Configure iptables
# Iptables-F
# Iptables-P INPUT ACCEPT
# Iptables-P FORWARD ACCEPT
# Iptables-t nat-a postrouting-o etho-j MASQUERADE
Configure ip Forwarding
# Vi/etc/sysctl. conf
Net. ipv4.ip _ forward = 1
[Root @ czmmiao ~] # Sysctl-p
Net. ipv4.ip _ forward = 1
Run the iwconfig command to view the wireless Nic status:
[Root @ czmmiao ~] # Iwconfig wlan0
Wlan0 IEEE 802.11bg ESSID: "CMCC"
Mode: Managed Frequency: 2.412 GHz Access Point: Not-Associated
Tx-Power = 20 dBm
Retry long limit: 7 RTS thr: off Fragment thr: off
Encryption key: off
Power Management: off
After everything is done, other computers can directly connect to the wireless network card of the computer to share the internet.
It should be noted that it is best to set the key for ad-hoc access, which improves security. The command is as follows (the password is 1234567890 ):
# Iwconfig wlan0 key restricted1234567890
Configure in Gui
Click system> preference> network connection> wireless tab> edit or add
Set "wireless" as shown in Figure
"Wireless security" settings are as follows:
"IPv4 Settings" such
Click application. The iptables and ip Forwarding settings are the same as above.
Now all the settings under Fedora are complete. In win7, you only need to connect to the wireless network created by fedora, modify the ip address so that it is in the same network segment as Fedora, and set the gateway to the ip address of Fedora, dns is the same as fedora
Dns is available # Cat/etc/resolv. conf Check that the local machine is 192.168.0.1
In this example, win7: ip 192.169.1.111/24 gateway 192.168.1.1 dns 192.168.0.1