gabrielkrnl Δημοσ. 28 Δεκεμβρίου 2003 Δημοσ. 28 Δεκεμβρίου 2003 antimetopizoume ena mikro problima, to akoloutho: exoume sundesei ena adsl modem (oxi to adsl router), sthn eth0 (me ip 192.168.254.254 netmask: 255.255.255.0), exoume mia eth1 pou sundeetai pano se ena switch pou exoun bei 2 pc's. H eth1 (exei ip 192.168.0.5 netmask 255.255.255.0), ta alla pc exoun settings (PC:1 >> 192.168.0.1 netmask 255.255.255.0, default getaway 192.168.0.5) Auto pou prospathisame einai na to esoteriko diktuo na exei share internet. Dokimasame iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to 192.168.254.254 echo 1 > /proc/sys/net/ipv4/ip_forward alla den doulepse... tpt idees? Euxaristo
Sidarta Δημοσ. 29 Δεκεμβρίου 2003 Δημοσ. 29 Δεκεμβρίου 2003 Gia bale sto pc me to modem, gateway tin ip tou modem
Maniakos Δημοσ. 29 Δεκεμβρίου 2003 Δημοσ. 29 Δεκεμβρίου 2003 to masquerading sas einai swsto. Ola ta configurations sas apo osa diavasa kai sto allo thread theoritika einai swsta. What's the catch omws.. ADSL providers ( 8eos na tous kanei stin ellada ) opws o OTE xrisimopoioun to PPPoE ( ppp Over Ethernet ). Epeidi eipes oti to adsl "modem" pou exete den einai kai router ( tote to DHCP 8a ekane tin douleia tou mia xara ) tote sigoura 8a xreiasteis PPPoE client gia Linux to opoio boreis na vreis edw. http://www.roaringpenguin.com/products/rp-pppoe/#download Please diavase prosextika oti leei , ti , pws , how , what , were , wtf , ffs etc. Exei kai RPMs opote 8a einai piece of cake. AH ! Na sigourepseis oti einai enabled to PPPoE support ston kernel sou kai oti allo leei sto requirements. Auta.
gabrielkrnl Δημοσ. 29 Δεκεμβρίου 2003 Μέλος Δημοσ. 29 Δεκεμβρίου 2003 endiaferon akougetai, ego skeftomoun mipos eftaige tpt sto /etc/resolv.conf... mia teleutaia erothsh kanoume disable ta iptables pleon, h; ta afhnoume me ta hdh prohparxonta settings
Maniakos Δημοσ. 29 Δεκεμβρίου 2003 Δημοσ. 29 Δεκεμβρίου 2003 kanta flush ola kai afou stiseis to client swsta des mipws xreiastei tipota na ginei masqueraded. Sto /etc/resolv.conf sigoura xreiazete to nameserver ( pou pernei to eth0 ). Pare kai auto to Link kai eisai mia xara afou valeis kai to PPPoE client http://en.tldp.org/HOWTO/IP-Masquerade-HOWTO/ Ama den exeis diavasei to HOWTO idi please do so : )
gabrielkrnl Δημοσ. 29 Δεκεμβρίου 2003 Μέλος Δημοσ. 29 Δεκεμβρίου 2003 loipon ta dokimasame ola... kaname install to programma, sosto to adsl-setup. ftiaksame to etc/resolv.conf sosta me nameserver ip ftiaksame sosta to etc/rc.d/rc.firewall-2.4 apo thn selida pou mas edoses, kai pali tpt sou stelno kai to file na deis oti einai ok > #!/bin/sh # # rc.firewall-2.4 FWVER=0.75 # # Initial SIMPLE IP Masquerade test for 2.4.x kernels # using IPTABLES. # echo -e "\n\nLoading simple rc.firewall version $FWVER..\n" # The location of the iptables and kernel module programs # # If your Linux distribution came with a copy of iptables, # most likely all the programs will be located in /sbin. If # you manually compiled iptables, the default location will # be in /usr/local/sbin # # ** Please use the "whereis iptables" command to figure out # ** where your copy is and change the path below to reflect # ** your setup # IPTABLES=/sbin/iptables #IPTABLES=/usr/local/sbin/iptables DEPMOD=/sbin/depmod MODPROBE=/sbin/modprobe #Setting the EXTERNAL and INTERNAL interfaces for the network # # Each IP Masquerade network needs to have at least one # external and one internal network. The external network # is where the natting will occur and the internal network # should preferably be addressed with a RFC1918 private address # scheme. # # For this example, "eth0" is external and "eth1" is internal" # # # NOTE: If this doesnt EXACTLY fit your configuration, you must # change the EXTIF or INTIF variables above. For example: # # If you are a PPPoE or analog modem user: # # EXTIF="ppp0" # # EXTIF="eth0" INTIF="eth1" echo " External Interface: $EXTIF" echo " Internal Interface: $INTIF" #====================================================================== #== No editing beyond this line is required for initial MASQ testing == echo -en " loading modules: " # Need to verify that all modules have all required dependencies # echo " - Verifying that all kernel modules are ok" $DEPMOD -a # With the new IPTABLES code, the core MASQ functionality is now either # modular or compiled into the kernel. This HOWTO shows ALL IPTABLES # options as MODULES. If your kernel is compiled correctly, there is # NO need to load the kernel modules manually. # # NOTE: The following items are listed ONLY for informational reasons. # There is no reason to manual load these modules unless your # kernel is either mis-configured or you intentionally disabled # the kernel module autoloader. # # Upon the commands of starting up IP Masq on the server, the # following kernel modules will be automatically loaded: # # NOTE: Only load the IP MASQ modules you need. All current IP MASQ # modules are shown below but are commented out from loading. # =============================================================== echo "----------------------------------------------------------------------" #Load the main body of the IPTABLES module - "iptable" # - Loaded automatically when the "iptables" command is invoked # # - Loaded manually to clean up kernel auto-loading timing issues # echo -en "ip_tables, " $MODPROBE ip_tables #Load the IPTABLES filtering module - "iptable_filter" # - Loaded automatically when filter policies are activated #Load the stateful connection tracking framework - "ip_conntrack" # # The conntrack module in itself does nothing without other specific # conntrack modules being loaded afterwards such as the "ip_conntrack_ftp" # module # # - This module is loaded automatically when MASQ functionality is # enabled # # - Loaded manually to clean up kernel auto-loading timing issues # echo -en "ip_conntrack, " $MODPROBE ip_conntrack #Load the FTP tracking mechanism for full FTP tracking # # Enabled by default -- insert a "#" on the next line to deactivate # echo -en "ip_conntrack_ftp, " $MODPROBE ip_conntrack_ftp #Load the IRC tracking mechanism for full IRC tracking # # Enabled by default -- insert a "#" on the next line to deactivate # echo -en "ip_conntrack_irc, " $MODPROBE ip_conntrack_irc #Load the general IPTABLES NAT code - "iptable_nat" # - Loaded automatically when MASQ functionality is turned on # # - Loaded manually to clean up kernel auto-loading timing issues # echo -en "iptable_nat, " $MODPROBE iptable_nat #Loads the FTP NAT functionality into the core IPTABLES code # Required to support non-PASV FTP. # # Enabled by default -- insert a "#" on the next line to deactivate # echo -en "ip_nat_ftp, " $MODPROBE ip_nat_ftp #Loads the IRC NAT functionality into the core IPTABLES code # Required to support NAT of IRC DCC requests # # Disabled by default -- remove the "#" on the next line to activate # #echo -e "ip_nat_irc" #$MODPROBE ip_nat_irc echo "----------------------------------------------------------------------" echo -e " Done loading modules.\n" #CRITICAL: Enable IP forwarding since it is disabled by default since # # Redhat Users: you may try changing the options in # /etc/sysconfig/network from: # # FORWARD_IPV4=false # to # FORWARD_IPV4=true # echo " Enabling forwarding.." echo "1" > /proc/sys/net/ipv4/ip_forward # Dynamic IP users: # # If you get your IP address dynamically from SLIP, PPP, or DHCP, # enable this following option. This enables dynamic-address hacking # which makes the life with Diald and similar programs much easier. # echo " Enabling DynamicAddr.." echo "1" > /proc/sys/net/ipv4/ip_dynaddr # Enable simple IP forwarding and Masquerading # # NOTE: In IPTABLES speak, IP Masquerading is a form of SourceNAT or SNAT. # # NOTE #2: The following is an example for an internal LAN address in the # 192.168.0.x network with a 255.255.255.0 or a "24" bit subnet mask # connecting to the Internet on external interface "eth0". This # example will MASQ internal traffic out to the Internet but not # allow non-initiated traffic into your internal network. # # # ** Please change the above network numbers, subnet mask, and your # *** Internet connection interface name to match your setup # #Clearing any previous configuration # # Unless specified, the defaults for INPUT and OUTPUT is ACCEPT # The default for FORWARD is DROP (REJECT is not a valid policy) # echo " Clearing any existing rules and setting default policy.." $IPTABLES -P INPUT ACCEPT $IPTABLES -F INPUT $IPTABLES -P OUTPUT ACCEPT $IPTABLES -F OUTPUT $IPTABLES -P FORWARD DROP $IPTABLES -F FORWARD $IPTABLES -t nat -F echo " FWD: Allow all connections OUT and only existing and related ones IN" $IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT $IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT $IPTABLES -A FORWARD -j LOG echo " Enabling SNAT (MASQUERADE) functionality on $EXTIF" $IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE echo -e "\nrc.firewall-2.4 v$FWVER done.\n"
Maniakos Δημοσ. 29 Δεκεμβρίου 2003 Δημοσ. 29 Δεκεμβρίου 2003 mia vasiki erwtisi , to Linux box, vlepei internet ? I mono ta winblows boxes den vlepoune ? Giati ama den vlepei to Linux psile den kanoume douleia etsi ! Loipon. Ama to eth0 as poume oti pernei kanonika diktyo kai to eth1 einai sundedemeno sto switch tote to eth1 prepei na exei gateway to eth0 kai kai ta windows boxes 8a pernoun diktyo apo to eth1 kai oxi apo to eth0 opote prepei na allakseis to masquarading sou se iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE echo 1 > /proc/sys/net/ipv4/ip_forward ta alla pou exeis valei den xreiazontai gia tin wra. Des prwta diktyo swsta : ) Elpizw na katalaves ti exw sto nou mou, am akaneis ena diagrama eimai sigouros oti 8a vreis pws na to ftiakseis aneta. nameserver prepei na valeis tin IP tou eth0 sto resolv.conf.
ChrisAce Δημοσ. 29 Δεκεμβρίου 2003 Δημοσ. 29 Δεκεμβρίου 2003 Internet apo to linux exoume.. To lan douleuei kanonika me sosta pings.... To mono pou den doulebei einai internet sharing. LINUX PC->adsl(ppp0)->eth0(192.168.254.254,mask 255.255.255.0) eth1(192.168.0.5,255.255.255.0,geatway 192.168.254.254) sta win pc pou einai sto lan exoun ta ekseis: WIN-PC1->ip 192.168.0.1 mask 255.255.255.0 gateway:192.168.0.5 WIN-PC2->ip 192.168.0.2 >> >> >> >> les na ofeiletai to prob sta pc me ta win?
gabrielkrnl Δημοσ. 29 Δεκεμβρίου 2003 Μέλος Δημοσ. 29 Δεκεμβρίου 2003 nomizo oti brikame ti ftaiei... apo ena win pc kanoume ping sthn eth1 douleuei ok... pali an apo ena win pc kanoume ping sthn eth0 (192.168.254.254) einai ok... an tora kanoume sto dns server tou provider den bgainei ... any ideas? thanks
Maniakos Δημοσ. 29 Δεκεμβρίου 2003 Δημοσ. 29 Δεκεμβρίου 2003 Poly pithanon. Apo tin stigmi pou to Linux box exei diktyo , to eth0 kai to eth1 einai swsta ri8mismena ta windows boxes eprepe na pernoun diktyo. Dokimaste na kanete ping apo to windows box mia IP address ( tou google px ) afou prwta setarete manual Gateway, DNS server ktl stis kartes. Kanonika 8a boreite na kanete ping IP address sto net. Ama den kanei resolv kapoio host tote einai apla la8os to DNS configuration tou windows kai prepei na to ru8misete. To masquerading to dokimasate etsi opws sas eipa? Kanta flush ola kai dose ta sto linux. Ypomoni paides! konta eiste, eimai sigouros , apla prepei na ta koitaksete ola kai na kanete ena mikro sxediagramataki poio pernei internet apo pou kai ti ksexnate na ry8misete.
gabrielkrnl Δημοσ. 29 Δεκεμβρίου 2003 Μέλος Δημοσ. 29 Δεκεμβρίου 2003 tpt niet nothing (den ksero posa oxi tha po kai se poies alles glosses) :PPPP ixxxxx pame last details na doume ... eth0 ---> ip 192.168.254.254 mask 255.255.255.0 eth1 ---> ip 192.168.0.5 mask 255.255.255.0 getaway 192.168.254.254 win pc ---> ip 192.168.0.1 mask 255.255.255.0 getaway 192.168.0.5 dns server: ??? dokimasame ola apo 192.168.0.5 me 192.168.254.254 kai to dns server tou provider to resolv.conf exei ta eksis # MADE-BY-RP-PPPOE search localdomain nameserver 62.169.194.17 nameserver 62.169.194.18 exoume dosei thn iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE echo 1 > /proc/sys/net/ipv4/ip_forward exoume apenergopoihsei pliros ta firewalls, kaname adsl-setup kai dialeksame sto firewall settings to number 2 = MASQUERADE exoume kanei kapou lathos? :PPPP /me trabaei ta malliaaaa tou
Maniakos Δημοσ. 30 Δεκεμβρίου 2003 Δημοσ. 30 Δεκεμβρίου 2003 1. Ekanes ping apo to windows mixanima se mia IP ( px tou google? ) 2. To resolv.conf katarxas svise to search localdomain. Episis oi IPs twn nameserver pou exei poion einai ? fysika kai exete kanei kapou la8os, gia na min leitourgei !!
gabrielkrnl Δημοσ. 30 Δεκεμβρίου 2003 Μέλος Δημοσ. 30 Δεκεμβρίου 2003 nameservers tis tellas.. to search localdomain kai na to sbiso se boot pali tha to kanei, kai to ping apo win machine panta katalhgei se morfh cannot resolve hostname
Προτεινόμενες αναρτήσεις
Αρχειοθετημένο
Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.