LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   sharing Internet connection with more than one client (https://www.linuxquestions.org/questions/linux-networking-3/sharing-internet-connection-with-more-than-one-client-700958/)

perham 01-30-2009 01:13 AM

sharing Internet connection with more than one client
 
I have an ubuntu 7.10 ICS server that works fine and I have routed my traffic using firestarter to my windows PC. my server's IP is 192.168.0.1 and my windows client is 192.168.0.2. now, I have bought another PC and I want to assign 192.168.0.3 to it and connect it to ubuntu server. in windows, all I needed to do was to connect the first client to first network card, second one to second network card, bridge two connections in my server, assign 192.168.0.1 to the network bridge in my server and 192.168.0.2 and 192.168.0.3 to my clients, then share my internet connection. I also could access shared files in any computer from all of them. can I have the same functionality with a linux server?

I'll make a list to make it easy if you don't wanna read the whole post:

things I want:

1. assign one ip address to multiple interfaces in linux, making them bonded.

2. sharing the internet connection with both clients.

3. ability to use all shared files over a network.

any help is appreciated, thanks in advance. :)

rossonieri#1 01-30-2009 03:50 AM

hi,

Quote:

things I want:

1. assign one ip address to multiple interfaces in linux, making them bonded.
sure, use the brctl bridge utility.
create the bridge eg. br0 - and put the NICs as its member.
#brctl --help will help you a lot better.

Quote:

2. sharing the internet connection with both clients.
you mean like in bridge as above bridging? i dont think so - its a switch/hub and it cant route. but if you use linux as a router (using 2 or more NICs) sure, either using iptables -t nat -j MASQUERADE, or use the -j SNAT.

Quote:

3. ability to use all shared files over a network.
sure - you can use samba for compatibility with windows networking, or you can use native unix/linux NFS.

HTH.

perham 01-30-2009 05:19 AM

Quote:

Originally Posted by rossonieri#1 (Post 3426114)
hi,



sure, use the brctl bridge utility.
create the bridge eg. br0 - and put the NICs as its member.
#brctl --help will help you a lot better.



you mean like in bridge as above bridging? i dont think so - its a switch/hub and it cant route. but if you use linux as a router (using 2 or more NICs) sure, either using iptables -t nat -j MASQUERADE, or use the -j SNAT.



sure - you can use samba for compatibility with windows networking, or you can use native unix/linux NFS.

HTH.

thanks for the reply, I'm gonna go after that brctl tool. I've used samba and firestarter to do 3 and 2 with one client connected to the server. I guess once I can make the bridge functional, I can figure out to do 2 and 3 again. thanks for helping :cool:

perham 01-31-2009 02:21 AM

Quote:

Originally Posted by perham (Post 3426154)
thanks for the reply, I'm gonna go after that brctl tool. I've used samba and firestarter to do 3 and 2 with one client connected to the server. I guess once I can make the bridge functional, I can figure out to do 2 and 3 again. thanks for helping :cool:

I made it work quite easily. first I created a bridge with brctl:

# brctl addbr br0
# brctl addif br0 eth2
# brctl addif br0 eth3

then in firestarter's preferences, this is how I set it:

http://img34.picoodle.com/img/img34/...1m_232560f.jpg

(img code is off for me, please browse the link)

that's my setting in the network applet:

http://img02.picoodle.com/img/img02/...2m_3379c56.jpg

and everything is done! now I have Internet connectivity on both of my windows PCs.

rossonieri#1 02-01-2009 09:57 AM

hi perham,
Quote:

and everything is done! now I have Internet connectivity on both of my windows PCs.
congratulations then, well done. :)
but - if you need to connect more than 2 computers - i'd suggest you to consider buying a small switch wont hurt :)


All times are GMT -5. The time now is 12:16 AM.