Gentoo Archives: gentoo-user

From: Daniel da Veiga <danieldaveiga@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Printer Sharing with Samba
Date: Thu, 09 Mar 2006 18:58:17
Message-Id: 342e1090603091042k5cf01221pbed42c99f68a627a@mail.gmail.com
In Reply to: Re: [gentoo-user] Printer Sharing with Samba by Kris Kerwin
1 Someone with more network knowledge will probably correct any bullshit
2 I'll type from now on... :)
3
4 On 3/9/06, Kris Kerwin <kkerwin@×××××××××.com> wrote:
5 > Daniel,
6 >
7 > Thanks for your quick reply.
8 >
9 > > I couldn't think of a more "complex" solution right now, but
10 > > couldn't you simply make your IP static? I've done it at work
11 > > because our DNS was failing, simply copied the network
12 > > configurations gained with DHCP and made it permanent...
13 >
14 > Question: how does one *make* a static IP? I thought that IP was
15 > assigned by DHCP? Isn't that the way that DHCP works? It leases an IP
16
17 Well, this is more of a server solution than a workstation one, you'll
18 probably turn your computer off once in a while. DHCP wil not give
19 anyone an IP that is already in use (its against TCP/IP rules), so, if
20 you have your machine running with an IP, DHCP will not lease it (at
21 least I think so because my machine never conflited).
22
23 > to a specific computer, which then gives up that lease when it's done
24 > using it. At that point, DHCP is free to re-lease that same IP to
25 > whomever else requests it, correct? If that's the case, what would
26
27 Yes, if your DHCP sends a DHCP_RELEASE command to the server, it will
28 "give up" that IP and it will be available for another computer.
29
30 > prevent another computer from accidentally obtaining that same IP?
31
32 You just never RELEASE the IP, and when it expires you LEASE it again,
33 and DHCP cache will always try to get the last IP, of course, I've
34 done it in a server running all the time, first I tried RELEASING and
35 automatic LEASING it again in TIMEOUT seconds (where timeout is the
36 LEASE time minus a few seconds, it alll depends on how big is your
37 server's lease time), I've created a script to do that, but deleted it
38 long ago. Then I decided to simply configure /etc/resolv.conf,
39 /etc/conf.d/net and /etc/hosts so I would have an static IP, and let
40 TCP/IP do the rest (not allow the DHCP server to LEASE that IP to
41 someone else). I couldn't find anywhere in the web if that SHOULD
42 work, it just does, for me.
43
44 >
45 > Otherwise, if this is a viable solution, how do I make it work? I'm
46 > comfortable editing config files, but I just don't know where to go
47 > to do it.
48 >
49
50 You ifconfig to get the IP your're using right now and the Netmask
51 used in your network environment. Then you edit the /etc/conf.d/net
52 file to configure your ethernet interface to have a static IP, using
53 the one you're already using from DHCP and set the netmask you got
54 from ifconfig, and let be your /etc/resolv.conf and /etc/hosts that
55 were written by the DHCP client.
56
57 > Thanks again, all, for your help.
58 >
59 > Kris
60 >
61 > On Wednesday 08 March 2006 20:43, Daniel da Veiga wrote:
62 > > On 3/8/06, Kris Kerwin <kkerwin@×××××××××.com> wrote:
63 > > > Hi folks!
64 > > >
65 > > > I have a quick question.
66 > > >
67 > > > I'm a college student. I share my printer with my roommate. We
68 > > > have separate computers; he uses Windows XP, and I Gentoo.
69 > > > Together, we're behind our school's router which dynamically
70 > > > assigns us both IP's.
71 > > >
72 > > > Currently, in order to share our printer, we simply unplug it
73 > > > from one another's computers. However, we would like to be able
74 > > > to share it over the network instead to make life easier for the
75 > > > both of us. However, there are a few problems that I'm
76 > > > foreseeing.
77 > > >
78 > > > First off, I have a laptop with only one ethernet port, so
79 > > > setting up an ad hoc network between us is out of the question.
80 > > > Also, my school has a "one port - one computer" rule that
81 > > > prohibits routers.
82 > > >
83 > > > Second, since we're both behind a DHCPd server, we both have
84 > > > dynamic IPs. There's no easy way to point his computer to the
85 > > > right server if it has a dynamic IP.
86 > > >
87 > > > Third, since we're both behind a router, using something like
88 > > > DynDNS to provide a static contact despite the dynamic IP won't
89 > > > work either.
90 > > >
91 > > > So, I guess what I'm wondering is if there's any way to make this
92 > > > work, or if I'm SOL?
93 > > >
94 > > > Thank you much for your help.
95 > > >
96 > > > Kris Kerwin
97 > > > --
98 > > > gentoo-user@g.o mailing list
99 > >
100 > > I couldn't think of a more "complex" solution right now, but
101 > > couldn't you simply make your IP static? I've done it at work
102 > > because our DNS was failing, simply copied the network
103 > > configurations gained with DHCP and made it permanent...
104 > >
105 > > --
106 > > Daniel da Veiga
107 > > Computer Operator - RS - Brazil
108 > > -----BEGIN GEEK CODE BLOCK-----
109 > > Version: 3.1
110 > > GCM/IT/P/O d-? s:- a? C++$ UBLA++ P+ L++ E--- W+++$ N o+ K- w O M-
111 > > V- PS PE Y PGP- t+ 5 X+++ R+* tv b+ DI+++ D+ G+ e h+ r+ y++
112 > > ------END GEEK CODE BLOCK------
113 >
114
115
116 --
117 Daniel da Veiga
118 Computer Operator - RS - Brazil
119 -----BEGIN GEEK CODE BLOCK-----
120 Version: 3.1
121 GCM/IT/P/O d-? s:- a? C++$ UBLA++ P+ L++ E--- W+++$ N o+ K- w O M- V-
122 PS PE Y PGP- t+ 5 X+++ R+* tv b+ DI+++ D+ G+ e h+ r+ y++
123 ------END GEEK CODE BLOCK------
124
125 --
126 gentoo-user@g.o mailing list