premostenie WIFI Ethernet

Sekcia: Konfigurácia 07.09.2007 | 16:48
Avatar Angel182 Ubuntu  Používateľ
ahoj mam taky problem mam Notebook a na net som pripojeny cez ethernet kabel. chcel by som zdielat s segrinim NB net ale neviem ako premostit pripojenie medzi wifi a ethernetom mozemi niekto pomoct???

mam Ubuntu 7.10 file:///usr/share/ubuntu-artwork/home/locales/index-sk.html
    • Re: premostenie WIFI Ethernet 08.09.2007 | 14:17
      Avatar mcx Mac OS X / Windows 7 / Ubuntu  Používateľ
      Neviem ci ti to pomoze, ale ja mam premostene eth0 a eth1 na velkom compe a cez kabel idem na notebook. Neviem ci wifi kartu nebude treba neako nasravit, ale ja som svoje zdielanie riesil cez firehol. v /etc/firehol.conf mam:
      interface eth1 homelan
      server all accept
      client all accept

      interface eth0 internet
      client all accept
      server samba accept
      server http accept
      server ssh deny
      server ftp deny

      router internet2home inface eth0 outface eth1

      router home2internet inface eth1 outface eth0
      route all accept
      masquerade
      • Re: premostenie WIFI Ethernet 08.09.2007 | 14:28
        Avatar KiLo Debian stable  Používateľ
        ja som daco podobne spravil cez iptables
        $ more /etc/init.d/gateway 
        
        #! /bin/sh
        
        LOCKFILE='/tmp/.gtw.lock'
        LOCKFILECONTENTS='This is gateway lockfile, please do not remove'
        # If no rules, do nothing.
        [ -f /etc/gateway.rules ] || exit 0
        
        case "$1" in
            start)
            if [ -f "$LOCKFILE" ]; then
                echo 'Gateway already running'
                exit 0
            fi
                echo -n "Turning on packet filtering:"
        
            #/sbin/modprobe ip_masq_ftp #only if using ipchains
            if [ `/sbin/lsmod | grep iptable_nat | wc -l` -lt 1 ]; then
            /sbin/modprobe iptable_nat #only if using iptables
            fi
            
            if [ `/sbin/lsmod | grep  ipt_MASQUERADE | wc -l` -lt 1 ]; then
            /sbin/modprobe ipt_MASQUERADE #only if using iptables
            fi
                /sbin/iptables-restore < /etc/gateway.rules || exit 1
        
                echo 1 > /proc/sys/net/ipv4/ip_forward
            # for RedHat users, the above line is not needed if you have
            # FORWARD_IPV4=true in /etc/sysconfig/network file
        
            echo "1" > /proc/sys/net/ipv4/ip_dynaddr
            # the above option is for Dynamic IP users (DHCP,PPP or BOOTP)
                echo "$LOCKFILECONTENTS" > "$LOCKFILE"  
                echo " OK"
                ;;
            stop)
                if [ ! -f "$LOCKFILE" ]; then
                    echo 'Strange... lockfile is missing, but I will try to proceed'
                fi
                echo -n "Turning off packet filtering:"
                echo 0 > /proc/sys/net/ipv4/ip_forward
        
                /sbin/iptables -F
                /sbin/iptables -X
                /sbin/iptables -P INPUT ACCEPT
                /sbin/iptables -P OUTPUT ACCEPT
                /sbin/iptables -P FORWARD ACCEPT
                if [ -f "$LOCKFILE" ]; then
                 /bin/rm "$LOCKFILE"
                fi
                echo " OK"
                ;;
            *)
                echo "Usage: /etc/init.d/gateway {start|stop}"
                exit 1
                ;;
        esac
        
        exit 0
        
        

        a druhy:
        $ more /etc/gateway.rules 
        # Generated by iptables-save v1.3.6 on Sat Aug 25 16:26:19 2007
        *mangle
        :PREROUTING ACCEPT [0:0]
        :INPUT ACCEPT [0:0]
        :FORWARD ACCEPT [0:0]
        :OUTPUT ACCEPT [0:0]
        :POSTROUTING ACCEPT [0:0]
        COMMIT
        # Completed on Sat Aug 25 16:26:19 2007
        # Generated by iptables-save v1.3.6 on Sat Aug 25 16:26:19 2007
        *filter
        :INPUT DROP [0:0]
        :FORWARD ACCEPT [0:0]
        :OUTPUT ACCEPT [0:0]
        -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT 
        -A INPUT -i ! ppp0 -m state --state NEW -j ACCEPT 
        -A FORWARD -i ppp0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT 
        -A FORWARD -i eth0 -o ppp0 -j ACCEPT 
        -A FORWARD -i ppp0 -o ppp0 -j REJECT --reject-with icmp-port-unreachable 
        COMMIT
        # Completed on Sat Aug 25 16:26:19 2007
        # Generated by iptables-save v1.3.6 on Sat Aug 25 16:26:19 2007
        *nat
        :PREROUTING ACCEPT [8:11734]
        :POSTROUTING ACCEPT [2:100]
        :OUTPUT ACCEPT [2:100]
        -A POSTROUTING -o ppp0 -j MASQUERADE 
        COMMIT
        # Completed on Sat Aug 25 16:26:19 2007
        

        je to z nejakeho navodu, co sa mi teraz nechce hladat, torsku modifikovane
        cat /dev/dsp > /dev/sda - ovladanie pocitaca hlasom
        • Re: premostenie WIFI Ethernet 08.09.2007 | 14:29
          Avatar KiLo Debian stable  Používateľ
          este dodam, ze ide o 'premostenie' eth0 a ppp0, kde eth0 je LAN, ppp0 ide k netu
          cat /dev/dsp > /dev/sda - ovladanie pocitaca hlasom