I have an ubuntu server, which automatically connects to a wireless network on startup. This is achieved through /etc/network/interfaces
:
auto lo
iface lo inet loopback
auto wlan0
iface wlan0 inet dhcp
pre-up wpa_supplicant [...]
post-down sudo killall [...]
However, I would like the machine to act also as a dhcp server when somebody plugs in a cable. I installed dhcp3-server
, and then configured /etc/network/interfaces
by adding:
auto eth0
iface eth0 inet static
address 10.0.0.1
netmask 255.255.255.0
network 10.0.0.0/25
gateway 10.0.0.1
However, Internet is now unreachable, as the machine tries (me thinks) to connect through eth0 rather than wlan0.
How do I configure a machine to have both wireless internet access, and acting as a wired dhcp server?
EDIT: attached requested output.
ifconfig -a
eth0 Link encap:Ethernet HWaddr [...]
inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.255.255.0
UP BROADCAST 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:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:17
lo Link encap:Local Loopback
[...]
wlan0 Link encap:Ethernet HWaddr [...]
inet addr:10.7.0.213 Bcast:10.7.255.255 Mask:255.255.0.0
inet6 addr: fe80::21c:bfff:fe36:cea7/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1368 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:267437 (267.4 KB) TX bytes:9606 (9.6 KB)
rounte -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.1 0.0.0.0 UG 100 0 0 eth0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.7.0.0 0.0.0.0 255.255.0.0 U 0 0 0 wlan0
ifconfig -a
androute -n
it will hel us UNDERSTAND THE PROBLEM;