Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
sharing insternet connection
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
OneNut
n00b
n00b


Joined: 28 Sep 2003
Posts: 4
Location: Gatineau

PostPosted: Sun Sep 28, 2003 7:41 pm    Post subject: sharing insternet connection Reply with quote

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 :D
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
View user's profile Send private message
Lozzer
Tux's lil' helper
Tux's lil' helper


Joined: 18 Sep 2003
Posts: 84
Location: England

PostPosted: Sun Sep 28, 2003 9:23 pm    Post subject: Tips Reply with quote

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
View user's profile Send private message
OneNut
n00b
n00b


Joined: 28 Sep 2003
Posts: 4
Location: Gatineau

PostPosted: Mon Sep 29, 2003 2:54 am    Post subject: thank you Reply with quote

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
:oops:
Back to top
View user's profile Send private message
FormerSlacker
Guru
Guru


Joined: 11 Mar 2003
Posts: 340
Location: Toronto, ON. Canada

PostPosted: Mon Sep 29, 2003 4:46 am    Post subject: Reply with quote

In addition to setting up the ethernet cards, you'll need to set up your server for NAT.

Check out the Linux IP Masquerade HOWTO as it has all the information you'll need, and then some.

If you really want to skip ahead to the important stuff, and assuming you are using a 2.4 based kernel, read this for configuring the kernel and this to setup the forwarding rules. Thats the meat and potates of it.

After you have iptables going, you'll probably want to configure the clients and forward some ports as well.
Back to top
View user's profile Send private message
Lozzer
Tux's lil' helper
Tux's lil' helper


Joined: 18 Sep 2003
Posts: 84
Location: England

PostPosted: Mon Sep 29, 2003 8:28 am    Post subject: Apologies Reply with quote

Apologies for that oversight. Maybe that will teach me to post late at night.
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