Hi,
Before I start, here is my network diagram:
Code:
____________ 192.168.2.1 ____________
[Workstations]<============== wifi ================>[Modem/Router]
| | ___________ | /w DHCP |
| | [ Server ] | disabled |
[____________]<=====> eth0|<= dhcpd =>|wlan0 <=====>[____________]
192.168.1.1| |192.168.2.254
[___________]
The modem/router (on the right) is providing internet and wifi access to the network and due to it's location (which isn't changing) it can only be accessed via wifi.
The server (in the middle) is connected to modem/router (wlan0) and is currently acting as a DHCP server for all devices connected directly to the modem/router or the server's ethernet port (eth0) but on separate subnets.
I tried to do this with one subnet but that didn't seam to be such a good idea.
Eventually, I want the server to perform a number of different tasks including acting as a file server for everyone and PXE boot server for anything connected to the ethernet port. I would also like everyone to be able to be able to communicate with each other as well as the server regardless of their connection (via the modem/router (wifi) or direct to the server via ethernet).
This brings me to my first problem...
With my current setup I can ping 192.168.1.1 and 192.168.2.254 from my laptop connected to eth0 (via a crossover cable) but I cannot ping 192.168.2.1 (the modem/router).
I have ip forwarding enabled (via rc.ip_forward) and dhcpd is providing ip addresses for both subnets.
How can I route traffic destined for the internet (and/or other machines connected to the modem/router) from a machine connected to the ethernet port on the server?
Here is my config:
ifconfig:
Code:
eth0 Link encap:Ethernet HWaddr **:**:**:**:**:**
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::201:2eff:fe27:aea3/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:113 errors:0 dropped:0 overruns:0 frame:0
TX packets:66 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10396 (10.1 KiB) TX bytes:7317 (7.1 KiB)
Interrupt:21
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:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:304 (304.0 B) TX bytes:304 (304.0 B)
wlan0 Link encap:Ethernet HWaddr **:**:**:**:**:**
inet addr:192.168.2.254 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::224:23ff:fe09:1458/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1115 errors:0 dropped:0 overruns:0 frame:0
TX packets:1085 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:88500 (86.4 KiB) TX bytes:99574 (97.2 KiB)
route -n:
Code:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.2.1 0.0.0.0 UG 1 0 0 wlan0
/etc/rc.d/rc.inet1.conf:
Code:
# /etc/rc.d/rc.inet1.conf
#
# This file contains the configuration settings for network interfaces.
# If USE_DHCP[interface] is set to "yes", this overrides any other settings.
# If you don't have an interface, leave the settings null ("").
# You can configure network interfaces other than eth0,eth1... by setting
# IFNAME[interface] to the interface's name. If IFNAME[interface] is unset
# or empty, it is assumed you're configuring eth<interface>.
# Several other parameters are available, the end of this file contains a
# comprehensive set of examples.
# =============================================================================
# Default gateway IP address:
GATEWAY="192.168.2.1"
# Config information for wlan0:
IFNAME[0]="wlan0"
IPADDR[0]="192.168.2.254"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]="no"
WLAN_ESSID[0]=********
WLAN_MODE[0]=Managed
WLAN_RATE[0]="54M auto"
WLAN_WPA[0]="wpa_supplicant"
WLAN_WPADRIVER[0]="wext"
# Config information for eth0:
IFNAME[1]="eth0"
IPADDR[1]="192.168.1.1"
NETMASK[1]="255.255.255.0"
USE_DHCP[1]="no"
/etc/dhcpd.conf:
Code:
# dhcpd.conf
#
# Configuration file for ISC dhcpd (see 'man dhcpd.conf')
#
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;
ddns-update-style none;
# Default lease is 1 week (604800 sec.)
default-lease-time 604800;
# Max lease is 4 weeks (2419200 sec.)
max-lease-time 2419200;
#From Ethernet
subnet 192.168.1.0 netmask 255.255.255.0 {
option broadcast-address 192.168.1.255;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.1.1;
option routers 192.168.1.1;
range 192.168.1.2 192.168.1.100;
# Allow bootp requests
allow bootp;
# Point to the TFTP server:
next-server 192.168.1.1;
range dynamic-bootp 192.168.1.101 192.168.1.150;
if substring (option vendor-class-identifier, 0, 9) = "PXEClient" {
filename "/slackware-13.1/pxelinux.0";
}
}
# To Router
subnet 192.168.2.0 netmask 255.255.255.0 {
option broadcast-address 192.168.2.255;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.2.1;
option routers 192.168.2.1;
range 192.168.2.2 192.168.2.100;
}