Gentoo Archives: gentoo-user

From: Eduard Bachmakov <e.bachmakov@×××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Static addresses and timeouts
Date: Sun, 08 Jul 2007 16:37:56
Message-Id: 200707081832.04604.e.bachmakov@gmx.net
1 Am Sonntag, 8. Juli 2007 schrieb Dan Farrell:
2 > On Sun, 8 Jul 2007 15:08:11 +0200
3 >
4 > Eduard Bachmakov <e.bachmakov@×××.net> wrote:
5 > > I want to run a webserver on my PC. Since I am using a NAT-router for
6 > > internet connection I need the server to have the same ip everytime.
7 > > That's why I tried to use static routes.
8 >
9 > You mean the inside computer needs to get the same IP every time? Why
10 > not have the NAT-router assign it the same ip via DHCP? Most
11 > commercial routers can do so -- try putting its IP in a web browser.
12 That's what I tried at first. But my (very old) router just doesn't have such
13 stuff.
14 > > The problem is that I get timeouts for about 25-75% of the time. DHCP
15 > > works without any problems (but I get different ips). The static
16 > > address is 192.168.2.50, DHCP starts at 192.168.2.100 so there should
17 > > be no problems of two pcs having the same ip.
18 > >
19 > > Here is my /etc/conf.d/net:
20 > > > config_eth0="'192.168.2.50 netmask 255.255.255.0 broadcast
21 > > > 192.168.2.255'" routes_eth0="'default via 192.168.2.1'"
22 > > > fallback_config_eth0="'dhcp'"
23 > > >
24 > > > dns_servers="192.168.2.1"
25 > > > dhcpcd="'-t 10'"
26 > > > dns_domain="'outer_space'"
27 > >
28 > > The timeouts also happen if I use my wlan (with static routes; same
29 > > pc).
30 > >
31 > > So what went wrong?
32 >
33 > You've double-quoted all those strings in /etc/conf.d/net -- I would
34 > recommend removing one of the pairs of quotes, and adding parenthases
35 > as shown in /etc/conf.d/net.example
36
37 The double quotation is the new style as described in the net.example (at
38 least at baselayout 2.0.0_alpha3). Quote:
39
40 # VARIABLES
41 #
42 # We've changed from using arrays to evaluated strings.
43 # This has the benefit of being slightly more readable but more importantly it
44 # works across all shells.
45 # OLD
46 # config_eth0=( "192.168.0.24 netmask 255.255.255.0" "192.168.0.25/24" )
47 # NEW
48 # config_eth0="'192.168.0.24 netmask 255.255.255.0' 192.168.0.25/24"
49 # INVALID
50 # config_eth0='192.168.0.24 netmask 255.255.255.0'
51 #
52 # As the 1st value has spaces in it, it needs additional quoting. The 2nd
53 # value has no spaces, therefore no additional quoting is required.
54 # The last statement is invalid because when it is evaluated, it only has one
55 # set of quotes.
56 --
57 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Static addresses and timeouts Dan Farrell <dan@×××××××××.cx>