LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to share internet connection with Single LAN card shared over a switch (https://www.linuxquestions.org/questions/linux-networking-3/how-to-share-internet-connection-with-single-lan-card-shared-over-a-switch-645540/)

anupamjamatia 05-29-2008 04:24 AM

How to share internet connection with Single LAN card shared over a switch
 
Hi ,
I am really having a serious problem with my office network.Here is the details of the existing setup.My VSAT is is connected to the vsat modem .The modem is connected by CAT5 cable to a switch.Frm this switch ,14 static IP address/connections are distributed.One of those 14 connections is connected to another swith.From the second switch my Fedora 7 machine is connected.Now I want to set my fedora PC as a proxy server(which is having only one integrated intel ethernet card)and want to connect other fedora/WindowsXP PCs to the switch.
The IP settings for my fedora PC is
IP address 166.26.122.9(one of the 14 IPs provided by ISP)
Subnet mask 255.255.255.0
Default Gateway 166.26.122.1
Primary DNS 232.61.89.3
Secondary DNS 232.61.89.9

Can anyone find a solution to this problem?How can I share my internet connection with other PCs on the network without installing a second Ethernet card on my Fedora PC.Please send me a step y step solution ......
Thanking you

pinniped 05-29-2008 05:49 AM

Set up a 'virtual' ethernet device - since you only have eth0 it will look something like this in the Debian '/etc/network/interfaces' file (obviously there are differences between distros):

auto eth0
iface eth0 inet dhcp // This line will cause dhcp to run, presumably getting an IP address from your modem

iface eth0:0 inet static // static, so we can run dhcpd on this to provide other computers with an IP number
address 192.168.10.1 // a private IP address
netmask 255.255.255.0


The only questions I have are:
1. how does your modem work? Does it connect to the ISP on its own or via PPPoE and Linux?
2. won't the modem hand out multiple IPs to other devices on the switch?

A possible problem is that all machines will send a DHCP request, so the first computer to boot up will 'own' the modem connection. One way around this is to set all the other computers to a static IP - unfortunately that means that all other network configuration will also be manual. A better way is to see if your computers have the option of only sending DHCP requests to a specific address - that way they can send requests to the Linux machine but not the modem.

On Linux, you need to:
1. set up dhcpd to server addresses via eth0:0
dhcpd setup includes handing out dynamic IPs, DNS, and (optionally) gateway addresses
2. unless you have appropriate scripts in place to refresh your DNS list and change the dhcpd configuration, you will want to run BIND9 and essentially advertise yourself as the DNS.
3. set up IP Tables to route internet-bound traffic out through eth0 and to the modem.


All times are GMT -5. The time now is 06:14 AM.