Portál AbcLinuxu, 14. května 2025 02:39
auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 10.0.0.101 netmask 255.255.255.0 network 10.0.0.0 broadcast 10.0.0.255 gateway 10.0.0.138Při pingu to píše:
connect: Network is unreachable
iptables -S (ipv4) -P INPUT ACCEPT -P FORWARD ACCEPT -P OUTPUT ACCEPT -N fail2ban-ssh -A INPUT -p tcp -m multiport --dports 22 -j fail2ban-ssh -A fail2ban-ssh -j RETURN ip6tables -S (ipv6) -P INPUT ACCEPT -P FORWARD ACCEPT -P OUTPUT ACCEPTA nespravne routy? Nerozumím.
ls /etc/rcS.d README S05bootlogd S12mtab.sh S35mountall.sh S39ifupdown S46mountnfs-bootclean.sh S99stop-bootlogd-single S02hostname.sh S05keymap.sh S18ifupdown-clean S35quota S40networking S48console-screen.sh S02mountkernfs.sh S08hwclockfirst.sh S20module-init-tools S36mountall-bootclean.sh S43portmap S55bootmisc.sh S03udev S10checkroot.sh S30checkfs.sh S36udev-mtab S44nfs-common S55urandom S04mountdevsubfs.sh S11hwclock.sh S30procps S37mountoverflowtmp S45mountnfs.sh S70x11-common
#!/bin/sh ### BEGIN INIT INFO # Provides: ifupdown-clean # Required-Start: checkroot # Required-Stop: # Default-Start: S # Default-Stop: # Short-Description: Clean old iterface status info during boot. ### END INIT INFO set -e . /lib/lsb/init-functions MYNAME="${0##*/}" PATH=/sbin:/bin [ -r /etc/default/ifupdown ] && . /etc/default/ifupdown # Note: The state file location is hardcoded in ifup|ifdown # it is used as a variable in this script order to ease transitions # to other locations by the package (not by the sysadmin), if you want # to setup an alternate location please use a symlink IFSTATE=/etc/network/run/ifstate case "$1" in start) log_begin_msg "Cleaning up ifupdown..." if [ -f $IFSTATE -a ! -L $IFSTATE ]; then rm -f "$IFSTATE" elif [ -f $IFSTATE ]; then # This is kinda bad :( >$IFSTATE fi log_end_msg 0 exit 0 ;; stop|restart|force-reload) exit 0 ;; *) echo "Usage: $0 {start|stop|restart|force-reload}" >&2 exit 3 ;; esacnetworking
#!/bin/sh -e ### BEGIN INIT INFO # Provides: networking # Required-Start: mountkernfs ifupdown $local_fs # Required-Stop: ifupdown $local_fs # Default-Start: S # Default-Stop: 0 6 # Short-Description: Raise network interfaces. ### END INIT INFO PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" [ -x /sbin/ifup ] || exit 0 . /lib/lsb/init-functions process_options() { [ -e /etc/network/options ] || return 0 log_warning_msg "/etc/network/options still exists and it will be IGNORED! Read README.Debian of netbase." } check_network_file_systems() { [ -e /proc/mounts ] || return 0 exec 9<&0 < /proc/mounts while read DEV MTPT FSTYPE REST; do case $DEV in /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*) log_warning_msg "not deconfiguring network interfaces: network devices still mounted." exit 0 ;; esac case $FSTYPE in nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs) log_warning_msg "not deconfiguring network interfaces: network file systems still mounted." exit 0 ;; esac done exec 0<&9 9<&- } case "$1" in start) process_options log_action_begin_msg "Configuring network interfaces" if ifup -a; then log_action_end_msg $? else log_action_end_msg $? fi ;; stop) check_network_file_systems log_action_begin_msg "Deconfiguring network interfaces" if ifdown -a --exclude=lo; then log_action_end_msg $? else log_action_end_msg $? fi ;; force-reload|restart) process_options log_action_begin_msg "Reconfiguring network interfaces" ifdown -a --exclude=lo || true if ifup -a --exclude=lo; then log_action_end_msg $? else log_action_end_msg $? fi ;; *) echo "Usage: /etc/init.d/networking {start|stop|restart|force-reload}" exit 1 ;; esac exit 0
Viz:
ls /etc/rcS.d | grep ifupdown-clean ls /etc/rcS.d | grep networking
server2:/home/halva# ifconfig eth0 Link encap:Ethernet HWadr 00:b0:d0:f9:cd:4d inet adr:10.0.0.101 Všesměr:10.0.0.255 Maska:255.255.255.0 inet6-adr: fe80::2b0:d0ff:fef9:cd4d/64 Rozsah:Linka AKTIVOVÁNO VŠESMĚROVÉ_VYSÍLÁNÍ BĚŽÍ MULTICAST MTU:1500 Metrika:1 RX packets:20619 errors:0 dropped:0 overruns:0 frame:0 TX packets:13516 errors:0 dropped:0 overruns:0 carrier:0 kolizí:0 délka odchozí fronty:1000 RX bytes:2074555 (1.9 MiB) TX bytes:2907284 (2.7 MiB)
lo=lo eth0=eth0
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.