LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Linux Answers > Networking
User Name
Password

Notices


By erklaerbaer at 2007-04-27 16:53
This was only tested with Slackware, but should work on almost every other distribution and even for Windows.

Assume this is your setup:
A --> B --> Internet

You want to connect A to the internet, B is already connected.

Run this
Code:
  if [ -f /proc/sys/net/ipv4/ip_forward ]; then
    echo "Activating IPv4 packet forwarding."
    echo 1 > /proc/sys/net/ipv4/ip_forward
  fi
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
on B as root and this
Code:
route add default gw $(ipadresse of B)
on A.

Done. Isn't it great?

You could setup a DHCP daemon on B to automate some things, but there are other HOWTOs for that.

by teluguswan on Sat, 2009-12-05 22:49
Very nice easy and shortcut

why dont you provide the example


by placing the values of A, B and ipaddress


that will be more helpfull to understand


  



All times are GMT -5. The time now is 04:26 AM.

Main Menu
Advertisement
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