WiFi热点无法在接口中使用LAN和wifi配置 [英] WiFi Hotspot is not working with LAN and wifi configuration in interfaces

查看:121
本文介绍了WiFi热点无法在接口中使用LAN和wifi配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Edimax WiFi Dongle设置了Wifi热点。热点工作没有eth0配置。



I have setup a Wifi Hotspot using Edimax WiFi Dongle. The Hotspot is working without the eth0 configuration.

auto lo
    iface lo inet loopback
    #wireless
    auto wlan0
    iface wlan0 inet static
    address 192.168.9.1
    netmask 255.255.255.0
    #end wireless





我可以连接到SSID并ping到192.168.9.1。它运作良好。我在不使用WiFi热点时使用静态LAN电缆连接。所以我将配置更改为





I can connect to SSID and ping to 192.168.9.1. Its working well. I am using Static LAN cable connection when not using the WiFi hotspot.So I changed my configuration to

auto lo
iface lo inet loopback

#wired
auto eth0
iface eth0 inet static
address 192.168.9.104
netmask 255.255.255.0
gateway 0.0.0.0
#end wired

#wireless
auto wlan0
iface wlan0 inet static
address 192.168.9.1
netmask 255.255.255.0
#end wireless





现在我的热点无效。如何将LAN和热点保留在配置中。



以下是我在系统中完成的列表配置我的dhcpd.cof包含





Now my hotspot is not working. How I can keep the LAN and hotspot in the configuration.

Following is the list configuration I done in my system My dhcpd.cof contain

   #
# Sample configuration file for ISC dhcpd for Debian
#
#

# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;

# option definitions common to all supported networks...
option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;

default-lease-time 600;
max-lease-time 7200;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;

# No service will be given on this subnet, but declaring it helps the 
# DHCP server to understand the network topology.

#subnet 10.152.187.0 netmask 255.255.255.0 {
#}

# This is a very basic subnet declaration.

#subnet 192.168.9.1 netmask 255.255.255.0 {
#  range 192.168.9.201 192.168.9.250;
#  option routers 192.168.9.104;
 # option broadcast-address 192.168.9.255;
#}


subnet 192.168.9.0 netmask 255.255.255.0 {
  range 192.168.9.100 192.168.9.200; 
  option domain-name "MyWifi";
}

# A slightly different configuration for an internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 {
#  range 10.5.5.26 10.5.5.30;
#  option domain-name-servers ns1.internal.example.org;
#  option domain-name "internal.example.org";
#  option routers 10.5.5.1;
#  option broadcast-address 10.5.5.31;
#  default-lease-time 600;
#  max-lease-time 7200;
#}

# Hosts which require special configuration options can be listed in
# host statements.   If no address is specified, the address will be
# allocated dynamically (if possible), but the host-specific information
# will still come from the host declaration.

#host passacaglia {
#  hardware ethernet 0:0:c0:5d:bd:95;
#  filename "vmunix.passacaglia";
#  server-name "toccata.fugue.com";
#}

# Fixed IP addresses can also be specified for hosts.   These addresses
# should not also be listed as being available for dynamic assignment.
# Hosts for which fixed IP addresses have been specified can boot using
# BOOTP or DHCP.   Hosts for which no fixed address is specified can only
# be booted with DHCP, unless there is an address range on the subnet
# to which a BOOTP client is connected which has the dynamic-bootp flag
# set.
#host fantasia {
#  hardware ethernet 08:00:07:26:c0:a5;
#  fixed-address fantasia.fugue.com;
#}

# You can declare a class of clients and then do address allocation
# based on that.   The example below shows a case where all clients
# in a certain class get addresses on the 10.17.224/24 subnet, and all
# other clients get addresses on the 10.0.29/24 subnet.

#class "foo" {
#  match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
#}

#shared-network 224-29 {
#  subnet 10.17.224.0 netmask 255.255.255.0 {
#    option routers rtr-224.example.org;
#  }
#  subnet 10.0.29.0 netmask 255.255.255.0 {
#    option routers rtr-29.example.org;
#  }
#  pool {
#    allow members of "foo";
#    range 10.17.224.10 10.17.224.250;
#  }
#  pool {
#    deny members of "foo";
#    range 10.0.29.10 10.0.29.230;
#  }
#}





hostapd
包含





hostapd
contain

# Defaults for hostapd initscript
#
# See /usr/share/doc/hostapd/README.Debian for information about alternative
# methods of managing hostapd.
#
# Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
# file and hostapd will be started during system boot. An example configuration
# file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
#
DAEMON_CONF="/etc/hostapd/hostapd.conf"

# Additional daemon options to be appended to hostapd command:-
#   -d   show more debug messages (-dd for even more)
#   -K   include key data in debug messages
#   -t   include timestamps in some debug messages
#
# Note that -B (daemon mode) and -P (pidfile) options are automatically
# configured by the init.d script and must not be added to DAEMON_OPTS.
#
#DAEMON_OPTS=""





hostapd.conf 包含





hostapd.conf contains

interface=wlan0
driver=rtl871xdrv
bridge=br0
ssid=MyWifi 4600/1500
channel=1
wmm_enabled=0
wpa=1
wpa_passphrase=secretpass
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
auth_algs=1
macaddr_acl=0 

推荐答案

我冒昧地猜测问题的关键是您在同一子网上有两个主机地址。例如,如果你从这台机器上ping了192.168.9.5,你会使用什么接口? ....它的路径是模棱两可的...简单的解决方法是将您的一个网络重新配置为完全不同的网络地址。当然,你不能只是改变你的计算机来改变整个网络地址,你必须确保你的路由器知道你想要的配置。

I've venture to guess the crux of your problem is that you have two host addresses on the same subnet. If for example, you pinged 192.168.9.5 from this machine, what interface would you use? ....it's path is ambiguous... The easy fix would be to reconfigure one of your networks to a completely different network address. Of course, you can't just change your computer to change the entire network address, you'd have to make sure your router knows your desired configuration.
# wired
auto eth0
iface eth0 inet static
address 192.168.9.104 #Why not change this net to 192.168.10.x?
netmask 255.255.255.0
gateway 0.0.0.0
# end wired
 
# wireless
auto wlan0
iface wlan0 inet static
address 192.168.9.1
netmask 255.255.255.0
# end wireless


这篇关于WiFi热点无法在接口中使用LAN和wifi配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆