LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-06-2005, 09:41 AM   #1
thaque
LQ Newbie
 
Registered: May 2001
Posts: 10

Rep: Reputation: 0
Fedora-3 and Internet sharing


i recently installed red hat fedora-3 on my 733MHz dual CPU machine with two network cards. Internet works fine with eth0; eth1 is for local netwrok with a win2000 system. I like to set up Fedora 3 so that i can get access to internet from my win200 machine. I believe it's called IP Masquarading? is there any other way? if so, would anyone tell me the steps or lead to a website.
please, note that, the last time i tried to set up IP Masquarading on a Linux 7.3 following a book i bought, it completely ruined my IPTABLES file and i had to reinstall the OS.
I use Konqueror, for now, on fedora, and internet explorer on win2000 as browser.
any help will be appreciated. thanks.
TH
 
Old 03-06-2005, 12:15 PM   #2
pave
Member
 
Registered: Oct 2004
Posts: 42

Rep: Reputation: 16
Yes it's masquerading or SNAT that you need.

1. create a file that will be your script, let's say /root/nat
2. ensure that ip forwarding is on

echo 1 > /proc/sys/net/ipv4/ip_forward

3. clean all rules

iptables --flush
iptables --delete-chain

4. Now you have a choice:

masquerade will work even if your external IP changes, SNAT will not. Unless you do advanced linux routing, that is not the issue here, masquerade is enough. So for masquerade type:

iptables -t nat -a postrouting -s [LAN_NETWORK_ADDRESS/LAN_NETWORK_MASK] -j MASQUERADE
for example:
iptables -t nat - a postrouting -s 192.168.0.0/24 -j MASQUERADE

5. type at the end of the file /etc/rc.d/rc.local this line:
/root/nat

it will make you masqerade work after reboot
-------------------------

5. Set up your interfaces on the router

/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
BROADCAST=[WAN_BROADCAST_ADDRESS]
IPADDR=[WAN_IP_ADDRESS]
NETMASK=[WAN_NETWORK_MASK]
NETWORK=[WAN_NETWORK_ADDRESS]
ONBOOT=yes

/etc/sysconfig/network-scripts/ifcfg-eth1 (the local one)
DEVICE=eth1
BOOTPROTO=static
BROADCAST=[LAN_BROADCAST_ADDRESS]
IPADDR=[LAN_IP_ADDRESS]
NETMASK=[LAN_NETWORK_MASK]
NETWORK=[LAN_NETWORK_ADDRESS]
ONBOOT=yes

for example:
DEVICE=eth1
BOOTPROTO=static
BROADCAST=192.168.12.255
IPADDR=192.168.0.1
NETMASK=255.255.255.255
NETWORK=192.168.1.0
ONBOOT=yes

--------------
6. set up gateway:

/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=your.host.name
GATEWAY=[WAN_GATEWAY_ADDRESS]

----------
7. reboot
 
Old 03-07-2005, 12:15 PM   #3
thaque
LQ Newbie
 
Registered: May 2001
Posts: 10

Original Poster
Rep: Reputation: 0
thanks pave. that's a lot of work. lol. i'll try it out as soon as i can.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet Connection Sharing - Windows XP Home to Fedora 2 Covenent Linux - Networking 12 11-05-2006 06:57 PM
How do I set up Internet Connection Sharing on fedora core 1? milkrock Linux - Networking 7 01-29-2006 04:52 AM
Sharing Internet Connection Windows <- Linux (Fedora Core 3) e6x Linux - General 7 08-03-2005 12:58 PM
Internet sharing problems w/fedora core 2 bregan Linux - Wireless Networking 0 09-30-2004 06:38 PM
sharing internet connection between Fedora host and Win98 VMware guest NGShake Linux - Software 2 12-20-2003 12:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration