Resolved: DHCP/ routing / ADSL - UK
Well I didn't get any responses but I fixed it myself anyway
/etc/network/interfaces
auto eth0
iface eth0 inet dhcp
hostname weeble
up /etc/routes
/etc/routes
#!/bin/sh
route add -host `pump -i eth0 -s|grep Gateway|tail -c 13` eth0
route add -net 0.0.0.0 netmask 0.0.0.0 gw `pump -i eth0 -s|grep
Gateway|tail -c 13`
Seems to do the trick nicely! There is 1 flaw.... The ip my isp give me
as the gateway has currently always been xxx.xx.xx.xx in length.... Any
more or less and this will not work.... How many gateways can they have
though?
Hope this helps someone else with the same problem, or prompts someone
to show me a better way of doing it.
-----Original Message-----
From: James Ireson [mailto:jireson@weeble.oooarrr.cx]
Sent: 06 May 2002 18:16
To: debian-user@lists.debian.org
Subject: DHCP/ routing / ADSL - UK
I've got an interesting problem....
I'm using my sparc to perform NAT and some hosting.... Just switched
over to ADSL with an ethernet router.... I get one static IP which my
router is using DHCP spoofing to pass through to the first host that
requests an address via DHCP.
Fine:
/etc/network/interfaces
auto eth0
iface eth0 inet dhcp
hostname weeble
Low and behold it gets my address:
eth0 Link encap:Ethernet HWaddr 08:00:20:1A:88:5A
inet addr:62.49.19.57 Bcast:62.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MTU:1500 Metric:1
RX packets:5812071 errors:46 dropped:0 overruns:0 frame:68
TX packets:5830722 errors:7 dropped:0 overruns:0 carrier:7
collisions:25272 txqueuelen:100
RX bytes:2076940822 (1980.7 Mb) TX bytes:2100168289 (2002.8
Mb)
Interrupt:5 Base address:0x1400
No gateway gets set though. Not a problem thought I.. I'll just manually
add a static entry... I'll ask pump what it is: Device eth0
IP: 62.49.19.57
Netmask: 255.0.0.0
Broadcast: 62.255.255.255
Network: 62.0.0.0
Boot server 10.0.0.138
Next server 0.0.0.0
Gateway: 217.32.64.72
Domain: oooarrr.cx
Nameservers: 10.0.0.138
Renewal time: Mon May 6 00:02:49 2002
Expiration time: Mon May 6 00:04:04 2002
Strange, the gateway's not on my subnet... Oh well:
Route add -host 217.32.64.72 eth0
Route add -net 0.0.0.0 netmask 0.0.0.0 gw 219.32.64.72
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
217.32.64.72 0.0.0.0 255.255.255.255 UH 0 0 0
eth0
192.168.128.0 0.0.0.0 255.255.255.0 U 0 0 0
eth0
62.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0
eth0
0.0.0.0 217.32.64.72 0.0.0.0 UG 0 0 0
eth0
All works fine.... Until that is I unplug my ADSL router to move it and
then reconnect it all.
After some investigation is seems my gateway is now 217.32.64.74! My ISP
are giving me a different gateway each time I connect.... I have a
static IP and a dynamic gateway!
Now, my question (if you haven't already worked it out is.....) What's
the best way of getting the gateway address by dhcp adding the route so
my machines knows where it is (not on the same subnet) and then add a
default route using it?
Thanks in advance!!!
Ps.
Something else perplexing (but doesn't matter):
traceroute to www.yahoo.akadns.net (64.58.76.222), 30 hops max, 38 byte
packets 1 10.0.0.138 (10.0.0.138) 2.580 ms 2.230 ms 2.061 ms 2
217.32.64.1 (217.32.64.1) 13.614 ms 13.126 ms 11.687 ms 3
217.32.64.34 (217.32.64.34) 13.805 ms 13.660 ms 13.473 ms 4
217.32.64.110 (217.32.64.110) 13.461 ms 14.254 ms 13.506 ms 5
anchor-adsl.router.demon.net (212.240.162.126) 15.359 ms 14.944 ms
4.756 ms
The gateway doesn't even show in a traceroute!
--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact
listmaster@lists.debian.org
--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: