View previous topic :: View next topic |
Author |
Message |
OneNut n00b
Joined: 28 Sep 2003 Posts: 4 Location: Gatineau
|
Posted: Sun Sep 28, 2003 7:41 pm Post subject: sharing insternet connection |
|
|
well, i finaly managed to install gentoo, it took me a while but i got it, it sure was fun to install it, so much fun that i think i will try to re-install it... ummm, maybe not
ok, i have 2 ethernet cards in my pc, d-link and macronix, and i would like to share my connection with a second pc i have, i'm just not sure how to go about that, i think it's something i probably have to edit in /etc/conf.d/net but i'm not sure how to configure it for 2 ethernet cards
please help
thanks everyone |
|
Back to top |
|
|
Lozzer Tux's lil' helper
Joined: 18 Sep 2003 Posts: 84 Location: England
|
Posted: Sun Sep 28, 2003 9:23 pm Post subject: Tips |
|
|
You need to do a number of things. I'm going to assume eth0 is connected to the Internet, and eth1 is connected to your internal network. I'll also asume a that the second PC has a static configuration, you can look up dhcp if you want it to get its details automatically. You need an ip subnet for your internal network. 192.168.0.* is a good choice, as this range of addresses is reserved for private networks. For clarity, lets say that eth0 has an address of 1.2.3.4. The required configuration is
PC1: /etc/conf.d/net
Code: |
iface_eth0="1.2.3.4 broadcast 1.255.255.255 netmask 255.0.0.0" (Just use what you already have)
iface_eth1="192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0"
gateway="eth0/1.2.0.1" (use what you already have)
|
To get eth1 to start automatically you'll need to also run
Code: |
ln -s /etc/init.d/net.eth0 /etc/init.d/net.eth1
|
For PC2, you'll need a config like so (if this isn't running Gentoo, these settings will probably be elsewhere)
/etc/conf.d/net
Code: |
iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmasek 255.255.255.0"
gateway="eth0/192.168.0.1"
|
You will also need to set something up to allow DNS queries to work. The easiest thing to do is to copy /etc/resolv.conf from PC1 to PC2. |
|
Back to top |
|
|
OneNut n00b
Joined: 28 Sep 2003 Posts: 4 Location: Gatineau
|
Posted: Mon Sep 29, 2003 2:54 am Post subject: thank you |
|
|
thanks for responding Lozzer
i tryed what you just sayed, and it didn't work for me
i am running gentoo with 2 nic cards and my second pc is running mandrake 9.1
my first ethernet card is for the internet connection and i have it pluged directly into my cable modem, and my second ethernet card is pluged into a hub,and the second pc is also linked to the hub, not sure what i'm doing wrong, would you be able to post a full example from your /etc/conf.d/net , i think i may have totaly messed that up
thanks again
|
|
Back to top |
|
|
FormerSlacker Guru
Joined: 11 Mar 2003 Posts: 340 Location: Toronto, ON. Canada
|
|
Back to top |
|
|
Lozzer Tux's lil' helper
Joined: 18 Sep 2003 Posts: 84 Location: England
|
Posted: Mon Sep 29, 2003 8:28 am Post subject: Apologies |
|
|
Apologies for that oversight. Maybe that will teach me to post late at night. |
|
Back to top |
|
|
|
|
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
|
|