Prosíme přihlašte se nebo zaregistrujte.

Přihlašte se svým uživatelským jménem a heslem.
Vaše pomoc je stále potřeba!

Autor Téma: ubuntu(wifi) zdielanie netu na XP(kabel)  (Přečteno 8111 krát)

romciiik

  • Stálý člen
  • **
  • Příspěvků: 532
    • romiix.org
Re: ubuntu(wifi) zdielanie netu na XP(kabel)
« Odpověď #25 kdy: 23 Listopadu 2008, 21:17:17 »
cisty restart (vypnutie bez ulozenia sedenia a nasledne zapnutie)
hned po restarte:
Kód: [Vybrat]
roman@roman-desktop:~$ sudo iptables -L
[sudo] password for roman:
Chain INPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere           
LOG        all  --  127.0.0.0/8          anywhere            LOG level warning
DROP       all  --  127.0.0.0/8          anywhere           
ACCEPT     all  --  anywhere             255.255.255.255     
ACCEPT     all  --  192.168.0.0/24       anywhere           
ACCEPT    !tcp  --  anywhere             BASE-ADDRESS.MCAST.NET/4
LOG        all  --  192.168.0.0/24       anywhere            LOG level warning
DROP       all  --  192.168.0.0/24       anywhere           
ACCEPT     all  --  anywhere             255.255.255.255     
ACCEPT     all  --  anywhere             192.168.15.195     
ACCEPT     all  --  anywhere             192.168.15.255     
DROP       all  --  anywhere             ALL-SYSTEMS.MCAST.NET
LOG        all  --  anywhere             anywhere            LOG level warning
DROP       all  --  anywhere             anywhere           

Chain FORWARD (policy DROP)
target     prot opt source               destination         
ACCEPT     all  --  192.168.0.0/24       anywhere           
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
LOG        all  --  anywhere             192.168.0.0/24      LOG level warning
DROP       all  --  anywhere             192.168.0.0/24     
DROP       all  --  anywhere             ALL-SYSTEMS.MCAST.NET
LOG        all  --  anywhere             anywhere            LOG level warning
DROP       all  --  anywhere             anywhere           

Chain OUTPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere           
ACCEPT     all  --  anywhere             255.255.255.255     
ACCEPT     all  --  anywhere             192.168.0.0/24     
ACCEPT    !tcp  --  anywhere             BASE-ADDRESS.MCAST.NET/4
LOG        all  --  anywhere             192.168.0.0/24      LOG level warning
DROP       all  --  anywhere             192.168.0.0/24     
ACCEPT     all  --  anywhere             255.255.255.255     
ACCEPT     all  --  192.168.15.195       anywhere           
ACCEPT     all  --  192.168.15.255       anywhere           
DROP       all  --  anywhere             ALL-SYSTEMS.MCAST.NET
LOG        all  --  anywhere             anywhere            LOG level warning
DROP       all  --  anywhere             anywhere           

firehol - nemam
firestarter - nemam
ufw - MAM ale:
Kód: [Vybrat]
roman@roman-desktop:~$ sudo ufw status
Status: not loaded
takze asi aj tak nepracuje  :-[

what next??

truhlik

  • Závislák
  • ***
  • Příspěvků: 1626
Re: ubuntu(wifi) zdielanie netu na XP(kabel)
« Odpověď #26 kdy: 23 Listopadu 2008, 21:31:38 »
Evidetne tam spoustite neco co saha do iptables. Otazkou zustava co a jak se toho zbavit.
Zvlast tohohle v sekci FORWARD:
Kód: [Vybrat]
DROP       all  --  anywhere             192.168.0.0/24

Donutil jste me studovat man iptables  :), vy se zatim podivejte na neco co se spousti automaticky samo po startu a mohlo by to sahat na iptables = firewall. Prostudujte /etc/rc.2/* /etc/rc.local

Ale obavam se, ze budem muset pockat na nekoho chytrejsiho.
« Poslední změna: 23 Listopadu 2008, 21:46:51 od truhlik »
http://wiki.ubuntu.cz/P%C5%99ipojen%C3%AD%20disku
http://www.linuxsoft.cz/article.php?id_article=1351
http://www.root.cz/clanky/klonovani-obrazu-a-dva-monitory-v-linuxu
Citace: Otakar
Červi jsou moc milá zvířátka, zvláště když má jejich chovatel výhrady proti chování tučňáků

romciiik

  • Stálý člen
  • **
  • Příspěvků: 532
    • romiix.org
Re: ubuntu(wifi) zdielanie netu na XP(kabel)
« Odpověď #27 kdy: 23 Listopadu 2008, 21:47:46 »
Kód: [Vybrat]
sudo geany /etc/rc.local
Kód: [Vybrat]
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

##připojení k internetu
pppd &

##sdílení připojení
sudo iptables -A FORWARD -i eth0 -o wlan0 -s 192.168.0.0/24 -m state --state NEW -j ACCEPT

sudo iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT

sudo iptables -A POSTROUTING -t nat -j MASQUERADE

sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

exit 0

opravil som to na:
Kód: [Vybrat]
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

##připojení k internetu
pppd &

##sdílení připojení
sudo iptables -A FORWARD -i wlan0 -o eth0 -s 192.168.0.0/24 -m state --state NEW -j ACCEPT

sudo iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT

sudo iptables -A POSTROUTING -t nat -j MASQUERADE

sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

exit 0

ping z win presiel (192.168.0.1 aj 192.168.0.2)
ale na google nie, zaujimave ze ted to vypisalo inu ip googlu ako predtim - 64.233.187.99, takze asi zadny cashe.

s /etc/rc.2/* nevim co mam robit

nettezzaumana by s tim nevedel nahodou pohnut?

fakt vdaka za snahu ;)

truhlik

  • Závislák
  • ***
  • Příspěvků: 1626
Re: ubuntu(wifi) zdielanie netu na XP(kabel)
« Odpověď #28 kdy: 23 Listopadu 2008, 21:57:00 »
V tom rc.local mas ty prikazy na sdileni toho internetu, takze kdyz jsem chtel abys restartoval a nespoustel ty prikazy tak se spustily.

Ntz by vedel, ale nekde se flaka.  :)

PS: Uz tu neco chystam, tak snad to dochystam...  ;)
http://wiki.ubuntu.cz/P%C5%99ipojen%C3%AD%20disku
http://www.linuxsoft.cz/article.php?id_article=1351
http://www.root.cz/clanky/klonovani-obrazu-a-dva-monitory-v-linuxu
Citace: Otakar
Červi jsou moc milá zvířátka, zvláště když má jejich chovatel výhrady proti chování tučňáků

romciiik

  • Stálý člen
  • **
  • Příspěvků: 532
    • romiix.org
Re: ubuntu(wifi) zdielanie netu na XP(kabel)
« Odpověď #29 kdy: 23 Listopadu 2008, 22:05:38 »
mam to od tial vyhodit, restartnut a spustit?
Kód: [Vybrat]
sudo iptables -L.. a poslat sem?

mozno by bolo rychlejsie riesit to cez ICQ a hodit sem iba vysledok.. (?)

Pavel Půlpán

Re: ubuntu(wifi) zdielanie netu na XP(kabel)
« Odpověď #30 kdy: 26 Listopadu 2008, 19:56:41 »
Je zbytečné mít v rc.local před všemi příkazy prefixované sudo. Plus sem tedy hoď výpis z iptables -L.

romciiik

  • Stálý člen
  • **
  • Příspěvků: 532
    • romiix.org
Re: ubuntu(wifi) zdielanie netu na XP(kabel)
« Odpověď #31 kdy: 26 Listopadu 2008, 20:12:16 »
pred spustenim firestarteru:
Kód: [Vybrat]
Chain INPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere           
LOG        all  --  127.0.0.0/8          anywhere            LOG level warning
DROP       all  --  127.0.0.0/8          anywhere           
ACCEPT     all  --  anywhere             255.255.255.255     
ACCEPT     all  --  192.168.0.0/24       anywhere           
ACCEPT    !tcp  --  anywhere             BASE-ADDRESS.MCAST.NET/4
DROP       all  --  192.168.0.0/24       anywhere           
ACCEPT     all  --  anywhere             192.168.15.195     
ACCEPT     all  --  anywhere             192.168.15.255     
DROP       all  --  anywhere             ALL-SYSTEMS.MCAST.NET
LOG        all  --  anywhere             anywhere            LOG level warning
DROP       all  --  anywhere             anywhere           

Chain FORWARD (policy DROP)
target     prot opt source               destination         
ACCEPT     all  --  192.168.0.0/24       anywhere           
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
DROP       all  --  anywhere             192.168.0.0/24     
LOG        all  --  anywhere             anywhere            LOG level warning
DROP       all  --  anywhere             anywhere           

Chain OUTPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere           
ACCEPT     all  --  anywhere             255.255.255.255     
ACCEPT     all  --  anywhere             192.168.0.0/24     
ACCEPT    !tcp  --  anywhere             BASE-ADDRESS.MCAST.NET/4
DROP       all  --  anywhere             192.168.0.0/24     
ACCEPT     all  --  192.168.15.195       anywhere           
ACCEPT     all  --  192.168.15.255       anywhere           
DROP       all  --  anywhere             ALL-SYSTEMS.MCAST.NET
LOG        all  --  anywhere             anywhere            LOG level warning
DROP       all  --  anywhere             anywhere   

po spusteni konfiguracie a vypnuti firestarteru:
Kód: [Vybrat]
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain INBOUND (0 references)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     udp  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     all  --  192.168.0.2          anywhere           
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:domain
ACCEPT     udp  --  anywhere             anywhere            udp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:www
ACCEPT     udp  --  anywhere             anywhere            udp dpt:www

po opatovnom spusteni firestarteru:
Kód: [Vybrat]
Chain INPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     tcp  --  ns.gtsi.sk           anywhere            tcp flags:!FIN,SYN,RST,ACK/SYN
ACCEPT     udp  --  ns.gtsi.sk           anywhere           
ACCEPT     tcp  --  ns2.telecom.sk       anywhere            tcp flags:!FIN,SYN,RST,ACK/SYN
ACCEPT     udp  --  ns2.telecom.sk       anywhere           
ACCEPT     all  --  anywhere             anywhere           
ACCEPT     icmp --  anywhere             anywhere            limit: avg 10/sec burst 5
DROP       all  --  anywhere             255.255.255.255     
DROP       all  --  anywhere             192.168.15.255     
DROP       all  --  BASE-ADDRESS.MCAST.NET/8  anywhere           
DROP       all  --  anywhere             BASE-ADDRESS.MCAST.NET/8
DROP       all  --  255.255.255.255      anywhere           
DROP       all  --  anywhere             0.0.0.0             
DROP       all  --  anywhere             anywhere            state INVALID
LSI        all  -f  anywhere             anywhere            limit: avg 10/min burst 5
INBOUND    all  --  anywhere             anywhere           
INBOUND    all  --  anywhere             192.168.0.1         
INBOUND    all  --  anywhere             192.168.15.195     
INBOUND    all  --  anywhere             192.168.0.255       
LOG_FILTER  all  --  anywhere             anywhere           
LOG        all  --  anywhere             anywhere            LOG level info prefix `Unknown Input'

Chain FORWARD (policy DROP)
target     prot opt source               destination         
ACCEPT     icmp --  anywhere             anywhere            limit: avg 10/sec burst 5
TCPMSS     tcp  --  anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
OUTBOUND   all  --  anywhere             anywhere           
ACCEPT     tcp  --  anywhere             192.168.0.0/24      state RELATED,ESTABLISHED
ACCEPT     udp  --  anywhere             192.168.0.0/24      state RELATED,ESTABLISHED
LOG_FILTER  all  --  anywhere             anywhere           
LOG        all  --  anywhere             anywhere            LOG level info prefix `Unknown Forward'

Chain OUTPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     tcp  --  192.168.15.195       ns.gtsi.sk          tcp dpt:domain
ACCEPT     udp  --  192.168.15.195       ns.gtsi.sk          udp dpt:domain
ACCEPT     tcp  --  192.168.15.195       ns2.telecom.sk      tcp dpt:domain
ACCEPT     udp  --  192.168.15.195       ns2.telecom.sk      udp dpt:domain
ACCEPT     all  --  anywhere             anywhere           
DROP       all  --  BASE-ADDRESS.MCAST.NET/8  anywhere           
DROP       all  --  anywhere             BASE-ADDRESS.MCAST.NET/8
DROP       all  --  255.255.255.255      anywhere           
DROP       all  --  anywhere             0.0.0.0             
DROP       all  --  anywhere             anywhere            state INVALID
OUTBOUND   all  --  anywhere             anywhere           
OUTBOUND   all  --  anywhere             anywhere           
LOG_FILTER  all  --  anywhere             anywhere           
LOG        all  --  anywhere             anywhere            LOG level info prefix `Unknown Output'

Chain INBOUND (4 references)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     udp  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     all  --  192.168.0.2          anywhere           
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:domain
ACCEPT     udp  --  anywhere             anywhere            udp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:www
ACCEPT     udp  --  anywhere             anywhere            udp dpt:www
LSI        all  --  anywhere             anywhere           

Chain LOG_FILTER (5 references)
target     prot opt source               destination         

Chain LSI (2 references)
target     prot opt source               destination         
LOG_FILTER  all  --  anywhere             anywhere           
LOG        tcp  --  anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN limit: avg 1/sec burst 5 LOG level info prefix `Inbound '
DROP       tcp  --  anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN
LOG        tcp  --  anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/RST limit: avg 1/sec burst 5 LOG level info prefix `Inbound '
DROP       tcp  --  anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/RST
LOG        icmp --  anywhere             anywhere            icmp echo-request limit: avg 1/sec burst 5 LOG level info prefix `Inbound '
DROP       icmp --  anywhere             anywhere            icmp echo-request
LOG        all  --  anywhere             anywhere            limit: avg 5/sec burst 5 LOG level info prefix `Inbound '
DROP       all  --  anywhere             anywhere           

Chain LSO (0 references)
target     prot opt source               destination         
LOG_FILTER  all  --  anywhere             anywhere           
LOG        all  --  anywhere             anywhere            limit: avg 5/sec burst 5 LOG level info prefix `Outbound '
REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable

Chain OUTBOUND (3 references)
target     prot opt source               destination         
ACCEPT     icmp --  anywhere             anywhere           
ACCEPT     tcp  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     udp  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere           

Pavel Půlpán

Re: ubuntu(wifi) zdielanie netu na XP(kabel)
« Odpověď #32 kdy: 26 Listopadu 2008, 20:58:19 »
Nějak jsi upravoval nastavení firewallu?

romciiik

  • Stálý člen
  • **
  • Příspěvků: 532
    • romiix.org
Re: ubuntu(wifi) zdielanie netu na XP(kabel)
« Odpověď #33 kdy: 26 Listopadu 2008, 21:16:01 »
nastavoval som co je spomenute na fore + uprava iptables + nastavenia ktore si spravil firestarter + nastavenie na obrazku (nemohol som dat do prilohy, vraj je plny adresar na servry)
Kód: [Vybrat]
http://rapidshare.com/files/167683517/Screenshot.png

 

Provoz zaštiťuje spolek OpenAlt.