Jump to content
ELFORUM - Forumul electronistilor

!!!Internet Connection Sharing


Guest snap

Recommended Posts

Am si eu o intrebare.Cum se poate realiza o coneexiune de internet sharing pe linux centos 5.1 ?Se dau urmatoarele:Pc1 (linux Centos 5.1)eth0 (se realizeaza conectarea la internet)eth1 (conectare pc2)Pc2 (windows xp sp3)eth0Mentionez ca vreaus a realizez conexiunea fara router!!!!

Link to comment
  • Replies 3
  • Created
  • Last Reply

Multumesc dar am rezolvat.

Pentru toti care se chinuie sa faca asta este foarte simplu as aam reusit si eu..

 

creati un fisier numit net.fw in /etc

 

vi /etc/net.fw

in el adugati urmatoarele linii:

 

#!/bin/bash#Sets program nameprog="masq v. 1.0 beta [Scriptu nostru]"http_local_proxy="http://192.168.2.0:80"#Source functions. /etc/init.d/functionsstart() {#iptables rules flushingiptables -Fiptables -t nat -Fecho 1 >/proc/sys/net/ipv4/ip_forward#bridging rulesbrctl addbr br0brctl addif br0 eth1brctl addif br0 eth2ip link set eth1 upip link set eth2 upip link set br0 upip addr add 192.168.2.0/24 brd + dev br0ip route add default via 192.168.2.1#iptables routing rulesiptables -t nat -A POSTROUTING -o eth0 -j MASQUERADEiptables -A FORWARD -i br0 -j ACCEPT#PROXY startexport http_proxy=$http_local_proxydelegated -P80 SERVER=http CACHEDIR=/cache EXPIRE=1d CRON="0 * * * * -expire 30d" PERMIT="*:*:192.168.0.0/255.255.0.0" PERMIT="*:*:XXXXX.pcnet.ro" &}stop() {#iptables rules flushingiptables -Fiptables -t nat -Fecho 0 >/proc/sys/net/ipv4/ip_forward#bridging stoppingip link set eth1 downip link set eth2 downip link set br0 downbrctl delif br0 eth1brctl delif br0 eth2brctl delbr br0ip route del default via 192.168.2.1ip route add default via ip.in.ter.net#killing delegated and resetting http_proxy global variablekillall -9 delegatedexport http_proxy=$http_local_proxy}

Salvati

In meniul de comanda

:w!
adaugati in rc.local tot in /etc

vi /etc/rc.local
urmatoarea linie:

/etc/net.sw

Salvati

In modulul de comanda

:w!
reboot

sudo reboot

si asta e tot!!!

Link to comment

Archived

This topic is now archived and is closed to further replies.




×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.Terms of Use si Guidelines