Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
home lan box unable to escape subnet
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
macro
n00b
n00b


Joined: 20 Feb 2003
Posts: 23

PostPosted: Fri Jul 11, 2003 5:49 am    Post subject: home lan box unable to escape subnet Reply with quote

I'm on a small home network with an adsl router as my gateway on the 192.169.1.x subnet.

the router has dhcp facilities and if I dhcpcd my eth0 everything works fine (and dns entries are updated in resolv.conf)

However, when I try to manually specify an ip instead of using dhcp, I can't get out of my subnet. (I believe I also had this problem on initial setup, and I believe that when I specified the credentials using the net-setup prog everything worked fine).

This is using dhcp from the router
Code:

root@frodo / # ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:04:5A:56:1B:67 
          inet addr:192.168.1.200  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3807 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2568 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:4976998 (4.7 Mb)  TX bytes:239838 (234.2 Kb)
          Interrupt:10 Base address:0xd400


now if I take it down and manually config...

Code:

root@frodo / # ifconfig eth0 0.0.0.0
root@frodo / # ifconfig eth0 192.168.1.50 broadcast 192.168.1.255 netmask 255.255.255.0
root@frodo / # ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:04:5A:56:1B:67 
          inet addr:192.168.1.50  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3807 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2568 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:4976998 (4.7 Mb)  TX bytes:239838 (234.2 Kb)
          Interrupt:10 Base address:0xd400

root@frodo / # ping www.google.com
ping: unknown host www.google.com
root@frodo / # ping 192.168.1.201
PING 192.168.1.201 (192.168.1.201) 56(84) bytes of data.
64 bytes from 192.168.1.201: icmp_seq=1 ttl=64 time=0.363 ms

--- 192.168.1.201 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.363/0.363/0.363/0.000 ms

root@frodo / # arp
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.1.201            ether   00:10:A4:7B:29:A8   C                     eth0
root@frodo / # cat /etc/resolv.conf
nameserver 207.203.159.252
nameserver 205.152.0.5
root@frodo / # ping 207.203.159.252
connect: Network is unreachable
root@frodo / #



I also tried 192.168.1.1 as the b-cast (for fun?) which is the ip of the router.
what gives?
Back to top
View user's profile Send private message
ben
Apprentice
Apprentice


Joined: 10 Jun 2002
Posts: 285
Location: Switzerland

PostPosted: Fri Jul 11, 2003 6:05 am    Post subject: home lan box unable to escape subnet Reply with quote

Hi,

When you setup your network card manuallz you must take care of at least 3 things:
1.- IP address + subnet mask
2.- /etc/resolv.conf
3.- Routing table

I thing the third one is missing by you. with netstat -nr you can see a list of route that you have. And with route add a.b.c.d(destination address) netmask e.f.g.h gw 192.168.1.1(gateway address) you should be able to add the missing route. for example( i am not near a linux box so this is from memory)

route add 0.0.0.0 netmask 0.0.0.0 gw 192.168.1.201 or
route add default gw 192.168.1.201 should be enough to let you out of your home net.

Ben
Back to top
View user's profile Send private message
macro
n00b
n00b


Joined: 20 Feb 2003
Posts: 23

PostPosted: Fri Jul 11, 2003 6:12 am    Post subject: doh Reply with quote

ahh, it happened the way it always happens. As soon as I post, I find the answer myself and get to feel dumb, heh.

route add default gw 192.168.1.1 eth0 seemed to do the trick.

is there some way to stick this into the configuration (like /etc/conf.d/net) or should I just stick it in my local.start ?
Back to top
View user's profile Send private message
ben
Apprentice
Apprentice


Joined: 10 Jun 2002
Posts: 285
Location: Switzerland

PostPosted: Fri Jul 11, 2003 6:27 am    Post subject: doh Reply with quote

Argh, I had the right answer and you did not even read it. So I won't tell you how to put this info to have it automatically, na, na, nah :D

int /etc/conf.d/net:
at the end you have to uncomment the line which says:
gateway="eth0/192.168.1.201"

assuming your net card is eth0

This time please read it before you find the answer in /etc/conf.d/net comments

Bye
Back to top
View user's profile Send private message
macro
n00b
n00b


Joined: 20 Feb 2003
Posts: 23

PostPosted: Fri Jul 11, 2003 6:30 am    Post subject: lol Reply with quote

thanks Ben!

Just a curse I pose =) I could search the net for 2 hours trying to solve something, and once I reach out for help the answer is staring me in the face most of the time.


but again, appreciate it!
Back to top
View user's profile Send private message
ben
Apprentice
Apprentice


Joined: 10 Jun 2002
Posts: 285
Location: Switzerland

PostPosted: Fri Jul 11, 2003 8:07 am    Post subject: life experience Reply with quote

That nothing,

It's typical, did you see how talking to your wife/girlfriend about the mistery of say kernel compilation, or VPN over NAT helped greatly to solve things ? Usually just because it help you to clarifie the question, so that the answer become obvious.

Unless, of course, she actually IS a guru and HAS the answer, which sometimes happens too ;-)

Have fun

Ben
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum