• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: plug wireless on same subnet as router  (Read 1579 times)
bad_gui
Jr. Member
**

Karma: 0
Posts: 50


View Profile
« on: July 15, 2013, 07:39:21 PM »

I'm not sure of the terminology to describe what I am trying to achieve.

My ISP router/wireless serves 192.168.1.X addresses.  The plug is connected by ethernet
and gets 192.168.1.4 from the ISP router.

I had the plug wireless AP on a different subnet 192.168.0.X in the back of the house and
could connect to it without problems.

Problem is that I want the whole house on one wireless subnet (using two APs).  I saw some
posts on the web that this is possible.  Some posts suggest dnsmasq can do it alone while
others suggest bridge-utils.

I changed dnsmasq.conf so the DHCP server line is commented out.  The plug gets its own
IP address from the ISP router but I can't figure out how to have it forward connections to
the 192.168.1.X domain.

How do clients connect to the plug and then get an IP address from the ISP router?

An alternative is to have the ISP router give addresses 192.168.1.2 to 125 and then the plug
give addresses 192.168.1.126 to 254 ?   Will this work?
Logged

odoll
Full Member
***

Karma: 0
Posts: 148


View Profile
« Reply #1 on: July 16, 2013, 08:01:02 AM »

You have to bridge between your plug's eth and wlan interface.

e.g. see examples here http://forum.doozan.com/read.php?2,6300 or https://agentoss.wordpress.com/2011/10/31/creating-a-wireless-access-point-with-debian-linux/
Logged

bad_gui
Jr. Member
**

Karma: 0
Posts: 50


View Profile
« Reply #2 on: July 22, 2013, 06:02:24 PM »

Thanks.  I followed the examples and got the bridge to work.  It
gives IP addresses from the ISP router.  The ISP router is set to
always give 192.168.1.4 to the plug. 

The problem is that now I am unable to connect to the plug  with
ssh and the web server is offline.  Can I have both a bridge and
connect directly to the plug?  I don't understand the bridge
configuration and the examples aren't clear about whether you
can still connect to the device.

I am running a proxy server so I also have a tun device.

# ifconfig -a
Code:
br0       Link encap:Ethernet  HWaddr 
          inet addr:192.168.1.4  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::224:23ff:fe1f:9d89/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1339215 errors:0 dropped:0 overruns:0 frame:0
          TX packets:138609 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:238459127 (227.4 MiB)  TX bytes:146677427 (139.8 MiB)

eth0      Link encap:Ethernet  HWaddr   
          inet addr:192.168.1.4  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1436484 errors:0 dropped:0 overruns:0 frame:0
          TX packets:183052 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:349696534 (333.4 MiB)  TX bytes:151629941 (144.6 MiB)
          Interrupt:11

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:159568 errors:0 dropped:0 overruns:0 frame:0
          TX packets:159568 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2746164823 (2.5 GiB)  TX bytes:2746164823 (2.5 GiB)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 
          inet addr:192.168.10.1  P-t-P:192.168.10.2  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

uap0      Link encap:Ethernet  HWaddr
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:28457 errors:0 dropped:0 overruns:0 frame:0
          TX packets:94060 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4190933 (3.9 MiB)  TX bytes:74426611 (70.9 MiB)



# cat /etc/network/interfaces
Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp

#The wireless interface
auto uap0
iface uap0 inet static
        pre-up modprobe uap8xxx
        post-up /etc/network/guruplug-wl-conf.sh start
        post-down /etc/network/guruplug-wl-conf.sh stop
        address 0.0.0.0

auto br0
iface br0 inet static
        address 192.168.1.4


# iptables -L
Code:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Logged

odoll
Full Member
***

Karma: 0
Posts: 148


View Profile
« Reply #3 on: July 26, 2013, 07:26:24 AM »

Why did you give your eth0 and br0 interface the same IP address?

Shouldn't the /etc/network/interfaces config look like

Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

auto lo br0
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet manual

allow-hotplug uap0
iface uap0 inet manual


# Bridge setup

# for dhcp address
#iface br0 inet dhcp
# bridge_ports eth0 uap0

# for static ip
iface br0 inet static
bridge_ports eth0 uap0
# adapt with your network settings
address 192.168.1.4
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
Logged

bad_gui
Jr. Member
**

Karma: 0
Posts: 50


View Profile
« Reply #4 on: July 29, 2013, 07:22:32 PM »

Ahh.  Thank you.  Now I have got the plug visible on the network and giving addresses in the correct subnet.

The only unusual thing is this message repeated many times in syslog

Code:
[125193.455174] br0: port 1(uap0) entering forwarding state
[125193.460527] br0: port 1(uap0) entering forwarding state
[125208.484424] br0: port 1(uap0) entering forwarding state
[125229.386907] br0: port 1(uap0) entering forwarding state
[170338.708237] br0: port 1(uap0) entering forwarding state
[170338.713591] br0: port 1(uap0) entering forwarding state
[170353.724426] br0: port 1(uap0) entering forwarding state
[171183.794291] br0: port 1(uap0) entering forwarding state

I searched the web and there are many different causes of this error but nothing seemed relevant to my circumstances.

Here is the latest version of /etc/network/interfaces
Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo br0
iface lo inet loopback

# The primary network interface
auto eth0
allow-hotplug eth0
iface eth0 inet manual

#The wireless interface
auto uap0
iface uap0 inet manual
        pre-up modprobe uap8xxx
        post-up /etc/network/guruplug-wl-conf.sh start
        post-down /etc/network/guruplug-wl-conf.sh stop
#        address 0.0.0.0

#auto br0
iface br0 inet static
        address 192.168.1.4
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
        bridge_ports uap0 eth0

#For some reason, uap0 does not end up in the bridge.
#Force it.
        up /sbin/brctl addif br0 uap0


Here are the relevant sections of /etc/dnsmasq.conf

Code:
# If you want dnsmasq to listen for DHCP and DNS requests only on
# specified interfaces (and the loopback) give the name of the
# interface (eg eth0) here.
# Repeat the line for more than one interface.
interface=uap0

# On systems which support it, dnsmasq binds the wildcard address,
# even when it is listening on only some interfaces. It then discards
# requests that it shouldn't reply to. This has the advantage of
# working even when interfaces come and go and change address. If you
# want dnsmasq to really bind only the interfaces it is listening on,
# uncomment this option. About the only time you may need this is when
# running another nameserver on the same machine.
#bind-interfaces
bind-interfaces br0

I don't know much about the workings of networking:  is the bind interfaces br0
causing the problem?

Here are the uncommented sections of /etc/dhcp/dhclient.conf which is what gets
an ipaddress for the plug

Code:
send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
        domain-name, domain-name-servers, domain-search, host-name,
        dhcp6.name-servers, dhcp6.domain-search,
        netbios-name-servers, netbios-scope, interface-mtu,
        rfc3442-classless-static-routes, ntp-servers;

Logged

odoll
Full Member
***

Karma: 0
Posts: 148


View Profile
« Reply #5 on: July 30, 2013, 09:39:07 AM »

Hm, in the beginning you said "My ISP router/wireless serves 192.168.1.X addresses."
So why would you set up a second device (your plug) with (another) dnsmasq?
When your plug is set up as a bridge between its eth and wlan interface, your Wifi clients' DHCP requests should traverse your plug and get an IP from your ISP router, as they can see it directly on layer2?
Logged

Pages: [1]
Print
Jump to: