Portál AbcLinuxu, 1. května 2025 17:42
Jelikož jsem šťoural, neřídím se pravidlem dokud to funguje, nevrtej do toho. Tak jsem se rozhodl pro kompilaci nového kernelu. Chtěl jsem si rozjet IPSec. Idea jasná.
Na serveru běžel kernel vanilla-2.6.12.1 a modul hostap_pci pro připojení wifinou "ven". Zkompiloval jsem ten sám kernel s tím rozdílem, že jsem zatrhl všechny důležité volby pro IPSec. Vše přes ssh. Make->make modules_install->make install. Dodělávky v grubu a reboot. Všechno jsem dělal naprosto intuitivně, protože nějaké zkušenosti mám. A nic Ping mlčí...
Takže jsem sestru navigoval po telefonu, ať zjistí, co se děje. "make modules_install" smazal ten původní modul hostap. Takže cd /usr/src/hostap->make->make install->modprobe hostap_pci->invalid module format. To vše provedla sestra, která viděla terminál poprvé. Ale net nejede a dokud nepřijedu domů, tak nepojede. Ach jo
Tiskni
Sdílej:
deb http://ftp.cz.debian.org/debian jessie main contrib non-free
deb http://ftp.cz.debian.org/debian jessie main contrib non-free
deb http://ftp.cz.debian.org/debian jessie main contrib non-free
/etc/firewall
:
SUPERACCESS="127.0.0.1 1.2.3.4" ONEMERGENCY="superaccess" #can be open (disables firewall completely) or superaccess (enables firewall and open it for superaccess chain) AUTOEMERGENCY=on #whether execute delayed emergency fire after every firewall execution from ssh. EMERGENCYTIMEOUT=120 EMERGENCYSEMAPHORE=/tmp/firewallisokA potom skript
/sbin/setfire
:
. /etc/firewall #load configuration pravidla pro iptables....... if ! [ "$AUTOEMERGENCY" == "" ] ; then if /usr/bin/tty | grep -q '/dev/pts' ; then touch "$EMERGENCYSEMAPHORE" echo "Executing from SSH. Please delete semaphore file $EMERGENCYSEMAPHORE if the firewall is ok in $EMERGENCYTIMEOUT secs." 1>&2 nohup /sbin/emergencyfire 2>/dev/null 1>/dev/null & else logger -t "setfire" "Not activating autoemergency because setfire is not running on SSH console" fi; fi;No a nakonec skript
/sbin/emergencyfire
:
if [ -f "$EMERGENCYSEMAPHORE" ] ; then logger -t "setfire" "Sleeping for $EMERGENCYTIMEOUT secs because semaphore file $EMERGENCYSEMAPHORE exists" sleep "$EMERGENCYTIMEOUT" if ! [ -f "$EMERGENCYSEMAPHORE" ] ; then logger -t "setfire" "Firewall status confirmed, emergencyfire will NOT be executed" exit 0; fi; logger -t "setfire" "Firewall status NOT confirmed, executing emergency script" fi; case "$ONEMERGENCY" in open) /sbin/unsetfire ;; superaccess) #superaccess chain iptables -F superaccess 2>/dev/null iptables -N superaccess 2>/dev/null for addr in $SUPERACCESS ; do iptables -A superaccess -s $addr -j ACCEPT done; #logdeny chain iptables -F logdeny 2>/dev/null iptables -N logdeny 2>/dev/null iptables -A logdeny -j LOG iptables -A logdeny -j DROP iptables -F INPUT iptables -A INPUT -m state --state ESTABLISHED -j ACCEPT iptables -A INPUT -m state --state RELATED -j ACCEPT iptables -A INPUT -j superaccess iptables -A INPUT -j logdeny iptables -F FORWARD iptables -A FORWARD -m state --state ESTABLISHED -j ACCEPT iptables -A FORWARD -m state --state RELATED -j ACCEPT iptables -A FORWARD -j superaccess iptables -A FORWARD -j logdeny ;; esacNo a nakonec ve skriptu
/sbin/unsetfire
je kompletni vypnuti firewallu (pokud se pouziva volba onemergency=open).
A cele to volam z init skriptu firewall, ktery pri start vola /sbin/setfire
a pri stop /sbin/unsetfire
Radek
make clean
Zřejmě si make bere špatnou cestu KERNEL_PATH a bije se to se zdrojáky jiného jádra, které tam mám rozbalené. Prostě konflikt verzí.
Tak jsem jí SMSkou poslal další instrukce:
cd /usr/src/hostap-driver-0.3.9 make clean make KERNEL_PATH=/usr/src/linux make install
Pak rozhodně napíšu, jak to dopadlo
deb http://ftp.cz.debian.org/debian jessie main contrib non-free
deb http://ftp.cz.debian.org/debian jessie main contrib non-free
To mám skvělou sestřičkuTo se třeba o mojí sestře říct nedá...
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.