I'm trying to configure my wireless network to use gateway 10.0.1.252 when accessing IP addresses that start with 10.0.0.
I followed a few explanations on how to do it with the interfaces file but without success.
This is the content of my initial /etc/network/interfaces file:
auto lo
iface lo inet loopback
After several hours searching and reading I made it look like this:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth1
iface eth1 inet static
address 10.0.1.171
netmask 255.255.255.0
broadcast 10.0.1.255
gateway 10.0.1.254
# static route
up route add -net 10.0.0.0/24 gw 10.0.1.252 dev eth1
Mentioned configuration works after I restart networking and until I restart Ubuntu. After I restart Ubuntu, I lose network manager and cannot connect to Internet or intended addresses 10.0.0.x.
What am I doing wrong, or is there a simpler way of setting a permanent route in newer versions of Ubuntu?
Just to mention I'm configuring wireless connection, because I do not use wired one.
UPDATE 1: (~$ ifconfig)
eth0 Link encap:Ethernet HWaddr 00:24:81:64:9a:5c
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
eth1 Link encap:Ethernet HWaddr 00:21:00:d8:25:45
inet addr:10.0.1.171 Bcast:10.0.1.255 Mask:255.255.255.0
inet6 addr: fe80::221:ff:fed8:2545/64 Scope:Link
UP BROADCAST RUNNING 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
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:284 errors:0 dropped:0 overruns:0 frame:0
TX packets:284 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:21280 (21.2 KB) TX bytes:21280 (21.2 KB)
UPDATE 2: (~$ route -n)
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 10.0.1.252 255.255.255.0 UG 0 0 0 eth1
10.0.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth1
0.0.0.0 10.0.1.254 0.0.0.0 UG 100 0 0 eth1
UPDATE 3: I realised that there is a problem with this code:
iface eth1 inet static
address 10.0.1.171
netmask 255.255.255.0
broadcast 10.0.1.255
gateway 10.0.1.254
If I comment it out I get network manager and Internet access, but not my desired route.

/etc/network/interfaceslooks right to me. What do the commandsifconfigandroute -nshow when the network isn't working? – Gilles Nov 9 '10 at 21:30/var/log/daemon.log, do any lines concerningNetworkManagerappear on a boot that leaves you with a non-working network? – Gilles Nov 9 '10 at 21:39eth1in/etc/network/interfaces, NetworkManager takes over the interface. What could help is in fact the output fromifconfigandroute -nwhen you boot with the/etc/network/interfacesin your original question and do not get any internet connection. Note that Network Manager and ifupdown (invoked when you “restart networking”) are two different components; ifupdown is the one that executes the instructions in/etc/network/interfaces, while Network Manager only reads it to prevent itself from taking over if you've set things up for ifupdown. – Gilles Nov 10 '10 at 18:23