March 29, 2024, 12:44:53 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: Internet Sharing - 2 NICs  (Read 5695 times)

Offline adham1sa

  • New Member
  • Posts: 2
Internet Sharing - 2 NICs
« on: December 26, 2004, 02:25:08 PM »
Hi,

I jus installed RedHat 9 and followed the instructions in Rick's post http://www.linuxsolved.com/forums/ftopic115.html in order enable NAT but it didn't work. I have 2 NICs in my server. eth0 is being used as external for the dedicated connection(Fixed IP)  that I have, and eth1 is being used as internal interface for my network. Hope someone can give me a simple configuration procedure to allow all users to access the internet through my Linux server.

Regards,

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Internet Sharing - 2 NICs
« Reply #1 on: December 27, 2004, 08:11:28 AM »
have you changed ppp0 with eth0 in the above script ?

Offline adham1sa

  • New Member
  • Posts: 2
Internet Sharing - 2 NICs
« Reply #2 on: December 27, 2004, 09:18:56 AM »
Yes I did. I changed also eth0 to eth1 in line no. 4. The following is what I exactly entered:

Code: [Select]
iptables=/sbin/iptables


iptables --flush -t nat


iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward

By the way, I came accross a web page that has basic configurations to enable Internet Sharing georgehewitt.co.uk/help/iptables.htm. I applied them and my server worked perfectly. In your post, the script file (rd.nat) is to be compiled and to be included in rc.local to be executed each time the computer is restarted.  The author of the configuration in the pre-mentioned link is doing it differently. Are there any advantages or disadvantages between you way and his? or is it just a different way of doing things?

Thank You.

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Internet Sharing - 2 NICs
« Reply #3 on: December 29, 2004, 08:10:21 AM »
btw the link you have given is not working for me..

FYI the script i have given is best for dynamic ip internet connections but works also on static one, but if it is not working then there is another option in iptables called dnat instead of masquerade.

And if you are getting your worked done then it is good.

Offline dragoncity99

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 551
Internet Sharing - 2 NICs
« Reply #4 on: December 31, 2004, 02:15:47 PM »
Maybe u should try the easy way:

1. Use shorewall to help u setup the ip forwarding and masquerading

2. Use proxy.

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Internet Sharing - 2 NICs
« Reply #5 on: January 01, 2005, 03:20:00 PM »
Or Simply install firestartor and enable routing through that :)