Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Hi
i'm using RHEL5 linux ,
i have a broadband connection on window but now i want use this on linux
and i want to share this internet connection with MS Window and linux Opreating system.....
so plz, tell me procedure of configuration a internet connection for local PC and sharing it..
on window and linux...
your post is little bit unclear whether you are asking about physical connection of each PCs or network configuration
network configuration for linux (this is static ip configuration method)
#vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=172.16.8.154
NETMASK=255.255.0.0
GATEWAY=172.16.100.25
#vi /etc/resolv.conf
nameserver 172.16.121.50
nameserver 172.16.121.60
change ips according to your network
#service network restart ;after modify the ips restart the network services
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.16.100.25 0.0.0.0 UG 0 0 0 eth0
makesure your default gateway
#ping yahoo.com
64 bytes from w2.rc.vip.re4.yahoo.com (206.190.60.37): icmp_seq=1 ttl=49 time=309 ms
64 bytes from w2.rc.vip.re4.yahoo.com (206.190.60.37): icmp_seq=2 ttl=49 time=309 ms
if this ping replay that means you have sucessfully configured network
if your broadband router enabled dhcp service(most of the routers having dhcp service) ,it will supply ip for your pcs
the I suppose your linux-box has 2 network interfaces
eth0 - provider IP netmask gateway and name server
eth1- 192.168.0.1 255.255.255.0
default gateway is that from your provider
enable ip_forward in /etc/sysctl.conf or echo "1" > /proc/sys/net/ipv4/ip_forward
in iptables enable masquerade
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
on client
IP 192.168.0.7 netmask 255.255.255.0 gateway 192.168.0.1 nameserver provider
test conectivity from client to linux-box (ping 192.168.0.1)
test conectivity from client to provider gateway(ping provider gateway)
Last edited by ddaemonunics; 03-12-2009 at 05:33 AM.
hello, am trying to do a similart setup but there is somethings that am not doing right and it ain't working
ISP---->box1------>box2
box1 runs debian etch and has the following setup
eth0 is connected to box2 (ip 192.168.0.1)
eth1 is connected to the internet (DHCP) (internet works fine, but i can't ping box2 neither can box2 ping box1)
here are the results of
1- route
Kernel IP routing table
Destination------Gateway---------Genmask---------Flags-Metric-Ref---Use Iface
192.168.0.0------0.0.0.0--------255.255.255.0----U-----0------0-------0-eth0
147.102.132.0---0.0.0.0---------255.255.252.0----U-----0------0-------0-eth1
0.0.0.0--------147.102.132.200--0.0.0.0----------UG----0------0-------0-eth1
-------------------------------------------------------------------------------
2- ping -c 2 192.168.0.2
PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data.
From 192.168.0.1 icmp_seq=1 Destination Host Unreachable
From 192.168.0.1 icmp_seq=2 Destination Host Unreachable
# Always accept loopback traffic
iptables -A INPUT -i lo -j ACCEPT
# Allow established connections, and those not coming from the outside
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -m state --state NEW -i ! eth1 -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allow outgoing connections from the LAN side.
iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.