Discussion Locked

internet connection sharing

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

hello
any body help me that how i can share internet connection on linux 7.2 ,pl. give me step by step
configuration.

2 replies

by linuxrich2000

Quick and dirty with IPTABLES rules:

You need to have "r00t access.

1) edit the file:
/etc/sysctl.config
add a 1 to the ip_forward like so:

net/ipv4/ip_forward = 1

save and close file.

2) at the prompt type:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Then at the prompt again type:

/etc/init.d/iptables save
or
service iptables save

Restart the network services, like so:

/etc/init.d/network restart
or
service network restart

All this is done on the firewall machine.

The eth0 is the network interface pointing to the Internet not your local network

This will let all pc on the local net to get online and the main pc will masquerade the internal IP address to look like the request is comming from the firewall pc.

Hope this helps.

This discussion is closed to new replies.