Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problem with network,
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
eigenman
n00b
n00b


Joined: 13 Jul 2005
Posts: 58
Location: California

PostPosted: Wed Jan 24, 2007 1:42 am    Post subject: Problem with network, Reply with quote

Hi, I'm very confused about the network situation on my computer. I have a Linksys BEF11WS4 router, and two computers are connected through normal ethernet cable to this router. I want to assign static IP to these computers. My older computer, which is running ubuntu was set up a long time ago, and it seems to be working fine. For my new computer, which has gentoo installed, I followed the gentoo howto.
Here is my /etc/conf.d/net file
Code:

# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /etc/conf.d/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).

dns_domain_lo="klsy"

config_eth0=( "192.168.0.50 netmask 255.255.255.0" )
routes_eth0=( "default gw 192.168.0.1" )


I've also created a soft link net.eth0, and put it in /etc/init.d/net.eth0.
I can run /etc/init.d/net.eth0, and it runs the correct commands. If on the prompt I run
ifconfig eth0, I get the correct values:
Code:

eth0      Link encap:Ethernet  HWaddr 00:14:85:BE:E4:EF 
          inet addr:192.168.0.50  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::214:85ff:febe:e4ef/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:38428 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24373 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:49457046 (47.1 Mb)  TX bytes:3715943 (3.5 Mb)
          Interrupt:177


However, when I run route, it waits a long time before it prints the correct values:
Code:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
loopback        *               255.0.0.0       U     0      0        0 lo
default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0

However, I don't have access to anything outside of my local internet. For example, I can't surf the web, however I can ssh into my other computer at this point.
I've found a workaround for now, which is to run
Code:

/etc/init.d/net.eth0 start
dhcpcd eth0
dhcpcd -k eth0
ifconfig eth0 192.168.0.50
route add default gw 192.168.0.1

Somhow letting dhcpcd setup the internet, everything works, and afterthat I can just change the ip address myself, and everything will work fine. Needless to say, this is probably the wrong solution. I'm guessing that there is something I need to setup which I'm not doing, but dhcpcd does. Does anybody have an idea what that is? The other possibility is that my router is just plain broken, but I don't like that idea.

Any help is appreciated,
eigenman
Back to top
View user's profile Send private message
didymos
Advocate
Advocate


Joined: 10 Oct 2005
Posts: 4798
Location: California

PostPosted: Wed Jan 24, 2007 2:05 am    Post subject: Reply with quote

Did you set up nameservers in resolv.conf? That's probably being set automatically with dhcp, which is why it works.
_________________
Thomas S. Howard
Back to top
View user's profile Send private message
eigenman
n00b
n00b


Joined: 13 Jul 2005
Posts: 58
Location: California

PostPosted: Thu Jan 25, 2007 1:50 am    Post subject: Reply with quote

bingo! That is the problem. Thanks. However, I just realized that net-scripts overwrites my /etc/resolve.conf because of my
dns_domain_lo comment. Here is my resolve.conf:
Code:

# Generated by net-scripts for interface lo
domain klsy


I've added my nameserver to /etc/resolve.conf, and commented my dns_domain_lo in my /etc/conf.d/net. Is there another way I can resolve this? I followed the instructions from the
installation wiki
article. Should I make an edit to warn people about this issue?

Cheers,
eigenman
Back to top
View user's profile Send private message
didymos
Advocate
Advocate


Joined: 10 Oct 2005
Posts: 4798
Location: California

PostPosted: Fri Jan 26, 2007 12:32 am    Post subject: Reply with quote

I've never bothered using /etc/conf.d/net to set the DNS domain. Unless you have some special requirements, setting it in resolv.conf is the simplest solution. If you prefer to keep that in /etc/conf.d/net, just use this variable in there to set nameservers:
Code:

dns_servers_eth0="nameserver1 nameserver2"


You may want to set a more "normal" looking domain name. There really aren't good private top-level domains set aside like there are private IP address blocks, but some are used quite commonly. For example, I use "localnet.lan", so maybe you'd want something like "klsy.lan".
_________________
Thomas S. Howard
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