This ones a bit long but I think it'll best to follow the ideas behind all this.
Found a solution that worked also this is on debian. It's just about to give every host its own route.
Here are the infos after boot with just one nic iped.
Code:
debian:/home/asdf# ifconfig
eth0 Link encap:Ethernet HWaddr 00:04:76:8d:5a:04
inet addr:10.200.10.20 Bcast:0.0.0.0 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:69 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2198 (2.1 KiB) TX bytes:12081 (11.7 KiB)
Interrupt:10 Base address:0xaf00
eth1 Link encap:Ethernet HWaddr 00:04:76:d1:45:38
inet6 addr: fe80::204:76ff:fed1:4538/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7 errors:0 dropped:0 overruns:0 frame:0
TX packets:51 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1042 (1.0 KiB) TX bytes:8676 (8.4 KiB)
Interrupt:5 Base address:0x8f80
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:28 errors:0 dropped:0 overruns:0 frame:0
TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1952 (1.9 KiB) TX bytes:1952 (1.9 KiB)
debian:/home/asdf# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.200.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
can we ping 10.200.10.6?
Code:
debian:/home/asdf# ping 10.200.10.6 -c 2
PING 10.200.10.6 (10.200.10.6) 56(84) bytes of data.
64 bytes from 10.200.10.6: icmp_seq=1 ttl=64 time=4.10 ms
64 bytes from 10.200.10.6: icmp_seq=2 ttl=64 time=0.139 ms
--- 10.200.10.6 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1003ms
rtt min/avg/max/mdev = 0.139/2.123/4.107/1.984 ms
yes we can. now get the connection to the world
Code:
debian:/home/asdf# dhclient eth1
Internet Systems Consortium DHCP Client V3.1.1
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
Listening on LPF/eth1/00:04:76:d1:45:38
Sending on LPF/eth1/00:04:76:d1:45:38
Sending on Socket/fallback
DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 3
DHCPOFFER from 10.200.10.1
DHCPREQUEST on eth1 to 255.255.255.255 port 67
DHCPACK from 10.200.10.1
bound to 10.200.10.227 -- renewal in 1630 seconds.
debian:/home/asdf# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.200.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.200.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
0.0.0.0 10.200.10.1 0.0.0.0 UG 0 0 0 eth1
see if we still can ping 10.200.10.6
Code:
debian:/home/asdf# ping 10.200.10.6 -c 2
PING 10.200.10.6 (10.200.10.6) 56(84) bytes of data.
64 bytes from 10.200.10.6: icmp_seq=1 ttl=64 time=3.02 ms
64 bytes from 10.200.10.6: icmp_seq=2 ttl=64 time=0.143 ms
--- 10.200.10.6 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1006ms
rtt min/avg/max/mdev = 0.143/1.585/3.027/1.442 ms
yes. this is diffrent from your setup. You could not ping it.
see if i can ping the world
Code:
debian:/home/asdf# dig ard.de
^C
debian:/home/asdf# cat /etc/resolv.conf
nameserver 10.200.10.1
debian:/home/asdf# ping ard.de
^C
doh. no go. so we don't need the route to the lan over eth1. but we need the route to our gateway 10.200.10.1
Code:
debian:/home/asdf# route del -net 10.200.10.0/24 dev eth1
debian:/home/asdf# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.200.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 10.200.10.1 0.0.0.0 UG 0 0 0 eth1
debian:/home/asdf# route add -host 10.200.10.1 dev eth1
debian:/home/asdf# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.200.10.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth1
10.200.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 10.200.10.1 0.0.0.0 UG 0 0 0 eth1
See if we can get the wan
Code:
debian:/home/asdf# dig ard.de
; <<>> DiG 9.5.1-P1 <<>> ard.de
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64259
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;ard.de. IN A
;; ANSWER SECTION:
ard.de. 3438 IN A 217.66.32.21
;; Query time: 55 msec
;; SERVER: 10.200.10.1#53(10.200.10.1)
;; WHEN: Sat Sep 5 13:25:31 2009
;; MSG SIZE rcvd: 40
Jup DNS works. So the rest should also.
okay we have the wan, see if it remains when we kill the lan net
Code:
debian:/home/asdf# route del -net 10.200.10.0/24 dev eth0
debian:/home/asdf# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.200.10.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth1
0.0.0.0 10.200.10.1 0.0.0.0 UG 0 0 0 eth1
debian:/home/asdf# dig ard.de
; <<>> DiG 9.5.1-P1 <<>> ard.de
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56625
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;ard.de. IN A
;; ANSWER SECTION:
ard.de. 3145 IN A 217.66.32.21
jup it does. now get our 10.200.10.6 host back
Code:
debian:/home/asdf# route add -host 10.200.10.6 dev eth0
debian:/home/asdf# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.200.10.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth1
10.200.10.6 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
0.0.0.0 10.200.10.1 0.0.0.0 UG 0 0 0 eth1
debian:/home/asdf# ping 10.200.10.6
PING 10.200.10.6 (10.200.10.6) 56(84) bytes of data.
64 bytes from 10.200.10.6: icmp_seq=1 ttl=64 time=2.36 ms
^C
--- 10.200.10.6 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.363/2.363/2.363/0.000 ms
All set and all working. getting 10.200.10.6 and the web. Okay the rest of the 10.200.10.0/24 net is gone but who cares
This is a route -n that also worked.
Code:
debian:/home/asdf# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.200.10.6 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
10.200.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
0.0.0.0 10.200.10.1 0.0.0.0 UG 0 0 0 eth1
If you came that far your through
. So I see thats possible to do it but to what availe this is to ubuntu I donnu. The thing I would advise would be.
1.) Kill all routes beside the default route (route del -net 192.168.1.0/24 dev eth0 repeat for eth1)
2.) Add route to 192.168.1.6 (route add -host 192.168.1.6/32 dev eth0)
3.) Add route to 192.168.1.0 (route add -net 192.168.1.0/24 dev eth1)
4.) pray
Maybe I'll find time to setup an ubuntu 6 machine. Thats all I could get. 5 is outdated.
Cheers Zhjim