Gateway

10 bejegyzés megtekintése - 1-10 / 17
  • Szerző
    Bejegyzés
  • #2067122
    goraki
    Felhasználó
      #2067123
      FLINX
      Felhasználó

        A /proc/sys/net/ipv4/ip_forward ban már szerepelt az 1 es.

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

        Ez volt az ami még hiányzott. Hozzáadtam a /etc/rc.d/rc.local -hoz.

        #2067124
        Mike65
        Felhasználó

          én ugyanebben a cipőben járok mint FLINX.
          eth0-n van a net
          eth1-en(192.168.0.2) van a másik  gép(192.168.0.3/255.255.255.0/dns név/és 192.168.0.2 az átjáró)
          pppoe default standalone tűzfalát használom, rc.ip_forvard be van kapcsolva(azaz futtatható), az
          iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
          sort én is hozzáadtam az rc.local-hoz, de nincs eredmény
          itt a tűzfal keverhet be?

          #2067125
          aty
          Felhasználó

            Ha eth0n van a net, akkor ide: „iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE” miért eth1-et írsz? Ha meg adsl akkor inkább ppp0t kell írni eth1 helyett.

            #2067126
            Mike65
            Felhasználó

              őő bocs igazából eth0-t írtam csak lentről másoltam oda, amúgy ppp0-val sem megy

              #2067127
              aty
              Felhasználó

                Akkor „iptables -L” és „iptables -t nat -L”, „ifconfig”, „cat /proc/sys/net/ipv4/ip_forward” kimeneteket másold ide légyszíves. Ha dsl akkor mindenképp ppp0 legyen megjelölve.

                #2067128
                lada2105
                Felhasználó

                  Ha egy slackiröl osztod a netet, akkor:
                  rc.modules végén csak ki kell szedni a megfeleö sorokat a commentböl és máris osztja a netet.
                  pontosan az alábbiakat:
                  #  EXTERNAL=eth0 – ide természetesen a tiédet írd, ami neked jó
                  #  INTERNAL=eth1 – ide szintén
                  #  echo 1 > /proc/sys/net/ipv4/ip_forward
                  #  iptables -t nat -A POSTROUTING -o $EXTERNAL -j MASQUERADE

                  ha nem megy, akkor máshol keresd a hibát.
                  Pl:
                  ha a linux tud névval is és ipvel is netezni, akkor a kliensek el tudják-e érni névvel vagy IP-vel a szerver gépet ami náluk az átjáró?
                  El tudják-e ipvel érni a szolgáltatód dns szervereit pingetve?
                  Ezeket a kérdéseket derítsd fel, aztán bökd ide a választ.
                  Ezekután szerintem okosabbak leszünk, meg jobban tudunk következtetni.

                  #2067129
                  Mike65
                  Felhasználó

                    nos zenvalkban, ezek a sorok az rc.modules-ben nincsenek benne, de lehet hogy én vagyok vak, pedig többször átnéztem, ha kézzel hozzáadom akkor az nem jó, a másik gépről pedig annyit tudok elmondani, hogy tudom pingetni az ftp serverére tudok csatlakozni, de nem tudom megnézni hogy ő mit tud pingetni, csak azt látom ha van net, mert akkor azonnal elindul a programjában az rrs csatorna, ugyanis ez egy xbox

                    a lentebb kért adatok:

                    Code:
                    root[/]# iptables -L
                    Chain INPUT (policy ACCEPT)
                    target     prot opt source               destination         
                    LOG        udp  —  anywhere             anywhere            udp dpts:0:1023 LOG level warning
                    LOG        tcp  —  anywhere             anywhere            tcp dpts:0:1023 LOG level warning
                    DROP       udp  —  anywhere             anywhere            udp dpts:0:1023
                    DROP       tcp  —  anywhere             anywhere            tcp dpts:0:1023
                    LOG        tcp  —  anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN LOG level warning
                    DROP       tcp  —  anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN
                    DROP       icmp —  anywhere             anywhere            icmp echo-request

                    Chain FORWARD (policy DROP)
                    target     prot opt source               destination         

                    Chain OUTPUT (policy ACCEPT)
                    target     prot opt source               destination         
                    root[/]# iptables -t nat -L
                    Chain PREROUTING (policy ACCEPT)
                    target     prot opt source               destination         

                    Chain POSTROUTING (policy ACCEPT)
                    target     prot opt source               destination         
                    MASQUERADE  all  —  anywhere             anywhere           

                    Chain OUTPUT (policy ACCEPT)
                    target     prot opt source               destination         
                    root[/]# cat /proc/sys/net/ipv4/ip_forward
                    1
                    root[/]# ifconfig
                    eth0      Link encap:Ethernet  HWaddr 00:0A:CD:06:E7:7F 
                              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
                              RX packets:1413 errors:0 dropped:0 overruns:0 frame:0
                              TX packets:1317 errors:0 dropped:0 overruns:0 carrier:0
                              collisions:0 txqueuelen:1000
                              RX bytes:578795 (565.2 KiB)  TX bytes:628340 (613.6 KiB)
                              Interrupt:21 Base address:0xac00

                    eth1      Link encap:Ethernet  HWaddr 00:40:F4:D0:FE:A6 
                              inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0
                              UP BROADCAST MULTICAST  MTU:1500  Metric:1
                              RX packets:316 errors:0 dropped:0 overruns:0 frame:0
                              TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
                              collisions:0 txqueuelen:1000
                              RX bytes:95286 (93.0 KiB)  TX bytes:120 (120.0 b)
                              Interrupt:19 Base address:0xc800

                    lo        Link encap:Local Loopback 
                              inet addr:127.0.0.1  Mask:255.0.0.0
                              UP LOOPBACK RUNNING  MTU:16436  Metric:1
                              RX packets:44 errors:0 dropped:0 overruns:0 frame:0
                              TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
                              collisions:0 txqueuelen:0
                              RX bytes:5528 (5.3 KiB)  TX bytes:5528 (5.3 KiB)

                    ppp0      Link encap:Point-to-Point Protocol 
                              inet addr:82.131.224.68  P-t-P:213.163.27.38  Mask:255.255.255.255
                              UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
                              RX packets:1326 errors:0 dropped:0 overruns:0 frame:0
                              TX packets:1276 errors:0 dropped:0 overruns:0 carrier:0
                              collisions:0 txqueuelen:3
                              RX bytes:544309 (531.5 KiB)  TX bytes:597693 (583.6 KiB)

                    #2067130
                    lada2105
                    Felhasználó
                      Mike65 wrote:
                      nos zenvalkban, ezek a sorok az rc.modules-ben nincsenek benne, de lehet hogy én vagyok vak, pedig többször átnéztem, ha kézzel hozzáadom akkor az nem jó, a másik gépről pedig annyit tudok elmondani, hogy tudom pingetni az ftp serverére tudok csatlakozni, de nem tudom megnézni hogy ő mit tud pingetni, csak azt látom ha van net, mert akkor azonnal elindul a programjában az rrs csatorna, ugyanis ez egy xbox

                      Hm… érdekes ebböl kihámozni a hibajelenséget, de megpróbálok segíteni.
                      Az xbox-nak tudsz valahogy adni egy belsö IPt?
                      pl: 192.168.0.2 netmask 255.255.255.0
                      átjáró: 192.168.0.1
                      dns szerver: szolgáltatód dns szervere(i)

                      zenwalkos géped:
                      ip: 192.168.0.1
                      netmask: 255.255.255.0
                      átjáró: amit a gép beállít magának
                      névszerver: adsl vagy dhcp-s kábelnetre csatalkozáskor úgyis megkapod
                      linuxos konzolod beírod:
                      iptables -t nat -A POSTROUTING -j MASQUERADE
                      és elméletileg lennie kell netnek
                      VAGY
                      iptables -t nat -A POSTROUTING -o külsö_ethernet_kartyad -j MASQUERADE

                      ha jól emlékszem zenwalkban is benne van ez a dolog az rc.modules kb 98% körül…
                      ha meg nem, akkor ezt a scriptet futtasd le a szerveren, a már fentebb említett ip beállítások és internetre kapcsolódás után

                      Code:
                      #!/bin/sh
                      #
                      # rc.firewall-2.4
                      FWVER=0.74
                      #
                      #              Internet megosztas teszt script 
                      #

                      echo -e „nnAlapveto Internetmegosztas inditasa v. $FWVER..n”

                      # A parancsok helye
                      #
                      # ** Hasznald „whereis iptables” vagy a „which iptables”
                      # ** parancsot hogy kitalald hol is van az iptables program
                      #

                      IPTABLES=/sbin/iptables
                      DEPMOD=/sbin/depmod
                      MODPROBE=/sbin/modprobe

                      # Kulso es belso eszkozok beallitasa
                      #
                      #  Ebben a peldaban „eth0” a kulso es „eth1″ a belso
                      #
                      #  Ha ADSL-t vagy analog modemet hasznalsz akkor valoszinuleg
                      #  EXTIF=”ppp0” kell hogy legyen
                      #  hasznald az „ifconfig” parancsot
                      #
                      EXTIF=”eth0″
                      INTIF=”eth1″
                      echo ”  Kulso eszkoz:  $EXTIF”
                      echo ”  Belso eszkoz:  $INTIF”

                      #===========================================================
                      #== Ezalatt a vonal alatt mar semmit sem kell beallitanod ==

                      echo -en ”  modulok betoltese: ”

                      # Need to verify that all modules have all required dependencies
                      #
                      echo ”  – Kernel modulok vizsgalata”
                      $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
                      # Require 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 „———————————————————————-”

                      # Just to be complete, here is a list of the remaining kernel modules
                      # and their function.  Please note that several modules should be only
                      # loaded by the correct master kernel module for proper operation.
                      # ——————————————————————–
                      #
                      #    ipt_mark      – this target marks a given packet for future action.
                      #                    This automatically loads the ipt_MARK module
                      #
                      #    ipt_tcpmss    – this target allows to manipulate the TCP MSS
                      #                    option for braindead remote firewalls.
                      #                    This automatically loads the ipt_TCPMSS module
                      #
                      #    ipt_limit      – this target allows for packets to be limited to
                      #                    to many hits per sec/min/hr
                      #
                      #    ipt_multiport  – this match allows for targets within a range
                      #                    of port numbers vs. listing each port individually
                      #
                      #    ipt_state      – this match allows to catch packets with various
                      #                    IP and TCP flags set/unset
                      #
                      #    ipt_unclean    – this match allows to catch packets that have invalid
                      #                    IP/TCP flags set
                      #
                      #    iptable_filter – this module allows for packets to be DROPped,
                      #                    REJECTed, or LOGged.  This module automatically
                      #                    loads the following modules:
                      #
                      #                    ipt_LOG – this target allows for packets to be
                      #                              logged
                      #
                      #                    ipt_REJECT – this target DROPs the packet and returns
                      #                                  a configurable ICMP packet back to the
                      #                                  sender.
                      #
                      #    iptable_mangle – this target allows for packets to be manipulated
                      #                    for things like the TCPMSS option, etc.

                      echo -e ”  Modulok betoltese kesz.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 ”  Ip tovabbitas engedelyezese..”
                      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 ”  DynamicAddr engedelyezese..”
                      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 ”  Alapveto atiranyitasok beallitasa..”
                      $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 ”  Csak Belulrol letrehozott kapcsolatok engedelyezese”
                      #$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 ”  Ip maszkolas engedejezese a $EXTIF eszkozon”
                      $IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE

                      # MTU problema
                      # HA ADSL-unk van szedjuk ki a kovetkezozo sort a megjegyzesbol
                      #$IPTABLES -t nat -A POSTROUTING -o $EXTIF -p tcp –tcp-flags SYN,RST SYN -m tcpmss –mss 1453: -j TCPMSS –set-mss 1452

                      echo -e „KESZ.n”

                      természetesen itt is a kártyák elosztását neked kell a megfelelöre beállítani.
                      EXTIF, INTIF

                      illetve ajánlom figyelmedbe ezt az oldalt:
                      http://people.inf.elte.hu/radicsla/Linux/irasok/Internet_megosztas/Internet_megosztas.html

                      ha még megengedsz egy személyes megjegyzést:
                      az xbox májkroszoft, nem csodálom, hogy hülyén müködik 😛

                      #2067131
                      Mike65
                      Felhasználó

                        köszi hogy segítesz, suse alól már meg volt oldva hogy menjen pár hónapja, itt is menni kell valahogy, természetesen van rész ahol meg tudok adni neki ip-címet, netmaskot, dns-t, meg is van adva, a lényeg az lenne benne hogy ugyanúgy menjen mint windows alól, ne kelljen semmit állítgatni, ha a másik rendszer megy.

                        egyébként addig microsoft amíg nincs moddolva, onnantól kezdve linux alapú rendszerek futnak rajta, nagyon jó kis médiacenter program van rá és nagyon szeretem is a masinát 🙂 létezik linux is rá 😉

                        most jó sok információt adtál, ezzel tudok próbálkozni, kösz.

                      10 bejegyzés megtekintése - 1-10 / 17
                      • Be kell jelentkezni a hozzászóláshoz.