1

I want to configure My Raspberry Pi the same way.

  1. I have a USB Modem (D-LINK 3G MiFi) which connect to Internet via 3G and shows a eth1 in Raspberry Pi and works perfectly to provide internet
  2. I want to connect my LAN device (old pc) to eth0
  3. I want to connect my WiFi devices to wlan0
  4. I am able to connect my eth0 device to internet and able to configure wlan0 as HOSTAPD mode.

I want to share same Netwrok to eth0 and wlan0 I want to access internet for devices connected on eth0 and wlan0

How shall i configure wlan0 as it shall be on same network to communicate between devices and to internet.

1

Software packages you need: bridge-utils, isc-dhcp-server, bind9, hostapd

/etc/network/interfaces

auto eth0
iface eth0 inet manual

auto wlan0
iface wlan0 inet manual
    post-up service hostapd start

auto br0
iface br0 inet static
    address 10.22.0.1
    gateway 255.255.255.192
    bridge_ports eth0 wlan0
    post-up service isc-dhcp-server start

auto eth1
iface eth1 inet dhcp
    post-up iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

/etc/dhcp/dhcpd.conf (isc-dhcp-server)

option domain-name-servers 10.22.0.1, 8.8.8.8, 8.8.4.4;
authoritative;
subnet 10.22.0.0 netmask 255.255.255.192
{
    range 10.22.0.32 10.22.0.62;
    option routers 10.22.0.1;
}

/etc/default/isc-dhcp-server (isc-dhcp-server)

INTERFACES="br0"

/etc/sysctl.conf

net.ipv4.ip_forward=1
net.ipv4.ip_dynaddr=1

I have a similar configuration, with a Raspberry Pi functioning as a residential wireless router, dialing up using PPPoE over EPON to my ISP.

3
  • Hi,It shows unknown options dhcp.dns-servers option dns-servers 192.
    – For Guru
    Dec 24 '14 at 6:03
  • @ForGuru I typed this answer out of the back of my head so it may have errors. Fixed in the edit. Dec 24 '14 at 10:37
  • 1
    Try to describe what those configs mean and do to help the OP understand and customize them. Dec 28 '14 at 17:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.