Delning Av Internet Fungerar ej... [ LÖST ]

Här behandlar vi program för Internet och kommunikation; webbläsare, chatt-program, filöverföring osv.
Användarvisningsbild
pata66
Inlägg: 391
Blev medlem: 18 jan 2009, 01:54
OS: Manjaro
Utgåva: 20.04 Focal Fossa LTS
Ort: Götene

Delning Av Internet Fungerar ej... [ LÖST ]

Inlägg av pata66 »

Hmm. Nu var jag där igen då. ??? Jag har installerat om Ubuntu och nu får jag inte delningen av Internet att fungerar med min Xbox 360

Detta fungerade innan om installation med FIrestarter.

Jag kör med fast Ip

I Datorn ser det ut så här Ip 192.168.0.1
Nät 255.255.255.0

I Xboxen ser det ut så här Ip 192.168.0.2
subnetmask 255.255.255.0
Gateway 192.168.0.1


Ifconfig

Kod: Markera allt

pata@pata-laptop:~$ ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:0f:b0:c2:52:84  
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::20f:b0ff:fec2:5284/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:314 errors:0 dropped:0 overruns:0 frame:0
          TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:18960 (18.9 KB)  TX bytes:6077 (6.0 KB)
          Interrupt:22 Base address:0xa000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:260 errors:0 dropped:0 overruns:0 frame:0
          TX packets:260 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:13110 (13.1 KB)  TX bytes:13110 (13.1 KB)

ppp0      Link encap:Point-to-Point Protocol  
          inet addr:90.235.130.103  P-t-P:10.64.64.64  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:129 errors:0 dropped:0 overruns:0 frame:0
          TX packets:131 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:72240 (72.2 KB)  TX bytes:19483 (19.4 KB)

wlan0     Link encap:Ethernet  HWaddr 00:14:a5:4e:06:f6  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wmaster0  Link encap:UNSPEC  HWaddr 00-14-A5-4E-06-F6-00-00-00-00-00-00-00-00-00-00  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

pata@pata-laptop:~$ 

Som sagt detta har fungerat tidigare men inte nu.. Kan det vara så att brandväggen stoppar delningen av internet ? Hur slår man av den helt för att testa det ?
I Firestarter så har jag ppp0 som uppringande till internet och den ska dela till eth0.

Jag kan se Grafiskt via Xboxen när jag testar uppkopplingen och den får kontakt med datorn men inte med Internet.

/ Pata
Senast redigerad av 1 pata66, redigerad totalt 15 gånger.
Användarvisningsbild
pata66
Inlägg: 391
Blev medlem: 18 jan 2009, 01:54
OS: Manjaro
Utgåva: 20.04 Focal Fossa LTS
Ort: Götene

Re: Delning Av Internet Fungerar ej...

Inlägg av pata66 »

Ingen som har någon lösning. Eller har erfarenhet av Firestarter och delning av Internet ?
Användarvisningsbild
webaake
Inlägg: 3962
Blev medlem: 09 maj 2007, 09:46
OS: Xubuntu
Utgåva: 22.04 Jammy Jellyfish LTS

Re: Delning Av Internet Fungerar ej...

Inlägg av webaake »

Vi kanske kan få lite mer info om du kör några kommandon i terminalen;

sudo iptables --list

och

cat /etc/resolv.conf

iptables --list visar vad Firestarter ev. har lagt in
resolv.conf skall innehålla ev. DNS-servrar

Kopiera resultatet och klistra in här, så får du mer hjälp.
Xubuntu på flera maskiner. Men inte Unity!
Mer Terminalanvändande i Ubuntu vore bra. Och Xfce. Och Mate.
Användarvisningsbild
pata66
Inlägg: 391
Blev medlem: 18 jan 2009, 01:54
OS: Manjaro
Utgåva: 20.04 Focal Fossa LTS
Ort: Götene

Re: Delning Av Internet Fungerar ej...

Inlägg av pata66 »

Här kommer mera information.

iptables --list

Kod: Markera allt

pata@pata-laptop:~$ sudo iptables --list
[sudo] password for pata: 
Chain INPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     tcp  --  resolver1-g-fo.skanova.com  anywhere            tcp flags:!FIN,SYN,RST,ACK/SYN 
ACCEPT     udp  --  resolver1-g-fo.skanova.com  anywhere            
ACCEPT     tcp  --  resolver2-g-fo.skanova.com  anywhere            tcp flags:!FIN,SYN,RST,ACK/SYN 
ACCEPT     udp  --  resolver2-g-fo.skanova.com  anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     icmp --  anywhere             anywhere            limit: avg 10/sec burst 5 
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             host-90-235-152-81.mobileonline.telia.com 
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  --  host-90-235-152-81.mobileonline.telia.com  resolver1-g-fo.skanova.com tcp dpt:domain 
ACCEPT     udp  --  host-90-235-152-81.mobileonline.telia.com  resolver1-g-fo.skanova.com udp dpt:domain 
ACCEPT     tcp  --  host-90-235-152-81.mobileonline.telia.com  resolver2-g-fo.skanova.com tcp dpt:domain 
ACCEPT     udp  --  host-90-235-152-81.mobileonline.telia.com  resolver2-g-fo.skanova.com 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     all  --  192.168.0.2          anywhere            
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:domain 
ACCEPT     udp  --  anywhere             anywhere            udp dpt:domain 
ACCEPT     tcp  --  192.168.0.2          anywhere            tcp dpt:domain 
ACCEPT     udp  --  192.168.0.2          anywhere            udp dpt:domain 
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            
pata@pata-laptop:~$ 

Och cat /etc/resolv.conf

Kod: Markera allt

# Generated by NetworkManager
nameserver 195.67.199.27
nameserver 195.67.199.28
Användarvisningsbild
webaake
Inlägg: 3962
Blev medlem: 09 maj 2007, 09:46
OS: Xubuntu
Utgåva: 22.04 Jammy Jellyfish LTS

Re: Delning Av Internet Fungerar ej...

Inlägg av webaake »

DNS:erna ser bra ut. Nu är jag ingen fena på iptablesregler men;

Chain OUTPUT (policy DROP)
och
Chain FORWARD (policy DROP)
-> Kanske man kan ändra detta till policy ACCEPT i Firestarter (kör det inte själv)?
Jag menar att default för OUTPUT och FORWARD är satt till DROP vilket är säkert, men kanske lite onödigt?

Kör man vissa servrar internt (Samba tex) kan man alltid stänga just de portarna för utgående trafik. (Samba udp/tcp 137-139 samt 445)
Xubuntu på flera maskiner. Men inte Unity!
Mer Terminalanvändande i Ubuntu vore bra. Och Xfce. Och Mate.
Användarvisningsbild
pata66
Inlägg: 391
Blev medlem: 18 jan 2009, 01:54
OS: Manjaro
Utgåva: 20.04 Focal Fossa LTS
Ort: Götene

Re: Delning Av Internet Fungerar ej...

Inlägg av pata66 »

webaake skrev:DNS:erna ser bra ut. Nu är jag ingen fena på iptablesregler men;

Chain OUTPUT (policy DROP)
och
Chain FORWARD (policy DROP)
-> Kanske man kan ändra detta till policy ACCEPT i Firestarter (kör det inte själv)?
Jag menar att default för OUTPUT och FORWARD är satt till DROP vilket är säkert, men kanske lite onödigt?

Kör man vissa servrar internt (Samba tex) kan man alltid stänga just de portarna för utgående trafik. (Samba udp/tcp 137-139 samt 445)

Hur ändra jag det manuellt ?
Användarvisningsbild
webaake
Inlägg: 3962
Blev medlem: 09 maj 2007, 09:46
OS: Xubuntu
Utgåva: 22.04 Jammy Jellyfish LTS

Re: Delning Av Internet Fungerar ej...

Inlägg av webaake »

Är reglerna skapade i Firestarter så är det nog enklast att ändra dem där. Länk till en Firestartersida;

http://www.fs-security.com/docs/connection-sharing.php

Läste där att det skall finnas en speciell inställning i FS om internetsharing.
Xubuntu på flera maskiner. Men inte Unity!
Mer Terminalanvändande i Ubuntu vore bra. Och Xfce. Och Mate.
Användarvisningsbild
pata66
Inlägg: 391
Blev medlem: 18 jan 2009, 01:54
OS: Manjaro
Utgåva: 20.04 Focal Fossa LTS
Ort: Götene

Re: Delning Av Internet Fungerar ej...

Inlägg av pata66 »

kruxet är att jag inte kan ändra mera i Firestarter.. Det som går att ställa om har jag provat. Det knepiga är att det fungerade klockrent innan jag installerade om systemet ???

Konstigt att det ska krångla. Tidiagre körde jag l Linux Mint.. Kanske Ubuntu och mint jobbar på olika sätt ??
Användarvisningsbild
webaake
Inlägg: 3962
Blev medlem: 09 maj 2007, 09:46
OS: Xubuntu
Utgåva: 22.04 Jammy Jellyfish LTS

Re: Delning Av Internet Fungerar ej...

Inlägg av webaake »

Nä, jag tror inte de är olika i botten. Där finns nämligen brandväggen Netfilter/Iptables som ju Firestarter bara är ett front end till.

Men jag skall kolla vidare, t ex kanske man kan hitta den fil Firestarter skriver till och redigera direkt i den?
Xubuntu på flera maskiner. Men inte Unity!
Mer Terminalanvändande i Ubuntu vore bra. Och Xfce. Och Mate.
Användarvisningsbild
webaake
Inlägg: 3962
Blev medlem: 09 maj 2007, 09:46
OS: Xubuntu
Utgåva: 22.04 Jammy Jellyfish LTS

Re: Delning Av Internet Fungerar ej...

Inlägg av webaake »

Det du redan har gjort i Firestarter måste ju gå att ändra? Kan du köra wizarden igen? VAd du behöver dra igång är masquerading och port forwarding, vilket tillsammans utgör NAT (Netwrok Adress Translation). Och välj policy accept för allt utgående - du kan ju alltid stänga det senare.
Xubuntu på flera maskiner. Men inte Unity!
Mer Terminalanvändande i Ubuntu vore bra. Och Xfce. Och Mate.
Användarvisningsbild
pata66
Inlägg: 391
Blev medlem: 18 jan 2009, 01:54
OS: Manjaro
Utgåva: 20.04 Focal Fossa LTS
Ort: Götene

Re: Delning Av Internet Fungerar ej...

Inlägg av pata66 »

Ska ta och göra om allt med Firestarter om en stund. Just nu tampas jag med mina barn. Men dom är i sängen om en stund.

Vill tacka för hjälpen :)

Återkommer strax

/ Pata
Användarvisningsbild
webaake
Inlägg: 3962
Blev medlem: 09 maj 2007, 09:46
OS: Xubuntu
Utgåva: 22.04 Jammy Jellyfish LTS

Re: Delning Av Internet Fungerar ej...

Inlägg av webaake »

Ett annat tips är att använda denna scriptgenerator;

http://easyfwgen.morizot.net/gen/

Den frågar om ditt nätverk och skapar iptblesregler utifrån dina svar. För ditt nätverk sklle det kunna se ut såhär;

[quote]#!/bin/sh
#
# Generated iptables firewall script for the Linux 2.4 kernel
# Script generated by Easy Firewall Generator for IPTables 1.15
# copyright 2002 Timothy Scott Morizot
#
# Redhat chkconfig comments - firewall applied early,
# removed late
# chkconfig: 2345 08 92
# description: This script applies or removes iptables firewall rules
#
# This generator is primarily designed for RedHat installations,
# although it should be adaptable for others.
#
# It can be executed with the typical start and stop arguments.
# If used with stop, it will stop after flushing the firewall.
# The save and restore arguments will save or restore the rules
# from the /etc/sysconfig/iptables file. The save and restore
# arguments are included to preserve compatibility with
# Redhat's or Fedora's init.d script if you prefer to use it.

# Redhat/Fedora installation instructions
#
# 1. Have the system link the iptables init.d startup script into run states
# 2, 3, and 5.
# chkconfig --level 235 iptables on
#
# 2. Save this script and execute it to load the ruleset from this file.
# You may need to run the dos2unix command on it to remove carraige returns.
#
# 3. To have it applied at startup, copy this script to
# /etc/init.d/iptables. It accepts stop, start, save, and restore
# arguments. (You may wish to save the existing one first.)
# Alternatively, if you issue the 'service iptables save' command
# the init.d script should save the rules and reload them at runtime.
#
# 4. For non-Redhat systems (or Redhat systems if you have a problem), you
# may want to append the command to execute this script to rc.local.
# rc.local is typically located in /etc and /etc/rc.d and is usually
# the last thing executed on startup. Simply add /path/to/script/script_name
# on its own line in the rc.local file.

###############################################################################
#
# Local Settings
#

# sysctl location. If set, it will use sysctl to adjust the kernel parameters.
# If this is set to the empty string (or is unset), the use of sysctl
# is disabled.

SYSCTL="/sbin/sysctl -w"

# To echo the value directly to the /proc file instead
# SYSCTL=""

# IPTables Location - adjust if needed

IPT="/sbin/iptables"
IPTS="/sbin/iptables-save"
IPTR="/sbin/iptables-restore"

# Internet Interface
INET_IFACE="ppp0"

# Local Interface Information
LOCAL_IFACE="eth0"
LOCAL_IP="192.168.0.1"
LOCAL_NET="192.168.1.0/24"
LOCAL_BCAST="192.168.1.255"

# Localhost Interface

LO_IFACE="lo"
LO_IP="127.0.0.1"

# Save and Restore arguments handled here
if [ "$1" = "save" ]
then
echo -n "Saving firewall to /etc/sysconfig/iptables ... "
$IPTS > /etc/sysconfig/iptables
echo "done"
exit 0
elif [ "$1" = "restore" ]
then
echo -n "Restoring firewall from /etc/sysconfig/iptables ... "
$IPTR < /etc/sysconfig/iptables
echo "done"
exit 0
fi

###############################################################################
#
# Load Modules
#

echo "Loading kernel modules ..."

# You should uncomment the line below and run it the first time just to
# ensure all kernel module dependencies are OK. There is no need to run
# every time, however.

# /sbin/depmod -a

# Unless you have kernel module auto-loading disabled, you should not
# need to manually load each of these modules. Other than ip_tables,
# ip_conntrack, and some of the optional modules, I've left these
# commented by default. Uncomment if you have any problems or if
# you have disabled module autoload. Note that some modules must
# be loaded by another kernel module.

# core netfilter module
/sbin/modprobe ip_tables

# the stateful connection tracking module
/sbin/modprobe ip_conntrack

# filter table module
# /sbin/modprobe iptable_filter

# mangle table module
# /sbin/modprobe iptable_mangle

# nat table module
# /sbin/modprobe iptable_nat

# LOG target module
# /sbin/modprobe ipt_LOG

# This is used to limit the number of packets per sec/min/hr
# /sbin/modprobe ipt_limit

# masquerade target module
# /sbin/modprobe ipt_MASQUERADE

# filter using owner as part of the match
# /sbin/modprobe ipt_owner

# REJECT target drops the packet and returns an ICMP response.
# The response is configurable. By default, connection refused.
# /sbin/modprobe ipt_REJECT

# This target allows packets to be marked in the mangle table
# /sbin/modprobe ipt_mark

# This target affects the TCP MSS
# /sbin/modprobe ipt_tcpmss

# This match allows multiple ports instead of a single port or range
# /sbin/modprobe multiport

# This match checks against the TCP flags
# /sbin/modprobe ipt_state

# This match catches packets with invalid flags
# /sbin/modprobe ipt_unclean

# The ftp nat module is required for non-PASV ftp support
/sbin/modprobe ip_nat_ftp

# the module for full ftp connection tracking
/sbin/modprobe ip_conntrack_ftp

# the module for full irc connection tracking
/sbin/modprobe ip_conntrack_irc


###############################################################################
#
# Kernel Parameter Configuration
#
# See http://ipsysctl-tutorial.frozentux.net/ ... index.html
# for a detailed tutorial on sysctl and the various settings
# available.

# Required to enable IPv4 forwarding.
# Redhat users can try setting FORWARD_IPV4 in /etc/sysconfig/network to true
# Alternatively, it can be set in /etc/sysctl.conf
if [ "$SYSCTL" = "" ]
then
echo "1" > /proc/sys/net/ipv4/ip_forward
else
$SYSCTL net.ipv4.ip_forward="1"
fi

# This enables dynamic address hacking.
# This may help if you have a dynamic IP address \(e.g. slip, ppp, dhcp\).
#if [ "$SYSCTL" = "" ]
#then
# echo "1" > /proc/sys/net/ipv4/ip_dynaddr
#else
# $SYSCTL net.ipv4.ip_dynaddr="1"
#fi

# This enables SYN flood protection.
# The SYN cookies activation allows your system to accept an unlimited
# number of TCP connections while still trying to give reasonable
# service during a denial of service attack.
if [ "$SYSCTL" = "" ]
then
echo "1" > /proc/sys/net/ipv4/tcp_syncookies
else
$SYSCTL net.ipv4.tcp_syncookies="1"
fi

# This enables source validation by reversed path according to RFC1812.
# In other words, did the response packet originate from the same interface
# through which the source packet was sent? It's recommended for single-homed
# systems and routers on stub networks. Since those are the configurations
# this firewall is designed to support, I turn it on by default.
# Turn it off if you use multiple NICs connected to the same network.
if [ "$SYSCTL" = "" ]
then
echo "1" > /proc/sys/net/ipv4/conf/all/rp_filter
else
$SYSCTL net.ipv4.conf.all.rp_filter="1"
fi

# This option allows a subnet to be firewalled with a single IP address.
# It's used to build a DMZ. Since that's not a focus of this firewall
# script, it's not enabled by default, but is included for reference.
# See: http://www.sjdjweis.com/linux/proxyarp/
#if [ "$SYSCTL" = "" ]
#then
# echo "1" > /proc/sys/net/ipv4/conf/all/proxy_arp
#else
# $SYSCTL net.ipv4.conf.all.proxy_arp="1"
#fi

# The following kernel settings were suggested by Alex Weeks. Thanks!

# This kernel parameter instructs the kernel to ignore all ICMP
# echo requests sent to the broadcast address. This prevents
# a number of smurfs and similar DoS nasty attacks.
if [ "$SYSCTL" = "" ]
then
echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
else
$SYSCTL net.ipv4.icmp_echo_ignore_broadcasts="1"
fi

# This option can be used to accept or refuse source routed
# packets. It is usually on by default, but is generally
# considered a security risk. This option turns it off.
if [ "$SYSCTL" = "" ]
then
echo "0" > /proc/sys/net/ipv4/conf/all/accept_source_route
else
$SYSCTL net.ipv4.conf.all.accept_source_route="0"
fi

# This option can disable ICMP redirects. ICMP redirects
# are generally considered a security risk and shouldn't be
# needed by most systems using this generator.
#if [ "$SYSCTL" = "" ]
#then
# echo "0" > /proc/sys/net/ipv4/conf/all/accept_redirects
#else
# $SYSCTL net.ipv4.conf.all.accept_redirects="0"
#fi

# However, we'll ensure the secure_redirects option is on instead.
# This option accepts only from gateways in the default gateways list.
if [ "$SYSCTL" = "" ]
then
echo "1" > /proc/sys/net/ipv4/conf/all/secure_redirects
else
$SYSCTL net.ipv4.conf.all.secure_redirects="1"
fi

# This option logs packets from impossible addresses.
if [ "$SYSCTL" = "" ]
then
echo "1" > /proc/sys/net/ipv4/conf/all/log_martians
else
$SYSCTL net.ipv4.conf.all.log_martians="1"
fi


###############################################################################
#
# Flush Any Existing Rules or Chains
#

echo "Flushing Tables ..."

# Reset Default Policies
$IPT -P INPUT ACCEPT
$IPT -P FORWARD ACCEPT
$IPT -P OUTPUT ACCEPT
$IPT -t nat -P PREROUTING ACCEPT
$IPT -t nat -P POSTROUTING ACCEPT
$IPT -t nat -P OUTPUT ACCEPT
$IPT -t mangle -P PREROUTING ACCEPT
$IPT -t mangle -P OUTPUT ACCEPT

# Flush all rules
$IPT -F
$IPT -t nat -F
$IPT -t mangle -F

# Erase all non-default chains
$IPT -X
$IPT -t nat -X
$IPT -t mangle -X

if [ "$1" = "stop" ]
then
echo "Firewall completely flushed! Now running with no firewall."
exit 0
fi

###############################################################################
#
# Rules Configuration
#

###############################################################################
#
# Filter Table
#
###############################################################################

# Set Policies

$IPT -P INPUT DROP
$IPT -P OUTPUT DROP
$IPT -P FORWARD DROP

###############################################################################
#
# User-Specified Chains
#
# Create user chains to reduce the number of rules each packet
# must traverse.

echo "Create and populate custom rule chains ..."

# Create a chain to filter INVALID packets

$IPT -N bad_packets

# Create another chain to filter bad tcp packets

$IPT -N bad_tcp_packets

# Create separate chains for icmp, tcp (incoming and outgoing),
# and incoming udp packets.

$IPT -N icmp_packets

# Used for UDP packets inbound from the Internet
$IPT -N udp_inbound

# Used to block outbound UDP services from internal network
# Default to allow all
$IPT -N udp_outbound

# Used to allow inbound services if desired
# Default fail except for established sessions
$IPT -N tcp_inbound

# Used to block outbound services from internal network
# Default to allow all
$IPT -N tcp_outbound

###############################################################################
#
# Populate User Chains
#

# bad_packets chain
#

# Drop packets received on the external interface
# claiming a source of the local network
$IPT -A bad_packets -p ALL -i $INET_IFACE -s $LOCAL_NET -j LOG \
--log-prefix "Illegal source: "

$IPT -A bad_packets -p ALL -i $INET_IFACE -s $LOCAL_NET -j DROP

# Drop INVALID packets immediately
$IPT -A bad_packets -p ALL -m state --state INVALID -j LOG \
--log-prefix "Invalid packet: "

$IPT -A bad_packets -p ALL -m state --state INVALID -j DROP

# Then check the tcp packets for additional problems
$IPT -A bad_packets -p tcp -j bad_tcp_packets

# All good, so return
$IPT -A bad_packets -p ALL -j RETURN

# bad_tcp_packets chain
#
# All tcp packets will traverse this chain.
# Every new connection attempt should begin with
# a syn packet. If it doesn't, it is likely a
# port scan. This drops packets in state
# NEW that are not flagged as syn packets.

# Return to the calling chain if the bad packets originate
# from the local interface. This maintains the approach
# throughout this firewall of a largely trusted internal
# network.
$IPT -A bad_tcp_packets -p tcp -i $LOCAL_IFACE -j RETURN

# However, I originally did apply this filter to the forward chain
# for packets originating from the internal network. While I have
# not conclusively determined its effect, it appears to have the
# interesting side effect of blocking some of the ad systems.
# Apparently some ad systems have the browser initiate a NEW
# connection that is not flagged as a syn packet to retrieve
# the ad image. If you wish to experiment further comment the
# rule above. If you try it, you may also wish to uncomment the
# rule below. It will keep those packets from being logged.
# There are a lot of them.
# $IPT -A bad_tcp_packets -p tcp -i $LOCAL_IFACE ! --syn -m state \
# --state NEW -j DROP

$IPT -A bad_tcp_packets -p tcp ! --syn -m state --state NEW -j LOG \
--log-prefix "New not syn: "
$IPT -A bad_tcp_packets -p tcp ! --syn -m state --state NEW -j DROP

$IPT -A bad_tcp_packets -p tcp --tcp-flags ALL NONE -j LOG \
--log-prefix "Stealth scan: "
$IPT -A bad_tcp_packets -p tcp --tcp-flags ALL NONE -j DROP

$IPT -A bad_tcp_packets -p tcp --tcp-flags ALL ALL -j LOG \
--log-prefix "Stealth scan: "
$IPT -A bad_tcp_packets -p tcp --tcp-flags ALL ALL -j DROP

$IPT -A bad_tcp_packets -p tcp --tcp-flags ALL FIN,URG,PSH -j LOG \
--log-prefix "Stealth scan: "
$IPT -A bad_tcp_packets -p tcp --tcp-flags ALL FIN,URG,PSH -j DROP

$IPT -A bad_tcp_packets -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j LOG \
--log-prefix "Stealth scan: "
$IPT -A bad_tcp_packets -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j DROP

$IPT -A bad_tcp_packets -p tcp --tcp-flags SYN,RST SYN,RST -j LOG \
--log-prefix "Stealth scan: "
$IPT -A bad_tcp_packets -p tcp --tcp-flags SYN,RST SYN,RST -j DROP

$IPT -A bad_tcp_packets -p tcp --tcp-flags SYN,FIN SYN,FIN -j LOG \
--log-prefix "Stealth scan: "
$IPT -A bad_tcp_packets -p tcp --tcp-flags SYN,FIN SYN,FIN -j DROP

# All good, so return
$IPT -A bad_tcp_packets -p tcp -j RETURN

# icmp_packets chain
#
# This chain is for inbound (from the Internet) icmp packets only.
# Type 8 (Echo Request) is not accepted by default
# Enable it if you want remote hosts to be able to reach you.
# 11 (Time Exceeded) is the only one accepted
# that would not already be covered by the established
# connection rule. Applied to INPUT on the external interface.
#
# See: http://www.ee.siue.edu/~rwalden/networking/icmp.html
# for more info on ICMP types.
#
# Note that the stateful settings allow replies to ICMP packets.
# These rules allow new packets of the specified types.

# ICMP packets should fit in a Layer 2 frame, thus they should
# never be fragmented. Fragmented ICMP packets are a typical sign
# of a denial of service attack.
$IPT -A icmp_packets --fragment -p ICMP -j LOG \
--log-prefix "ICMP Fragment: "
$IPT -A icmp_packets --fragment -p ICMP -j DROP

# Echo - uncomment to allow your system to be pinged.
# Uncomment the LOG command if you also want to log PING attempts
#
# $IPT -A icmp_packets -p ICMP -s 0/0 --icmp-type 8 -j LOG \
# --log-prefix "Ping detected: "
# $IPT -A icmp_packets -p ICMP -s 0/0 --icmp-type 8 -j ACCEPT

# By default, however, drop pings without logging. Blaster
# and other worms have infected systems blasting pings.
# Comment the line below if you want pings logged, but it
# will likely fill your logs.
$IPT -A icmp_packets -p ICMP -s 0/0 --icmp-type 8 -j DROP

# Time Exceeded
$IPT -A icmp_packets -p ICMP -s 0/0 --icmp-type 11 -j ACCEPT

# Not matched, so return so it will be logged
$IPT -A icmp_packets -p ICMP -j RETURN

# TCP & UDP
# Identify ports at:
# http://www.chebucto.ns.ca/~rakerman/port-table.html
# http://www.iana.org/assignments/port-numbers

# udp_inbound chain
#
# This chain describes the inbound UDP packets it will accept.
# It's applied to INPUT on the external or Internet interface.
# Note that the stateful settings allow replies.
# These rules are for new requests.
# It drops netbios packets (windows) immediately without logging.

# Drop netbios calls
# Please note that these rules do not really change the way the firewall
# treats netbios connections. Connections from the localhost and
# internal interface (if one exists) are accepted by default.
# Responses from the Internet to requests initiated by or through
# the firewall are also accepted by default. To get here, the
# packets would have to be part of a new request received by the
# Internet interface. You would have to manually add rules to
# accept these. I added these rules because some network connections,
# such as those via cable modems, tend to be filled with noise from
# unprotected Windows machines. These rules drop those packets
# quickly and without logging them. This prevents them from traversing
# the whole chain and keeps the log from getting cluttered with
# chatter from Windows systems.
$IPT -A udp_inbound -p UDP -s 0/0 --destination-port 137 -j DROP
$IPT -A udp_inbound -p UDP -s 0/0 --destination-port 138 -j DROP

# Ident requests (Port 113) must have a REJECT rule rather than the
# default DROP rule. This is the minimum requirement to avoid
# long delays while connecting. Also see the tcp_inbound rule.
$IPT -A udp_inbound -p UDP -s 0/0 --destination-port 113 -j REJECT

# A more sophisticated configuration could accept the ident requests.
# $IPT -A udp_inbound -p UDP -s 0/0 --destination-port 113 -j ACCEPT

# However, if this is a gateway system that masquerades/nats for internal systems
# and the internal systems wish to chat, a simple changing these rules to
# ACCEPT won't work. The ident daemon on the gateway will need to know how
# to handle the requests. The stock daemon in most linux distributions
# can't do that. oidentd is one package that can.
# See: http://dev.ojnk.net/[/qoute]

---klippt forts;
Xubuntu på flera maskiner. Men inte Unity!
Mer Terminalanvändande i Ubuntu vore bra. Och Xfce. Och Mate.
Användarvisningsbild
webaake
Inlägg: 3962
Blev medlem: 09 maj 2007, 09:46
OS: Xubuntu
Utgåva: 22.04 Jammy Jellyfish LTS

Re: Delning Av Internet Fungerar ej...

Inlägg av webaake »

fortsättning;
[qoute]
# Dynamic Address
# If DHCP, the initial request is a broadcast. The response
# doesn't exactly match the outbound packet. This explicitly
# allow the DHCP ports to alleviate this problem.
# If you receive your dynamic address by a different means, you
# can probably comment this line.
$IPT -A udp_inbound -p UDP -s 0/0 --source-port 67 --destination-port 68 \
-j ACCEPT


# Not matched, so return for logging
$IPT -A udp_inbound -p UDP -j RETURN

# udp_outbound chain
#
# This chain is used with a private network to prevent forwarding for
# UDP requests on specific protocols. Applied to the FORWARD rule from
# the internal network. Ends with an ACCEPT


# No match, so ACCEPT
$IPT -A udp_outbound -p UDP -s 0/0 -j ACCEPT

# tcp_inbound chain
#
# This chain is used to allow inbound connections to the
# system/gateway. Use with care. It defaults to none.
# It's applied on INPUT from the external or Internet interface.

# Ident requests (Port 113) must have a REJECT rule rather than the
# default DROP rule. This is the minimum requirement to avoid
# long delays while connecting. Also see the tcp_inbound rule.
$IPT -A tcp_inbound -p TCP -s 0/0 --destination-port 113 -j REJECT

# A more sophisticated configuration could accept the ident requests.
# $IPT -A tcp_inbound -p TCP -s 0/0 --destination-port 113 -j ACCEPT

# However, if this is a gateway system that masquerades/nats for internal systems
# and the internal systems wish to chat, a simple changing these rules to
# ACCEPT won't work. The ident daemon on the gateway will need to know how
# to handle the requests. The stock daemon in most linux distributions
# can't do that. oidentd is one package that can.
# See: http://dev.ojnk.net/


# Not matched, so return so it will be logged
$IPT -A tcp_inbound -p TCP -j RETURN

# tcp_outbound chain
#
# This chain is used with a private network to prevent forwarding for
# requests on specific protocols. Applied to the FORWARD rule from
# the internal network. Ends with an ACCEPT


# No match, so ACCEPT
$IPT -A tcp_outbound -p TCP -s 0/0 -j ACCEPT

###############################################################################
#
# INPUT Chain
#

echo "Process INPUT chain ..."

# Allow all on localhost interface
$IPT -A INPUT -p ALL -i $LO_IFACE -j ACCEPT

# Drop bad packets
$IPT -A INPUT -p ALL -j bad_packets

# DOCSIS compliant cable modems
# Some DOCSIS compliant cable modems send IGMP multicasts to find
# connected PCs. The multicast packets have the destination address
# 224.0.0.1. You can accept them. If you choose to do so,
# Uncomment the rule to ACCEPT them and comment the rule to DROP
# them The firewall will drop them here by default to avoid
# cluttering the log. The firewall will drop all multicasts
# to the entire subnet (224.0.0.1) by default. To only affect
# IGMP multicasts, change '-p ALL' to '-p 2'. Of course,
# if they aren't accepted elsewhere, it will only ensure that
# multicasts on other protocols are logged.
# Drop them without logging.
$IPT -A INPUT -p ALL -d 224.0.0.1 -j DROP
# The rule to accept the packets.
# $IPT -A INPUT -p ALL -d 224.0.0.1 -j ACCEPT

# Rules for the private network (accessing gateway system itself)
$IPT -A INPUT -p ALL -i $LOCAL_IFACE -s $LOCAL_NET -j ACCEPT
$IPT -A INPUT -p ALL -i $LOCAL_IFACE -d $LOCAL_BCAST -j ACCEPT


# Inbound Internet Packet Rules

# Accept Established Connections
$IPT -A INPUT -p ALL -i $INET_IFACE -m state --state ESTABLISHED,RELATED \
-j ACCEPT

# Route the rest to the appropriate user chain
$IPT -A INPUT -p TCP -i $INET_IFACE -j tcp_inbound
$IPT -A INPUT -p UDP -i $INET_IFACE -j udp_inbound
$IPT -A INPUT -p ICMP -i $INET_IFACE -j icmp_packets

# Drop without logging broadcasts that get this far.
# Cuts down on log clutter.
# Comment this line if testing new rules that impact
# broadcast protocols.
$IPT -A INPUT -m pkttype --pkt-type broadcast -j DROP

# Log packets that still don't match
$IPT -A INPUT -m limit --limit 3/minute --limit-burst 3 -j LOG \
--log-prefix "INPUT packet died: "

###############################################################################
#
# FORWARD Chain
#

echo "Process FORWARD chain ..."

# Used if forwarding for a private network

# Drop bad packets
$IPT -A FORWARD -p ALL -j bad_packets

# Accept TCP packets we want to forward from internal sources
$IPT -A FORWARD -p tcp -i $LOCAL_IFACE -j tcp_outbound

# Accept UDP packets we want to forward from internal sources
$IPT -A FORWARD -p udp -i $LOCAL_IFACE -j udp_outbound

# If not blocked, accept any other packets from the internal interface
$IPT -A FORWARD -p ALL -i $LOCAL_IFACE -j ACCEPT

# Deal with responses from the internet
$IPT -A FORWARD -i $INET_IFACE -m state --state ESTABLISHED,RELATED \
-j ACCEPT

# Log packets that still don't match
$IPT -A FORWARD -m limit --limit 3/minute --limit-burst 3 -j LOG \
--log-prefix "FORWARD packet died: "

###############################################################################
#
# OUTPUT Chain
#

echo "Process OUTPUT chain ..."

# Generally trust the firewall on output

# However, invalid icmp packets need to be dropped
# to prevent a possible exploit.
$IPT -A OUTPUT -m state -p icmp --state INVALID -j DROP

# Localhost
$IPT -A OUTPUT -p ALL -s $LO_IP -j ACCEPT
$IPT -A OUTPUT -p ALL -o $LO_IFACE -j ACCEPT

# To internal network
$IPT -A OUTPUT -p ALL -s $LOCAL_IP -j ACCEPT
$IPT -A OUTPUT -p ALL -o $LOCAL_IFACE -j ACCEPT

# To internet
$IPT -A OUTPUT -p ALL -o $INET_IFACE -j ACCEPT

# Log packets that still don't match
$IPT -A OUTPUT -m limit --limit 3/minute --limit-burst 3 -j LOG \
--log-prefix "OUTPUT packet died: "

###############################################################################
#
# nat table
#
###############################################################################

# The nat table is where network address translation occurs if there
# is a private network. If the gateway is connected to the Internet
# with a static IP, snat is used. If the gateway has a dynamic address,
# masquerade must be used instead. There is more overhead associated
# with masquerade, so snat is better when it can be used.
# The nat table has a builtin chain, PREROUTING, for dnat and redirects.
# Another, POSTROUTING, handles snat and masquerade.

echo "Load rules for nat table ..."

###############################################################################
#
# PREROUTING chain
#


###############################################################################
#
# POSTROUTING chain
#

$IPT -t nat -A POSTROUTING -o $INET_IFACE -j MASQUERADE

###############################################################################
#
# mangle table
#
###############################################################################

# The mangle table is used to alter packets. It can alter or mangle them in
# several ways. For the purposes of this generator, we only use its ability
# to alter the TTL in packets. However, it can be used to set netfilter
# mark values on specific packets. Those marks could then be used in another
# table like filter, to limit activities associated with a specific host, for
# instance. The TOS target can be used to set the Type of Service field in
# the IP header. Note that the TTL target might not be included in the
# distribution on your system. If it is not and you require it, you will
# have to add it. That may require that you build from source.

echo "Load rules for mangle"
[/quote]

Scriptet ovan ställer också in kerneln för NAT osv. Jag har kört med det i alla år och man kan redigera det manuellt i t ex gedit, kate eller vilken texteditor somhelst.
Xubuntu på flera maskiner. Men inte Unity!
Mer Terminalanvändande i Ubuntu vore bra. Och Xfce. Och Mate.
Användarvisningsbild
pata66
Inlägg: 391
Blev medlem: 18 jan 2009, 01:54
OS: Manjaro
Utgåva: 20.04 Focal Fossa LTS
Ort: Götene

Re: Delning Av Internet Fungerar ej...

Inlägg av pata66 »

Om jag skall använda det scriptet så kopierar jag in det i gedit eller? Vad döper jag filen till och var skall den sparas?

------------------------------------------------------------------------------------------------------------------------------------------------

Jag har startat om Firestarter och kört en wizard. Hör kommer en ny print på min Iptables list

Kod: Markera allt

pata@pata-laptop:~$ sudo iptables --list
[sudo] password for pata: 
Chain INPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     tcp  --  resolver1-g-fo.skanova.com  anywhere            tcp flags:!FIN,SYN,RST,ACK/SYN 
ACCEPT     udp  --  resolver1-g-fo.skanova.com  anywhere            
ACCEPT     tcp  --  resolver2-g-fo.skanova.com  anywhere            tcp flags:!FIN,SYN,RST,ACK/SYN 
ACCEPT     udp  --  resolver2-g-fo.skanova.com  anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     icmp --  anywhere             anywhere            limit: avg 10/sec burst 5 
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             host-90-235-148-227.mobileonline.telia.com 
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  --  host-90-235-148-227.mobileonline.telia.com  resolver1-g-fo.skanova.com tcp dpt:domain 
ACCEPT     udp  --  host-90-235-148-227.mobileonline.telia.com  resolver1-g-fo.skanova.com udp dpt:domain 
ACCEPT     tcp  --  host-90-235-148-227.mobileonline.telia.com  resolver2-g-fo.skanova.com tcp dpt:domain 
ACCEPT     udp  --  host-90-235-148-227.mobileonline.telia.com  resolver2-g-fo.skanova.com 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.1          anywhere            
ACCEPT     all  --  192.168.0.2          anywhere            
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:snmp 
ACCEPT     udp  --  anywhere             anywhere            udp dpt:snmp 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:domain 
ACCEPT     udp  --  anywhere             anywhere            udp dpt:domain 
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            
pata@pata-laptop:~$ 

Användarvisningsbild
webaake
Inlägg: 3962
Blev medlem: 09 maj 2007, 09:46
OS: Xubuntu
Utgåva: 22.04 Jammy Jellyfish LTS

Re: Delning Av Internet Fungerar ej...

Inlägg av webaake »

Det är inte lått att tolka koden som Firestarter genererar, fastän det nog är tänkt så. Jag kan dock inte se nåt om 'masquerade', vilket jag tycker borde finnas med.


Om du vill testa scriptet ovan så kan du kopiera in texten i t ex gedit;

sudo gedit /usr/local/bin/min_egna_firewall
(från en terminal)

Kopiera de bägge delarna från inläggen ovan och klistra in.
OBS: var mycket noga med att ta bort [qoute] och [/qoute] från koden !!!!

Nästa steg är att göra det exekverbart i en terminal;

sudo chmod +x /usr/local/bin/min_egna_firewall

Sedan kan du testa det genom att köra;

sudo min_egna_firewall &
Kolla resultatet i terminalen efter ev. felmeddelanden.
Funkar det så kan du se till att det går igång vid uppstart genom ;

sudo gedit /etc/rc.local
lägg in denna rad näst längst ned precis före 'exit 0' ;
/usr/local/bin/min_egna_firewall

Sista stegat;

sudo chmod +x /etc/rc.local

Nu skall det gå igång vid uppstart. rc.local körs som root , vilket iptables kräver.
Starta om rc.local med;

sudo sh /etc/rc.local
så slipper du starta om hela datorn bara för att testa.

Funkar inte scriptet så gå till länken ovan och gör ett nytt. Man lär sig mycket och dessutom har GUI:n som t ex Firestarter nästan alltid begränsningar, vilket Netfilter/Iptables nästan inte har.

Lycak till!

PS Sover de små liven?
Xubuntu på flera maskiner. Men inte Unity!
Mer Terminalanvändande i Ubuntu vore bra. Och Xfce. Och Mate.
Användarvisningsbild
pata66
Inlägg: 391
Blev medlem: 18 jan 2009, 01:54
OS: Manjaro
Utgåva: 20.04 Focal Fossa LTS
Ort: Götene

Re: Delning Av Internet Fungerar ej...

Inlägg av pata66 »

Jupp dom sover nu :) Jag ska ta och testa detta. Men en fråga först? Skall jag avinstallera Firestarter först eller spelar det ingen roll ?
Användarvisningsbild
webaake
Inlägg: 3962
Blev medlem: 09 maj 2007, 09:46
OS: Xubuntu
Utgåva: 22.04 Jammy Jellyfish LTS

Re: Delning Av Internet Fungerar ej...

Inlägg av webaake »

Eftersom det ändå inte fungerar så kan det vara lika bra. Scriptet ovan flushar iofs alla regler, men det är nog säkrast att avinstallera.
Xubuntu på flera maskiner. Men inte Unity!
Mer Terminalanvändande i Ubuntu vore bra. Och Xfce. Och Mate.
Användarvisningsbild
pata66
Inlägg: 391
Blev medlem: 18 jan 2009, 01:54
OS: Manjaro
Utgåva: 20.04 Focal Fossa LTS
Ort: Götene

Re: Delning Av Internet Fungerar ej...

Inlägg av pata66 »

>:( Fungerade inte det heller >:( Faen vad trött jag blir på detta. Men tack ändå för hjälpen

Fattar inte varför det inte fungerar ??

Detta får jag fram när jag startar om Firewall

Kod: Markera allt

pata@pata-laptop:~$ sudo sh /etc/rc.local
[sudo] password for pata: 
Loading kernel modules ...
net.ipv4.ip_forward = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.all.secure_redirects = 1
net.ipv4.conf.all.log_martians = 1
Flushing Tables ...
Create and populate custom rule chains ...
Process INPUT chain ...
Process FORWARD chain ...
Process OUTPUT chain ...
Load rules for nat table ...
Load rules for mangle
pata@pata-laptop:~$ 
Användarvisningsbild
webaake
Inlägg: 3962
Blev medlem: 09 maj 2007, 09:46
OS: Xubuntu
Utgåva: 22.04 Jammy Jellyfish LTS

Re: Delning Av Internet Fungerar ej...

Inlägg av webaake »

Det ser okej ut och då kanske man kan ringa in problemet till Xboxen? Har den gateway och DNS:er angivna? Eftersom det är fast IP måste man också ange DNS:er. Du har dem ovan i resolv.conf.

Kan du pinga Xboxen från linuxdatorn? Typ;

ping -c 3 192.168.0.2

Jag utgår från att linuxdatorn har kontakt med nätet.
Xubuntu på flera maskiner. Men inte Unity!
Mer Terminalanvändande i Ubuntu vore bra. Och Xfce. Och Mate.
Användarvisningsbild
pata66
Inlägg: 391
Blev medlem: 18 jan 2009, 01:54
OS: Manjaro
Utgåva: 20.04 Focal Fossa LTS
Ort: Götene

Re: Delning Av Internet Fungerar ej...

Inlägg av pata66 »

:) Tack för att du orkar med detta !!

Jag testade att pinga Xboxen och fick detta.

Kod: Markera allt

pata@pata-laptop:~$ ping -c 3 192.168.0.2
PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data.

--- 192.168.0.2 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2014ms

pata@pata-laptop:~$ 
Jag har som Dns värden på Xboxen
Primary DNS server 192.168.0.1
Secondery DNS server 192.168.0.1

Detta har fungerat tidigare.. Kanske bara tur då.. Men jag ska testa med värdena i från Resolf.config
nameserver 195.67.199.27
nameserver 195.67.199.28
Som nya DNS värden.
Skriv svar

Återgå till "Internet"