How can share internet connection from linux to windows?

LRH

Member
Jan 2, 2003
27
0
0
I have two ethernet cards on my linux and one on my windows!
I have done the Lan Networking but i have problem how to share internet connection!
[without router]
 

Poontos

Platinum Member
Mar 9, 2000
2,799
0
0
Since you do not have a dedicated router, one of the two PC's has to become the "router". Preferrably with two NIC's.

Ideally, it will be running an implementation of NAT, compatible WAN protocol (PPPoE, MPoA, PPP, etc.) depending on your type of internet connection.

Depending on which one your choose, off the top of my head, your Linux distro should have a how-to on their website on how to setup NAT.

Need a bit more details... Linux distro, Windows OS, hub or switch?, strictly TCP/IP, need MS file sharing as well?, etc.
 

BML

Senior member
Jun 1, 2001
443
0
0
Tell us what distro of linux your are running. RedHat, Mandrake ?
What problems are you having? You need to be more specific when
tying to get help.
If your running 2000 or Xp you can use ICS witch is easy to set up but not what i would use.
In linux you can IP Masquerade, but Ill tell you right now if you dont wanna read then you
are gonna have some problems.
If you have 50$ go buy a Cable Dsl router and solve all your problems.
 

LRH

Member
Jan 2, 2003
27
0
0
I am running RedHat 8.0 and Win2K Professional
I have adsl modem on Redhat eth0[connected]
and wirth eth1 i have a lan network with my win2k and i want to share the internet connection to my windows!
 

Fuzznuts

Senior member
Nov 7, 2002
449
0
0
put this is script and call it from rc.local make sure you have disabled ipchains on start up and that you have enable iptables.

echo "1" > /proc/sys/net/ipv4/ip_forward
iptables --flush
iptables -t nat --flush
iptables -t nat -A POSTROUTING -o OUT INTERFACE -j MASQUERADE


now for this to work you will need to add you out going interface if its eth0 then put eth0 in place of out interface.

Also you will need a 2nd nic in the linux. set the windows boxes default gateway as the ip of this card NOT the eth0 ip address. as i said for this to all work automatically you need to out it in a script ie turn-on-nat.sh and thr call it from rc.local or youll have to enter it all manually each time you reboot. hope thsi helps if it dont then post back.
 

LRH

Member
Jan 2, 2003
27
0
0
That who u tell i have done it before but i havent set the scrpt who u tell on rc.local
i need to set on eth1[Redhat] a gateway?
Linux: eth0 [adsl modem]
eth1 [lan network with win2k]
 

Fuzznuts

Senior member
Nov 7, 2002
449
0
0
no you need to put the ip of eth1 as the default gateway on your windows machines you will also need to specify the dns servers use the ips given to you by your isp.

to have it start automatically like i said place it in a script say in /etc/firewall.sh then edit your /etc/rc.local file and put in it

sh /etc/firewall.sh

you may have to chmod u+x your firewall.sh script to make it executeable.

hope this makes snese mleem know if you need anymore help
 

Fuzznuts

Senior member
Nov 7, 2002
449
0
0
disable ip chains ip chains and ip tbales will not work together its either one or the the other. check your sys init levels to make sure that ipchains is not starting and iptables is. because it does owrk that is the same script that i use on every linux box i set up admittedly its only been around 20 or so but it works for them all.

i suggest you check you sys inits then reboot if you sure that iptables is the only running firewall.

also check that that 1 is being echoed into the /proc/sys/net/ipv4_ipforward file.
 

Fuzznuts

Senior member
Nov 7, 2002
449
0
0
/etc/init.d/ipchains stop

then

/etc/init.d/iptables start

then run your firewall script
 

Garion

Platinum Member
Apr 23, 2001
2,328
6
81
Have you thought about going out and picking up a SOHO router? You can get 'em for $30ish, on sale (check the hot deals forumn) and they are worth every penny, especially when you've got multiple machines on your network. In networking, there's one fundemental philosophy that you shoudl always follow - Keep it simple. Using your Linux box as a router is definitely NOT simple for most of us. Chances are something won't work right or you might end up with some huge security problems.

- G
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |