`
lobin
  • 浏览: 430900 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

linux: DevOps

 
阅读更多
写道

 

使用快捷键复制(Ctrl+C)粘贴(Ctrl+V)是Linux下最常用的操作,一些Linux的发行版本,在粘贴的时候,会出现意料之外的事情,如Ctrl+C mysql-5.7.37-linux-glibc2.12-x86_64,但在粘贴的时候却是这样的结果^[[200~mysql-5.7.37-linux-glibc2.12-x86_64^[[201~,前后多了些特殊字符:^[[200~和^[[201~,可以执行以下命令:

$ printf "\e[?2004l"

 

搜索

find

 

# find . -name "*.c"

# find . -name "*x86*"

 

# find . -type f

 

# find . -type d

 

查找当前目录下可执行文件

# find . -type f -perm -u+x,g+x,o+x

 

查找当前目录下没有扩展名的文件

在linux下文件扩展名没什么意义。我们有时候生成了一大堆的临时文件,这些文件没有扩展名,删除起来太麻烦,所以要删除的话首先需要先把这些没有扩展名的文件给搜索出来:

# find . -regex ".[^.]+"

上面可以将这些没有扩展名的文件给搜索出来,然后我们可以指定一个action去删除它们,也就是-delete

# find . -regex ".[^.]+" -delete

或者

# find . -regex ".[^.]+" | xargs rm 

# find . -regex ".[^.]+" -exec rm '{}' \;

# find . -regex ".[^.]+" -exec rm {} +

# find . -regex ".[^.]+" -execdir rm '{}' \;

# find . -regex ".[^.]+" -execdir rm {} +

 

下面两种方式需要每次确认:

# find . -regex ".[^.]+" -ok rm '{}' \;

< rm ... ./clone_test_with_fn > ? y

< rm ... ./clone_test_x86 > ? y

< rm ... ./clone_test > ? y

< rm ... ./clone_test_with_fn1 > ? y

 

# find . -regex ".[^.]+" -okdir rm '{}' \;

< rm ... ./clone_test_with_fn > ? y

< rm ... ./clone_test_x86 > ? y

< rm ... ./clone_test > ? y

< rm ... ./clone_test_with_fn1 > ? y

 

正则表达式

正则表达式包括基本正则表达式和扩展正则表达式:

1、Basic Regular Expressions

2、Extended Regular Expressions

通常指的是POSIX规范的正则表达式:

1、POSIX Basic Regular Expressions

2、POSIX Extended Regular Expressions

 

POSIX Basic Regular Expressions,POSIX Extended Regular Expressions也称IEEE Std 1003.1标准。

写道

 

写道

 

还存在

1、GNU Basic Regular Expressions (grep, ed, sed)

2、GNU Extended Regular Expressions (egrep, awk, emacs)

 

3、The PCRE Open Source Regex Library

4、The PCRE2 Open Source Regex Library

 

find支持的正则表达式类型

 

正则表达式类型

emacs

posix-awk

posix-basic

posix-egrep

posix-extended

 

# find . -regex ".[^.]+"

默认采用的是emacs正则表达式,可以通过-regextype指定正则表达式类型,所以等同于:

# find . -regextype emacs -regex ".[^.]+"

 

以上面的例子为例:

除了posix-basic,采用其他的正则表达式类型,都可以使用上面的正则表达式:
# find . -regextype emacs -regex ".[^.]+"

# find . -regextype posix-awk -regex ".[^.]+"

# find . -regextype posix-egrep -regex ".[^.]+"

# find . -regextype posix-extended -regex ".[^.]+"

如果采用posix-basic正则表达式类型的话,应该对后面的"+"进行转义:

# find . -regextype posix-basic -regex ".[^.]\+"

或者换一种写法:

# find . -regextype posix-basic -regex "./[^.]*"

 

grep

 

匹配行

搜索不是空行的行,就是排除空行

# grep -v -n "^[[:space:]]\+$" test.c

 

搜索包含"//"的行

# grep -n "//" test.c

 

搜索不包含"//"的行

# grep -n -v "//" clone_test.c

 

搜索不是以"//"开头的行

# grep -v "^//" test.c

或者

# grep -n "^[^(//)]" test.c

 

搜索不包含空行和“//”的行

# grep -v -n -e "^[[:space:]]\+$" -e "//" test.c

 

搜索不包含空行和不以“//”开头的行

# grep -v -n -e "^[[:space:]]\+$" -e "^//" test.c

 

反向匹配行

指定“-v”

 

指定多个表达式

指定多个"-e PATTERN"或者“--regexp=PATTERN”

 

指定正则表达式类型

“-E”

或者“--extended-regexp”

 

“-F”

或者“--fixed-strings”, “--fixed-regexp”

 

“-G”

或者“--basic-regexp”

 

“-P”

或者“--perl-regexp”

 

 

egrep

 

sed

 

for

遍历C源程序并进行编译:

# for src in ucontext_test2.c ucontext_test3.c ucontext_test4.c ucontext_test5.c ucontext_test6.c ucontext_test.c 

> do 

>   echo Compiling $src ... ${src%.*}

>   gcc $src -o ${src%.*}

> done

等效于

# for src in ucontext_test2.c ucontext_test3.c ucontext_test4.c ucontext_test5.c ucontext_test6.c ucontext_test.c ; do    echo Compiling $src ... ${src%.*};   gcc $src -o ${src%.*}; done

等效于

# for src in ucontext_test2.c ucontext_test3.c ucontext_test4.c ucontext_test5.c ucontext_test6.c ucontext_test.c ; \

> do \

>   echo Compiling $src ... ${src%.*}; \

>   gcc $src -o ${src%.*}; \

> done

 

遍历当前目录下的C源程序并进行编译:

# for src in `ls *.c`

> do 

>   echo Compiling $src ... ${src%.*};

>   gcc $src -o ${src%.*};

> done

 

遍历当前目录及子目录下的C源程序并进行编译:

# for src in `find . -name "*.c"` 

> do 

>   echo Compiling $src ... ${src%.*}

>   gcc $src -o ${src%.*}

> done

Compiling ./ucontext_test2.c ... ./ucontext_test2

Compiling ./ucontext_test3.c ... ./ucontext_test3

Compiling ./ucontext_test5.c ... ./ucontext_test5

Compiling ./tmp/ucontext_test2.c ... ./tmp/ucontext_test2

Compiling ./tmp/ucontext_test3.c ... ./tmp/ucontext_test3

Compiling ./tmp/ucontext_test5.c ... ./tmp/ucontext_test5

Compiling ./tmp/ucontext_test.c ... ./tmp/ucontext_test

Compiling ./tmp/ucontext_test4.c ... ./tmp/ucontext_test4

Compiling ./tmp/ucontext_test6.c ... ./tmp/ucontext_test6

Compiling ./ucontext_test.c ... ./ucontext_test

Compiling ./ucontext_test4.c ... ./ucontext_test4

Compiling ./ucontext_test6.c ... ./ucontext_test6

 

# for src in `ls tmp/*.c`

> do

>   echo Compiling $src ... ${src%.*}

>   gcc $src -o ${src%.*}

> done

Compiling tmp/ucontext_test2.c ... tmp/ucontext_test2

Compiling tmp/ucontext_test3.c ... tmp/ucontext_test3

Compiling tmp/ucontext_test4.c ... tmp/ucontext_test4

Compiling tmp/ucontext_test5.c ... tmp/ucontext_test5

Compiling tmp/ucontext_test6.c ... tmp/ucontext_test6

Compiling tmp/ucontext_test.c ... tmp/ucontext_test

 

将当前目录下的文件名全部转换为小写

# for n in * ; do mv $n `echo $n | tr '[:upper:]' '[:lower:]'`; done

 

 

shell

 

sh

 

bash

 

ping

ping广播地址

默认情况下是ping不通广播地址的。

# ping -b 192.168.0.255

WARNING: pinging broadcast address

PING 192.168.0.255 (192.168.0.255) 56(84) bytes of data.

^C

--- 192.168.0.255 ping statistics ---

25 packets transmitted, 0 received, 100% packet loss, time 25132ms

 

ping 255.255.255.255也一样。

# ping -b 255.255.255.255

 

# cat /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts

1

# echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts

# cat /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts

0

# ping -b 192.168.0.255

WARNING: pinging broadcast address

PING 192.168.0.255 (192.168.0.255) 56(84) bytes of data.

64 bytes from 192.168.0.102: icmp_seq=1 ttl=64 time=42.6 ms

64 bytes from 192.168.0.102: icmp_seq=2 ttl=64 time=0.410 ms

64 bytes from 192.168.0.102: icmp_seq=3 ttl=64 time=0.511 ms

64 bytes from 192.168.0.102: icmp_seq=4 ttl=64 time=0.310 ms

64 bytes from 192.168.0.102: icmp_seq=5 ttl=64 time=0.540 ms

64 bytes from 192.168.0.102: icmp_seq=6 ttl=64 time=0.321 ms

64 bytes from 192.168.0.102: icmp_seq=7 ttl=64 time=13.3 ms

 

# ping -b 255.255.255.255

WARNING: pinging broadcast address

PING 255.255.255.255 (255.255.255.255) 56(84) bytes of data.

64 bytes from 192.168.0.102: icmp_seq=1 ttl=64 time=23.7 ms

64 bytes from 192.168.0.102: icmp_seq=2 ttl=64 time=0.414 ms

64 bytes from 192.168.0.102: icmp_seq=3 ttl=64 time=0.317 ms

64 bytes from 192.168.0.102: icmp_seq=4 ttl=64 time=0.484 ms

64 bytes from 192.168.0.102: icmp_seq=5 ttl=64 time=0.322 ms

 

ulimit

查看修改资源限制。针对单个进程的。

 

# ulimit -a

core file size          (blocks, -c) 0

data seg size           (kbytes, -d) unlimited

scheduling priority             (-e) 0

file size               (blocks, -f) unlimited

pending signals                 (-i) 15008

max locked memory       (kbytes, -l) 64

max memory size         (kbytes, -m) unlimited

open files                      (-n) 1024

pipe size            (512 bytes, -p) 8

POSIX message queues     (bytes, -q) 819200

real-time priority              (-r) 0

stack size              (kbytes, -s) 10240

cpu time               (seconds, -t) unlimited

max user processes              (-u) 15008

virtual memory          (kbytes, -v) unlimited

file locks                      (-x) unlimited

这里获取的是当前的soft限制。也可以指定-S。

 

 

RLIMIT_CORE core file size (blocks, -c)
RLIMIT_DATA data seg size (kbytes, -d)
RLIMIT_RTTIME scheduling priority (-e)
RLIMIT_FSIZE file size (blocks, -f)
RLIMIT_SIGPENDING pending signals (-i)
RLIMIT_MEMLOCK max locked memory (kbytes, -l)
  max memory size (kbytes, -m)
RLIMIT_NOFILE open files (-n)
  pipe size (512 bytes, -p)
RLIMIT_MSGQUEUE POSIX message queues (bytes, -q)
RLIMIT_RTPRIO real-time priority (-r)
RLIMIT_STACK stack size (kbytes, -s)
RLIMIT_CPU cpu time (seconds, -t)
RLIMIT_NPROC max user processes (-u)
RLIMIT_AS virtual memory (kbytes, -v)
RLIMIT_LOCKS file locks (-x)

 

 

# ulimit -S -a

等同于:

# ulimit -a

 

获取当前的hard限制

# ulimit -H -a

 

# ls /proc/sys/

crypto  debug  dev  fs  kernel  net  vm

 

# cat /proc/sys/fs/nr_open

1048576

 

sysctl

查看修改运行时内核参数。这里查看的参数都在/proc/sys/下。

 

/run/sysctl.d/*.conf

/etc/sysctl.d/*.conf

/usr/local/lib/sysctl.d/*.conf

/usr/lib/sysctl.d/*.conf

/lib/sysctl.d/*.conf

 

/etc/sysctl.conf

通常只有/etc/sysctl.conf这个内核参数配置文件列表。其他的配置文件没有可以自己去创建。

 

 

查看所有的运行时内核参数

# sysctl -a

kernel.sched_child_runs_first = 0

kernel.sched_min_granularity_ns = 2000000

kernel.sched_latency_ns = 10000000

kernel.sched_wakeup_granularity_ns = 2000000

kernel.sched_tunable_scaling = 1

kernel.sched_features = 7279

kernel.sched_migration_cost = 500000

kernel.sched_nr_migrate = 32

kernel.sched_time_avg = 1000

kernel.sched_shares_window = 10000000

kernel.timer_migration = 1

kernel.sched_rt_period_us = 1000000

kernel.sched_rt_runtime_us = 950000

kernel.sched_compat_yield = 0

kernel.sched_rr_timeslice_ms = 100

kernel.sched_autogroup_enabled = 0

kernel.sched_cfs_bandwidth_slice_us = 5000

kernel.panic = 0

kernel.exec-shield = 1

kernel.core_uses_pid = 1

kernel.core_pattern = core

kernel.core_pipe_limit = 0

kernel.tainted = 0

kernel.real-root-dev = 0

kernel.print-fatal-signals = 0

kernel.ctrl-alt-del = 0

kernel.ftrace_dump_on_oops = 0

kernel.modprobe = /sbin/modprobe

kernel.modules_disabled = 0

kernel.kexec_load_disabled = 0

kernel.hotplug = 

kernel.acct = 4230

kernel.sysrq = 0

kernel.cad_pid = 1

kernel.threads-max = 30017

kernel.random.poolsize = 4096

kernel.random.entropy_avail = 135

kernel.random.read_wakeup_threshold = 64

kernel.random.write_wakeup_threshold = 128

kernel.random.boot_id = db91bf44-dbd4-4957-9afa-10932aea9d9b

kernel.random.uuid = b0e45673-6d24-4af1-885d-e490d6c285cb

kernel.usermodehelper.bset = 42949672954294967295

kernel.usermodehelper.inheritable = 42949672954294967295

kernel.overflowuid = 65534

kernel.overflowgid = 65534

kernel.pid_max = 32768

kernel.panic_on_oops = 1

kernel.printk = 4417

kernel.printk_ratelimit = 5

kernel.printk_ratelimit_burst = 10

kernel.printk_delay = 0

kernel.dmesg_restrict = 0

kernel.kptr_restrict = 1

kernel.ngroups_max = 65536

kernel.cap_last_cap = 33

kernel.watchdog = 1

kernel.watchdog_thresh = 60

kernel.softlockup_panic = 0

kernel.hardlockup_panic = 1

kernel.softlockup_all_cpu_backtrace = 0

kernel.hardlockup_all_cpu_backtrace = 0

kernel.nmi_watchdog = 1

kernel.unknown_nmi_panic = 0

kernel.panic_on_unrecovered_nmi = 0

kernel.panic_on_io_nmi = 0

kernel.bootloader_type = 113

kernel.bootloader_version = 1

kernel.kstack_depth_to_print = 24

kernel.io_delay_type = 0

kernel.randomize_va_space = 2

kernel.acpi_video_flags = 0

kernel.hung_task_panic = 0

kernel.hung_task_check_count = 32768

kernel.hung_task_timeout_secs = 120

kernel.hung_task_warnings = 10

kernel.max_lock_depth = 1024

kernel.poweroff_cmd = /sbin/poweroff

kernel.keys.maxkeys = 200

kernel.keys.maxbytes = 20000

kernel.keys.root_maxkeys = 1000000

kernel.keys.root_maxbytes = 25000000

kernel.keys.gc_delay = 300

kernel.slow-work.min-threads = 2

kernel.slow-work.max-threads = 4

kernel.slow-work.vslow-percentage = 50

kernel.perf_event_paranoid = 1

kernel.perf_event_mlock_kb = 516

kernel.perf_event_max_sample_rate = 100000

kernel.blk_iopoll = 1

kernel.panic_on_warn = 0

kernel.ostype = Linux

kernel.osrelease = 2.6.32-754.el6.i686

kernel.version = #1 SMP Tue Jun 19 21:51:20 UTC 2018

kernel.hostname = localhost.localdomain

kernel.domainname = (none)

kernel.pty.max = 4096

kernel.pty.nr = 2

kernel.shmmax = 4294967295

kernel.shmall = 268435456

kernel.shmmni = 4096

kernel.shm_rmid_forced = 0

kernel.msgmax = 65536

kernel.msgmni = 1462

kernel.msgmnb = 65536

kernel.sem = 2503200032128

kernel.auto_msgmni = 1

kernel.sched_domain.cpu0.domain0.min_interval = 1

kernel.sched_domain.cpu0.domain0.max_interval = 4

kernel.sched_domain.cpu0.domain0.busy_idx = 2

kernel.sched_domain.cpu0.domain0.idle_idx = 1

kernel.sched_domain.cpu0.domain0.newidle_idx = 0

kernel.sched_domain.cpu0.domain0.wake_idx = 0

kernel.sched_domain.cpu0.domain0.forkexec_idx = 0

kernel.sched_domain.cpu0.domain0.busy_factor = 64

kernel.sched_domain.cpu0.domain0.imbalance_pct = 125

kernel.sched_domain.cpu0.domain0.cache_nice_tries = 1

kernel.sched_domain.cpu0.domain0.flags = 4143

kernel.sched_domain.cpu0.domain0.name = CPU

kernel.sched_domain.cpu1.domain0.min_interval = 1

kernel.sched_domain.cpu1.domain0.max_interval = 4

kernel.sched_domain.cpu1.domain0.busy_idx = 2

kernel.sched_domain.cpu1.domain0.idle_idx = 1

kernel.sched_domain.cpu1.domain0.newidle_idx = 0

kernel.sched_domain.cpu1.domain0.wake_idx = 0

kernel.sched_domain.cpu1.domain0.forkexec_idx = 0

kernel.sched_domain.cpu1.domain0.busy_factor = 64

kernel.sched_domain.cpu1.domain0.imbalance_pct = 125

kernel.sched_domain.cpu1.domain0.cache_nice_tries = 1

kernel.sched_domain.cpu1.domain0.flags = 4143

kernel.sched_domain.cpu1.domain0.name = CPU

vm.overcommit_memory = 0

vm.panic_on_oom = 0

vm.oom_kill_allocating_task = 0

vm.extfrag_threshold = 500

vm.oom_dump_tasks = 1

vm.would_have_oomkilled = 0

vm.overcommit_ratio = 50

vm.overcommit_kbytes = 0

vm.page-cluster = 3

vm.dirty_background_ratio = 10

vm.dirty_background_bytes = 0

vm.dirty_ratio = 20

vm.dirty_bytes = 0

vm.dirty_writeback_centisecs = 500

vm.dirty_expire_centisecs = 3000

vm.nr_pdflush_threads = 0

vm.swappiness = 60

vm.nr_hugepages = 0

vm.hugetlb_shm_group = 0

vm.hugepages_treat_as_movable = 0

vm.nr_overcommit_hugepages = 0

vm.lowmem_reserve_ratio = 2563232

vm.drop_caches = 0

vm.min_free_kbytes = 3794

vm.extra_free_kbytes = 0

vm.unmap_area_factor = 0

vm.meminfo_legacy_layout = 1

vm.percpu_pagelist_fraction = 0

vm.max_map_count = 65530

vm.laptop_mode = 0

vm.block_dump = 0

vm.vfs_cache_pressure = 100

vm.legacy_va_layout = 0

vm.stat_interval = 1

vm.mmap_min_addr = 4096

vm.vdso_enabled = 1

vm.highmem_is_dirtyable = 0

vm.scan_unevictable_pages = 0

vm.admin_reserve_kbytes = 8192

fs.inode-nr = 17843178

fs.inode-state = 1784317800000

fs.file-nr = 7680191312

fs.file-max = 191312

fs.nr_open = 1048576

fs.dentry-state = 242471609645000

fs.overflowuid = 65534

fs.overflowgid = 65534

fs.leases-enable = 1

fs.dir-notify-enable = 1

fs.lease-break-time = 45

fs.aio-nr = 2661

fs.aio-max-nr = 1048576

fs.inotify.max_user_instances = 128

fs.inotify.max_user_watches = 8192

fs.inotify.max_queued_events = 16384

fs.epoll.max_user_watches = 277314

fs.suid_dumpable = 0

fs.binfmt_misc.status = enabled

fs.quota.lookups = 0

fs.quota.drops = 0

fs.quota.reads = 0

fs.quota.writes = 0

fs.quota.cache_hits = 0

fs.quota.allocated_dquots = 0

fs.quota.free_dquots = 0

fs.quota.syncs = 0

fs.quota.warnings = 1

fs.mqueue.queues_max = 256

fs.mqueue.msg_max = 10

fs.mqueue.msgsize_max = 8192

fs.mqueue.msg_default = 10

fs.mqueue.msgsize_default = 8192

debug.exception-trace = 1

debug.kprobes-optimization = 1

dev.scsi.logging_level = 0

dev.raid.speed_limit_min = 1000

dev.raid.speed_limit_max = 200000

dev.hpet.max-user-freq = 64

dev.mac_hid.mouse_button_emulation = 0

dev.mac_hid.mouse_button2_keycode = 97

dev.mac_hid.mouse_button3_keycode = 100

dev.cdrom.info = CD-ROM information, Id: cdrom.c 3.20 2003/12/17

dev.cdrom.info = 

dev.cdrom.info = drive name:sr0

dev.cdrom.info = drive speed:1

dev.cdrom.info = drive # of slots:1

dev.cdrom.info = Can close tray:1

dev.cdrom.info = Can open tray:1

dev.cdrom.info = Can lock tray:1

dev.cdrom.info = Can change speed:1

dev.cdrom.info = Can select disk:0

dev.cdrom.info = Can read multisession:1

dev.cdrom.info = Can read MCN:1

dev.cdrom.info = Reports media changed:1

dev.cdrom.info = Can play audio:1

dev.cdrom.info = Can write CD-R:0

dev.cdrom.info = Can write CD-RW:0

dev.cdrom.info = Can read DVD:0

dev.cdrom.info = Can write DVD-R:0

dev.cdrom.info = Can write DVD-RAM:0

dev.cdrom.info = Can read MRW:1

dev.cdrom.info = Can write MRW:1

dev.cdrom.info = Can write RAM:1

dev.cdrom.info = 

dev.cdrom.info = 

dev.cdrom.autoclose = 1

dev.cdrom.autoeject = 0

dev.cdrom.debug = 0

dev.cdrom.lock = 1

dev.cdrom.check_media = 0

dev.parport.default.timeslice = 200

dev.parport.default.spintime = 500

dev.parport.parport0.spintime = 500

dev.parport.parport0.base-addr = 8880

dev.parport.parport0.irq = 7

dev.parport.parport0.dma = -1

dev.parport.parport0.modes = PCSPP,TRISTATE

dev.parport.parport0.devices.active = none

net.netfilter.nf_log.0 = NONE

net.netfilter.nf_log.1 = NONE

net.netfilter.nf_log.2 = nfnetlink_log

net.netfilter.nf_log.3 = NONE

net.netfilter.nf_log.4 = NONE

net.netfilter.nf_log.5 = NONE

net.netfilter.nf_log.6 = NONE

net.netfilter.nf_log.7 = NONE

net.netfilter.nf_log.8 = NONE

net.netfilter.nf_log.9 = NONE

net.netfilter.nf_log.10 = NONE

net.netfilter.nf_log.11 = NONE

net.netfilter.nf_log.12 = NONE

net.netfilter.nf_conntrack_generic_timeout = 600

net.netfilter.nf_conntrack_tcp_timeout_syn_sent = 120

net.netfilter.nf_conntrack_tcp_timeout_syn_recv = 60

net.netfilter.nf_conntrack_tcp_timeout_established = 432000

net.netfilter.nf_conntrack_tcp_timeout_fin_wait = 120

net.netfilter.nf_conntrack_tcp_timeout_close_wait = 60

net.netfilter.nf_conntrack_tcp_timeout_last_ack = 30

net.netfilter.nf_conntrack_tcp_timeout_time_wait = 120

net.netfilter.nf_conntrack_tcp_timeout_close = 10

net.netfilter.nf_conntrack_tcp_timeout_max_retrans = 300

net.netfilter.nf_conntrack_tcp_timeout_unacknowledged = 300

net.netfilter.nf_conntrack_tcp_loose = 1

net.netfilter.nf_conntrack_tcp_be_liberal = 0

net.netfilter.nf_conntrack_tcp_max_retrans = 3

net.netfilter.nf_conntrack_udp_timeout = 30

net.netfilter.nf_conntrack_udp_timeout_stream = 180

net.netfilter.nf_conntrack_icmpv6_timeout = 30

net.netfilter.nf_conntrack_icmp_timeout = 30

net.netfilter.nf_conntrack_acct = 0

net.netfilter.nf_conntrack_events = 1

net.netfilter.nf_conntrack_events_retry_timeout = 15

net.netfilter.nf_conntrack_max = 65536

net.netfilter.nf_conntrack_count = 2

net.netfilter.nf_conntrack_buckets = 16384

net.netfilter.nf_conntrack_checksum = 1

net.netfilter.nf_conntrack_log_invalid = 0

net.netfilter.nf_conntrack_expect_max = 256

net.core.somaxconn = 128

net.core.xfrm_aevent_etime = 10

net.core.xfrm_aevent_rseqth = 2

net.core.xfrm_larval_drop = 1

net.core.xfrm_acq_expires = 30

net.core.wmem_max = 112640

net.core.rmem_max = 112640

net.core.wmem_default = 112640

net.core.rmem_default = 112640

net.core.dev_weight = 64

net.core.netdev_max_backlog = 1000

net.core.netdev_rss_key = 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

net.core.message_cost = 5

net.core.message_burst = 10

net.core.optmem_max = 10240

net.core.rps_sock_flow_entries = 0

net.core.busy_poll = 0

net.core.busy_read = 0

net.core.default_qdisc = pfifo_fast

net.core.netdev_budget = 300

net.core.warnings = 1

net.ipv4.route.gc_thresh = 32768

net.ipv4.route.max_size = 524288

net.ipv4.route.gc_min_interval = 0

net.ipv4.route.gc_min_interval_ms = 500

net.ipv4.route.gc_timeout = 300

net.ipv4.route.gc_interval = 60

net.ipv4.route.redirect_load = 20

net.ipv4.route.redirect_number = 9

net.ipv4.route.redirect_silence = 20480

net.ipv4.route.error_cost = 1000

net.ipv4.route.error_burst = 5000

net.ipv4.route.gc_elasticity = 8

net.ipv4.route.mtu_expires = 600

net.ipv4.route.min_pmtu = 552

net.ipv4.route.min_adv_mss = 256

net.ipv4.route.secret_interval = 600

net.ipv4.neigh.default.mcast_solicit = 3

net.ipv4.neigh.default.ucast_solicit = 3

net.ipv4.neigh.default.app_solicit = 0

net.ipv4.neigh.default.retrans_time = 99

net.ipv4.neigh.default.base_reachable_time = 30

net.ipv4.neigh.default.delay_first_probe_time = 5

net.ipv4.neigh.default.gc_stale_time = 60

net.ipv4.neigh.default.unres_qlen = 3

net.ipv4.neigh.default.proxy_qlen = 64

net.ipv4.neigh.default.anycast_delay = 99

net.ipv4.neigh.default.proxy_delay = 79

net.ipv4.neigh.default.locktime = 99

net.ipv4.neigh.default.retrans_time_ms = 1000

net.ipv4.neigh.default.base_reachable_time_ms = 30000

net.ipv4.neigh.default.gc_interval = 30

net.ipv4.neigh.default.gc_thresh1 = 128

net.ipv4.neigh.default.gc_thresh2 = 512

net.ipv4.neigh.default.gc_thresh3 = 1024

net.ipv4.neigh.lo.mcast_solicit = 3

net.ipv4.neigh.lo.ucast_solicit = 3

net.ipv4.neigh.lo.app_solicit = 0

net.ipv4.neigh.lo.retrans_time = 99

net.ipv4.neigh.lo.base_reachable_time = 30

net.ipv4.neigh.lo.delay_first_probe_time = 5

net.ipv4.neigh.lo.gc_stale_time = 60

net.ipv4.neigh.lo.unres_qlen = 3

net.ipv4.neigh.lo.proxy_qlen = 64

net.ipv4.neigh.lo.anycast_delay = 99

net.ipv4.neigh.lo.proxy_delay = 79

net.ipv4.neigh.lo.locktime = 99

net.ipv4.neigh.lo.retrans_time_ms = 1000

net.ipv4.neigh.lo.base_reachable_time_ms = 30000

net.ipv4.neigh.eth0.mcast_solicit = 3

net.ipv4.neigh.eth0.ucast_solicit = 3

net.ipv4.neigh.eth0.app_solicit = 0

net.ipv4.neigh.eth0.retrans_time = 99

net.ipv4.neigh.eth0.base_reachable_time = 30

net.ipv4.neigh.eth0.delay_first_probe_time = 5

net.ipv4.neigh.eth0.gc_stale_time = 60

net.ipv4.neigh.eth0.unres_qlen = 3

net.ipv4.neigh.eth0.proxy_qlen = 64

net.ipv4.neigh.eth0.anycast_delay = 99

net.ipv4.neigh.eth0.proxy_delay = 79

net.ipv4.neigh.eth0.locktime = 99

net.ipv4.neigh.eth0.retrans_time_ms = 1000

net.ipv4.neigh.eth0.base_reachable_time_ms = 30000

net.ipv4.neigh.virbr0.mcast_solicit = 3

net.ipv4.neigh.virbr0.ucast_solicit = 3

net.ipv4.neigh.virbr0.app_solicit = 0

net.ipv4.neigh.virbr0.retrans_time = 99

net.ipv4.neigh.virbr0.base_reachable_time = 30

net.ipv4.neigh.virbr0.delay_first_probe_time = 5

net.ipv4.neigh.virbr0.gc_stale_time = 60

net.ipv4.neigh.virbr0.unres_qlen = 3

net.ipv4.neigh.virbr0.proxy_qlen = 64

net.ipv4.neigh.virbr0.anycast_delay = 99

net.ipv4.neigh.virbr0.proxy_delay = 79

net.ipv4.neigh.virbr0.locktime = 99

net.ipv4.neigh.virbr0.retrans_time_ms = 1000

net.ipv4.neigh.virbr0.base_reachable_time_ms = 30000

net.ipv4.neigh.virbr0-nic.mcast_solicit = 3

net.ipv4.neigh.virbr0-nic.ucast_solicit = 3

net.ipv4.neigh.virbr0-nic.app_solicit = 0

net.ipv4.neigh.virbr0-nic.retrans_time = 99

net.ipv4.neigh.virbr0-nic.base_reachable_time = 30

net.ipv4.neigh.virbr0-nic.delay_first_probe_time = 5

net.ipv4.neigh.virbr0-nic.gc_stale_time = 60

net.ipv4.neigh.virbr0-nic.unres_qlen = 3

net.ipv4.neigh.virbr0-nic.proxy_qlen = 64

net.ipv4.neigh.virbr0-nic.anycast_delay = 99

net.ipv4.neigh.virbr0-nic.proxy_delay = 79

net.ipv4.neigh.virbr0-nic.locktime = 99

net.ipv4.neigh.virbr0-nic.retrans_time_ms = 1000

net.ipv4.neigh.virbr0-nic.base_reachable_time_ms = 30000

net.ipv4.tcp_timestamps = 1

net.ipv4.tcp_window_scaling = 1

net.ipv4.tcp_sack = 1

net.ipv4.tcp_retrans_collapse = 1

net.ipv4.ip_default_ttl = 64

net.ipv4.ip_nonlocal_bind = 0

net.ipv4.tcp_syn_retries = 5

net.ipv4.tcp_synack_retries = 5

net.ipv4.tcp_max_orphans = 65536

net.ipv4.tcp_max_tw_buckets = 65536

net.ipv4.ip_dynaddr = 0

net.ipv4.tcp_keepalive_time = 7200

net.ipv4.tcp_keepalive_probes = 9

net.ipv4.tcp_keepalive_intvl = 75

net.ipv4.tcp_retries1 = 3

net.ipv4.tcp_retries2 = 15

net.ipv4.tcp_fin_timeout = 60

net.ipv4.tcp_syncookies = 1

net.ipv4.tcp_tw_recycle = 0

net.ipv4.tcp_abort_on_overflow = 0

net.ipv4.tcp_stdurg = 0

net.ipv4.tcp_rfc1337 = 0

net.ipv4.tcp_max_syn_backlog = 512

net.ipv4.ip_local_port_range = 3276860999

net.ipv4.ip_local_reserved_ports = 

net.ipv4.igmp_max_memberships = 20

net.ipv4.igmp_max_msf = 10

net.ipv4.inet_peer_threshold = 65664

net.ipv4.inet_peer_minttl = 120

net.ipv4.inet_peer_maxttl = 600

net.ipv4.inet_peer_gc_mintime = 10

net.ipv4.inet_peer_gc_maxtime = 120

net.ipv4.tcp_orphan_retries = 0

net.ipv4.tcp_fack = 1

net.ipv4.tcp_reordering = 3

net.ipv4.tcp_ecn = 2

net.ipv4.tcp_dsack = 1

net.ipv4.tcp_mem = 6854491392137088

net.ipv4.tcp_wmem = 4096163842924544

net.ipv4.tcp_rmem = 4096873802924544

net.ipv4.tcp_app_win = 31

net.ipv4.tcp_adv_win_scale = 2

net.ipv4.tcp_tw_reuse = 0

net.ipv4.tcp_frto = 2

net.ipv4.tcp_frto_response = 0

net.ipv4.tcp_low_latency = 0

net.ipv4.tcp_no_metrics_save = 0

net.ipv4.tcp_moderate_rcvbuf = 1

net.ipv4.tcp_tso_win_divisor = 3

net.ipv4.tcp_congestion_control = cubic

net.ipv4.tcp_abc = 0

net.ipv4.tcp_mtu_probing = 0

net.ipv4.tcp_base_mss = 512

net.ipv4.tcp_workaround_signed_windows = 0

net.ipv4.tcp_challenge_ack_limit = 1000

net.ipv4.tcp_limit_output_bytes = 262144

net.ipv4.tcp_dma_copybreak = 4096

net.ipv4.tcp_slow_start_after_idle = 1

net.ipv4.cipso_cache_enable = 1

net.ipv4.cipso_cache_bucket_size = 10

net.ipv4.cipso_rbm_optfmt = 0

net.ipv4.cipso_rbm_strictvalid = 1

net.ipv4.tcp_available_congestion_control = cubic reno

net.ipv4.tcp_allowed_congestion_control = cubic reno

net.ipv4.tcp_max_ssthresh = 0

net.ipv4.tcp_thin_linear_timeouts = 0

net.ipv4.tcp_thin_dupack = 0

net.ipv4.tcp_min_tso_segs = 2

net.ipv4.tcp_invalid_ratelimit = 500

net.ipv4.udp_mem = 6854491392137088

net.ipv4.udp_rmem_min = 4096

net.ipv4.udp_wmem_min = 4096

net.ipv4.conf.all.forwarding = 1

net.ipv4.conf.all.mc_forwarding = 0

net.ipv4.conf.all.accept_redirects = 0

net.ipv4.conf.all.secure_redirects = 1

net.ipv4.conf.all.shared_media = 1

net.ipv4.conf.all.rp_filter = 0

net.ipv4.conf.all.send_redirects = 1

net.ipv4.conf.all.accept_source_route = 0

net.ipv4.conf.all.src_valid_mark = 0

net.ipv4.conf.all.proxy_arp = 0

net.ipv4.conf.all.medium_id = 0

net.ipv4.conf.all.bootp_relay = 0

net.ipv4.conf.all.log_martians = 0

net.ipv4.conf.all.tag = 0

net.ipv4.conf.all.arp_filter = 0

net.ipv4.conf.all.arp_announce = 0

net.ipv4.conf.all.arp_ignore = 0

net.ipv4.conf.all.arp_accept = 0

net.ipv4.conf.all.arp_notify = 0

net.ipv4.conf.all.proxy_arp_pvlan = 0

net.ipv4.conf.all.disable_xfrm = 0

net.ipv4.conf.all.disable_policy = 0

net.ipv4.conf.all.force_igmp_version = 0

net.ipv4.conf.all.promote_secondaries = 0

net.ipv4.conf.all.accept_local = 0

net.ipv4.conf.all.route_localnet = 0

net.ipv4.conf.default.forwarding = 1

net.ipv4.conf.default.mc_forwarding = 0

net.ipv4.conf.default.accept_redirects = 1

net.ipv4.conf.default.secure_redirects = 1

net.ipv4.conf.default.shared_media = 1

net.ipv4.conf.default.rp_filter = 0

net.ipv4.conf.default.send_redirects = 1

net.ipv4.conf.default.accept_source_route = 0

net.ipv4.conf.default.src_valid_mark = 0

net.ipv4.conf.default.proxy_arp = 0

net.ipv4.conf.default.medium_id = 0

net.ipv4.conf.default.bootp_relay = 0

net.ipv4.conf.default.log_martians = 0

net.ipv4.conf.default.tag = 0

net.ipv4.conf.default.arp_filter = 0

net.ipv4.conf.default.arp_announce = 0

net.ipv4.conf.default.arp_ignore = 0

net.ipv4.conf.default.arp_accept = 0

net.ipv4.conf.default.arp_notify = 0

net.ipv4.conf.default.proxy_arp_pvlan = 0

net.ipv4.conf.default.disable_xfrm = 0

net.ipv4.conf.default.disable_policy = 0

net.ipv4.conf.default.force_igmp_version = 0

net.ipv4.conf.default.promote_secondaries = 0

net.ipv4.conf.default.accept_local = 0

net.ipv4.conf.default.route_localnet = 0

net.ipv4.conf.lo.forwarding = 1

net.ipv4.conf.lo.mc_forwarding = 0

net.ipv4.conf.lo.accept_redirects = 1

net.ipv4.conf.lo.secure_redirects = 1

net.ipv4.conf.lo.shared_media = 1

net.ipv4.conf.lo.rp_filter = 0

net.ipv4.conf.lo.send_redirects = 1

net.ipv4.conf.lo.accept_source_route = 0

net.ipv4.conf.lo.src_valid_mark = 0

net.ipv4.conf.lo.proxy_arp = 0

net.ipv4.conf.lo.medium_id = 0

net.ipv4.conf.lo.bootp_relay = 0

net.ipv4.conf.lo.log_martians = 0

net.ipv4.conf.lo.tag = 0

net.ipv4.conf.lo.arp_filter = 0

net.ipv4.conf.lo.arp_announce = 0

net.ipv4.conf.lo.arp_ignore = 0

net.ipv4.conf.lo.arp_accept = 0

net.ipv4.conf.lo.arp_notify = 0

net.ipv4.conf.lo.proxy_arp_pvlan = 0

net.ipv4.conf.lo.disable_xfrm = 1

net.ipv4.conf.lo.disable_policy = 1

net.ipv4.conf.lo.force_igmp_version = 0

net.ipv4.conf.lo.promote_secondaries = 0

net.ipv4.conf.lo.accept_local = 0

net.ipv4.conf.lo.route_localnet = 0

net.ipv4.conf.eth0.forwarding = 1

net.ipv4.conf.eth0.mc_forwarding = 0

net.ipv4.conf.eth0.accept_redirects = 1

net.ipv4.conf.eth0.secure_redirects = 1

net.ipv4.conf.eth0.shared_media = 1

net.ipv4.conf.eth0.rp_filter = 0

net.ipv4.conf.eth0.send_redirects = 1

net.ipv4.conf.eth0.accept_source_route = 0

net.ipv4.conf.eth0.src_valid_mark = 0

net.ipv4.conf.eth0.proxy_arp = 0

net.ipv4.conf.eth0.medium_id = 0

net.ipv4.conf.eth0.bootp_relay = 0

net.ipv4.conf.eth0.log_martians = 0

net.ipv4.conf.eth0.tag = 0

net.ipv4.conf.eth0.arp_filter = 0

net.ipv4.conf.eth0.arp_announce = 0

net.ipv4.conf.eth0.arp_ignore = 0

net.ipv4.conf.eth0.arp_accept = 0

net.ipv4.conf.eth0.arp_notify = 0

net.ipv4.conf.eth0.proxy_arp_pvlan = 0

net.ipv4.conf.eth0.disable_xfrm = 0

net.ipv4.conf.eth0.disable_policy = 0

net.ipv4.conf.eth0.force_igmp_version = 0

net.ipv4.conf.eth0.promote_secondaries = 0

net.ipv4.conf.eth0.accept_local = 0

net.ipv4.conf.eth0.route_localnet = 0

net.ipv4.conf.virbr0.forwarding = 1

net.ipv4.conf.virbr0.mc_forwarding = 0

net.ipv4.conf.virbr0.accept_redirects = 1

net.ipv4.conf.virbr0.secure_redirects = 1

net.ipv4.conf.virbr0.shared_media = 1

net.ipv4.conf.virbr0.rp_filter = 1

net.ipv4.conf.virbr0.send_redirects = 1

net.ipv4.conf.virbr0.accept_source_route = 0

net.ipv4.conf.virbr0.src_valid_mark = 0

net.ipv4.conf.virbr0.proxy_arp = 0

net.ipv4.conf.virbr0.medium_id = 0

net.ipv4.conf.virbr0.bootp_relay = 0

net.ipv4.conf.virbr0.log_martians = 0

net.ipv4.conf.virbr0.tag = 0

net.ipv4.conf.virbr0.arp_filter = 0

net.ipv4.conf.virbr0.arp_announce = 0

net.ipv4.conf.virbr0.arp_ignore = 0

net.ipv4.conf.virbr0.arp_accept = 0

net.ipv4.conf.virbr0.arp_notify = 0

net.ipv4.conf.virbr0.proxy_arp_pvlan = 0

net.ipv4.conf.virbr0.disable_xfrm = 0

net.ipv4.conf.virbr0.disable_policy = 0

net.ipv4.conf.virbr0.force_igmp_version = 0

net.ipv4.conf.virbr0.promote_secondaries = 0

net.ipv4.conf.virbr0.accept_local = 0

net.ipv4.conf.virbr0.route_localnet = 0

net.ipv4.conf.virbr0-nic.forwarding = 1

net.ipv4.conf.virbr0-nic.mc_forwarding = 0

net.ipv4.conf.virbr0-nic.accept_redirects = 1

net.ipv4.conf.virbr0-nic.secure_redirects = 1

net.ipv4.conf.virbr0-nic.shared_media = 1

net.ipv4.conf.virbr0-nic.rp_filter = 1

net.ipv4.conf.virbr0-nic.send_redirects = 1

net.ipv4.conf.virbr0-nic.accept_source_route = 0

net.ipv4.conf.virbr0-nic.src_valid_mark = 0

net.ipv4.conf.virbr0-nic.proxy_arp = 0

net.ipv4.conf.virbr0-nic.medium_id = 0

net.ipv4.conf.virbr0-nic.bootp_relay = 0

net.ipv4.conf.virbr0-nic.log_martians = 0

net.ipv4.conf.virbr0-nic.tag = 0

net.ipv4.conf.virbr0-nic.arp_filter = 0

net.ipv4.conf.virbr0-nic.arp_announce = 0

net.ipv4.conf.virbr0-nic.arp_ignore = 0

net.ipv4.conf.virbr0-nic.arp_accept = 0

net.ipv4.conf.virbr0-nic.arp_notify = 0

net.ipv4.conf.virbr0-nic.proxy_arp_pvlan = 0

net.ipv4.conf.virbr0-nic.disable_xfrm = 0

net.ipv4.conf.virbr0-nic.disable_policy = 0

net.ipv4.conf.virbr0-nic.force_igmp_version = 0

net.ipv4.conf.virbr0-nic.promote_secondaries = 0

net.ipv4.conf.virbr0-nic.accept_local = 0

net.ipv4.conf.virbr0-nic.route_localnet = 0

net.ipv4.ip_forward = 1

net.ipv4.xfrm4_gc_thresh = 262144

net.ipv4.ipfrag_high_thresh = 4194304

net.ipv4.ipfrag_low_thresh = 3145728

net.ipv4.ipfrag_time = 30

net.ipv4.icmp_echo_ignore_all = 0

net.ipv4.icmp_echo_ignore_broadcasts = 0

net.ipv4.icmp_ignore_bogus_error_responses = 1

net.ipv4.icmp_errors_use_inbound_ifaddr = 0

net.ipv4.icmp_ratelimit = 1000

net.ipv4.icmp_ratemask = 6168

net.ipv4.rt_cache_rebuild_count = 4

net.ipv4.ping_group_range = 10

net.ipv4.ip_no_pmtu_disc = 0

net.ipv4.ip_forward_use_pmtu = 0

net.ipv4.ipfrag_secret_interval = 600

net.ipv4.ipfrag_max_dist = 64

net.ipv6.neigh.default.mcast_solicit = 3

net.ipv6.neigh.default.ucast_solicit = 3

net.ipv6.neigh.default.app_solicit = 0

net.ipv6.neigh.default.delay_first_probe_time = 5

net.ipv6.neigh.default.gc_stale_time = 60

net.ipv6.neigh.default.unres_qlen = 3

net.ipv6.neigh.default.proxy_qlen = 64

net.ipv6.neigh.default.anycast_delay = 99

net.ipv6.neigh.default.proxy_delay = 79

net.ipv6.neigh.default.locktime = 0

net.ipv6.neigh.default.retrans_time_ms = 1000

net.ipv6.neigh.default.base_reachable_time_ms = 30000

net.ipv6.neigh.default.gc_interval = 30

net.ipv6.neigh.default.gc_thresh1 = 128

net.ipv6.neigh.default.gc_thresh2 = 512

net.ipv6.neigh.default.gc_thresh3 = 1024

net.ipv6.neigh.lo.mcast_solicit = 3

net.ipv6.neigh.lo.ucast_solicit = 3

net.ipv6.neigh.lo.app_solicit = 0

net.ipv6.neigh.lo.delay_first_probe_time = 5

net.ipv6.neigh.lo.gc_stale_time = 60

net.ipv6.neigh.lo.unres_qlen = 3

net.ipv6.neigh.lo.proxy_qlen = 64

net.ipv6.neigh.lo.anycast_delay = 99

net.ipv6.neigh.lo.proxy_delay = 79

net.ipv6.neigh.lo.locktime = 0

net.ipv6.neigh.lo.retrans_time_ms = 1000

net.ipv6.neigh.lo.base_reachable_time_ms = 30000

net.ipv6.neigh.eth0.mcast_solicit = 3

net.ipv6.neigh.eth0.ucast_solicit = 3

net.ipv6.neigh.eth0.app_solicit = 0

net.ipv6.neigh.eth0.delay_first_probe_time = 5

net.ipv6.neigh.eth0.gc_stale_time = 60

net.ipv6.neigh.eth0.unres_qlen = 3

net.ipv6.neigh.eth0.proxy_qlen = 64

net.ipv6.neigh.eth0.anycast_delay = 99

net.ipv6.neigh.eth0.proxy_delay = 79

net.ipv6.neigh.eth0.locktime = 0

net.ipv6.neigh.eth0.retrans_time_ms = 1000

net.ipv6.neigh.eth0.base_reachable_time_ms = 30000

net.ipv6.neigh.virbr0.mcast_solicit = 3

net.ipv6.neigh.virbr0.ucast_solicit = 3

net.ipv6.neigh.virbr0.app_solicit = 0

net.ipv6.neigh.virbr0.delay_first_probe_time = 5

net.ipv6.neigh.virbr0.gc_stale_time = 60

net.ipv6.neigh.virbr0.unres_qlen = 3

net.ipv6.neigh.virbr0.proxy_qlen = 64

net.ipv6.neigh.virbr0.anycast_delay = 99

net.ipv6.neigh.virbr0.proxy_delay = 79

net.ipv6.neigh.virbr0.locktime = 0

net.ipv6.neigh.virbr0.retrans_time_ms = 1000

net.ipv6.neigh.virbr0.base_reachable_time_ms = 30000

net.ipv6.neigh.virbr0-nic.mcast_solicit = 3

net.ipv6.neigh.virbr0-nic.ucast_solicit = 3

net.ipv6.neigh.virbr0-nic.app_solicit = 0

net.ipv6.neigh.virbr0-nic.delay_first_probe_time = 5

net.ipv6.neigh.virbr0-nic.gc_stale_time = 60

net.ipv6.neigh.virbr0-nic.unres_qlen = 3

net.ipv6.neigh.virbr0-nic.proxy_qlen = 64

net.ipv6.neigh.virbr0-nic.anycast_delay = 99

net.ipv6.neigh.virbr0-nic.proxy_delay = 79

net.ipv6.neigh.virbr0-nic.locktime = 0

net.ipv6.neigh.virbr0-nic.retrans_time_ms = 1000

net.ipv6.neigh.virbr0-nic.base_reachable_time_ms = 30000

net.ipv6.xfrm6_gc_thresh = 2048

net.ipv6.conf.all.forwarding = 0

net.ipv6.conf.all.hop_limit = 64

net.ipv6.conf.all.mtu = 1280

net.ipv6.conf.all.accept_ra = 1

net.ipv6.conf.all.accept_redirects = 1

net.ipv6.conf.all.autoconf = 1

net.ipv6.conf.all.dad_transmits = 1

net.ipv6.conf.all.router_solicitations = 3

net.ipv6.conf.all.router_solicitation_interval = 4

net.ipv6.conf.all.router_solicitation_delay = 1

net.ipv6.conf.all.force_mld_version = 0

net.ipv6.conf.all.use_tempaddr = 0

net.ipv6.conf.all.temp_valid_lft = 604800

net.ipv6.conf.all.temp_prefered_lft = 86400

net.ipv6.conf.all.regen_max_retry = 5

net.ipv6.conf.all.max_desync_factor = 600

net.ipv6.conf.all.max_addresses = 16

net.ipv6.conf.all.accept_ra_defrtr = 1

net.ipv6.conf.all.accept_ra_pinfo = 1

net.ipv6.conf.all.accept_ra_rtr_pref = 1

net.ipv6.conf.all.router_probe_interval = 60

net.ipv6.conf.all.accept_ra_rt_info_max_plen = 0

net.ipv6.conf.all.proxy_ndp = 0

net.ipv6.conf.all.accept_source_route = 0

net.ipv6.conf.all.optimistic_dad = 0

net.ipv6.conf.all.mc_forwarding = 0

net.ipv6.conf.all.disable_ipv6 = 0

net.ipv6.conf.all.accept_dad = 1

net.ipv6.conf.default.forwarding = 0

net.ipv6.conf.default.hop_limit = 64

net.ipv6.conf.default.mtu = 1280

net.ipv6.conf.default.accept_ra = 1

net.ipv6.conf.default.accept_redirects = 1

net.ipv6.conf.default.autoconf = 1

net.ipv6.conf.default.dad_transmits = 1

net.ipv6.conf.default.router_solicitations = 3

net.ipv6.conf.default.router_solicitation_interval = 4

net.ipv6.conf.default.router_solicitation_delay = 1

net.ipv6.conf.default.force_mld_version = 0

net.ipv6.conf.default.use_tempaddr = 0

net.ipv6.conf.default.temp_valid_lft = 604800

net.ipv6.conf.default.temp_prefered_lft = 86400

net.ipv6.conf.default.regen_max_retry = 5

net.ipv6.conf.default.max_desync_factor = 600

net.ipv6.conf.default.max_addresses = 16

net.ipv6.conf.default.accept_ra_defrtr = 1

net.ipv6.conf.default.accept_ra_pinfo = 1

net.ipv6.conf.default.accept_ra_rtr_pref = 1

net.ipv6.conf.default.router_probe_interval = 60

net.ipv6.conf.default.accept_ra_rt_info_max_plen = 0

net.ipv6.conf.default.proxy_ndp = 0

net.ipv6.conf.default.accept_source_route = 0

net.ipv6.conf.default.optimistic_dad = 0

net.ipv6.conf.default.mc_forwarding = 0

net.ipv6.conf.default.disable_ipv6 = 0

net.ipv6.conf.default.accept_dad = 1

net.ipv6.conf.lo.forwarding = 0

net.ipv6.conf.lo.hop_limit = 64

net.ipv6.conf.lo.mtu = 65536

net.ipv6.conf.lo.accept_ra = 1

net.ipv6.conf.lo.accept_redirects = 1

net.ipv6.conf.lo.autoconf = 1

net.ipv6.conf.lo.dad_transmits = 1

net.ipv6.conf.lo.router_solicitations = 3

net.ipv6.conf.lo.router_solicitation_interval = 4

net.ipv6.conf.lo.router_solicitation_delay = 1

net.ipv6.conf.lo.force_mld_version = 0

net.ipv6.conf.lo.use_tempaddr = -1

net.ipv6.conf.lo.temp_valid_lft = 604800

net.ipv6.conf.lo.temp_prefered_lft = 86400

net.ipv6.conf.lo.regen_max_retry = 5

net.ipv6.conf.lo.max_desync_factor = 600

net.ipv6.conf.lo.max_addresses = 16

net.ipv6.conf.lo.accept_ra_defrtr = 1

net.ipv6.conf.lo.accept_ra_pinfo = 1

net.ipv6.conf.lo.accept_ra_rtr_pref = 1

net.ipv6.conf.lo.router_probe_interval = 60

net.ipv6.conf.lo.accept_ra_rt_info_max_plen = 0

net.ipv6.conf.lo.proxy_ndp = 0

net.ipv6.conf.lo.accept_source_route = 0

net.ipv6.conf.lo.optimistic_dad = 0

net.ipv6.conf.lo.mc_forwarding = 0

net.ipv6.conf.lo.disable_ipv6 = 0

net.ipv6.conf.lo.accept_dad = -1

net.ipv6.conf.eth0.forwarding = 0

net.ipv6.conf.eth0.hop_limit = 64

net.ipv6.conf.eth0.mtu = 1500

net.ipv6.conf.eth0.accept_ra = 1

net.ipv6.conf.eth0.accept_redirects = 1

net.ipv6.conf.eth0.autoconf = 1

net.ipv6.conf.eth0.dad_transmits = 1

net.ipv6.conf.eth0.router_solicitations = 3

net.ipv6.conf.eth0.router_solicitation_interval = 4

net.ipv6.conf.eth0.router_solicitation_delay = 1

net.ipv6.conf.eth0.force_mld_version = 0

net.ipv6.conf.eth0.use_tempaddr = 0

net.ipv6.conf.eth0.temp_valid_lft = 604800

net.ipv6.conf.eth0.temp_prefered_lft = 86400

net.ipv6.conf.eth0.regen_max_retry = 5

net.ipv6.conf.eth0.max_desync_factor = 600

net.ipv6.conf.eth0.max_addresses = 16

net.ipv6.conf.eth0.accept_ra_defrtr = 1

net.ipv6.conf.eth0.accept_ra_pinfo = 1

net.ipv6.conf.eth0.accept_ra_rtr_pref = 1

net.ipv6.conf.eth0.router_probe_interval = 60

net.ipv6.conf.eth0.accept_ra_rt_info_max_plen = 0

net.ipv6.conf.eth0.proxy_ndp = 0

net.ipv6.conf.eth0.accept_source_route = 0

net.ipv6.conf.eth0.optimistic_dad = 0

net.ipv6.conf.eth0.mc_forwarding = 0

net.ipv6.conf.eth0.disable_ipv6 = 0

net.ipv6.conf.eth0.accept_dad = 1

net.ipv6.conf.virbr0.forwarding = 0

net.ipv6.conf.virbr0.hop_limit = 64

net.ipv6.conf.virbr0.mtu = 1500

net.ipv6.conf.virbr0.accept_ra = 0

net.ipv6.conf.virbr0.accept_redirects = 1

net.ipv6.conf.virbr0.autoconf = 0

net.ipv6.conf.virbr0.dad_transmits = 1

net.ipv6.conf.virbr0.router_solicitations = 3

net.ipv6.conf.virbr0.router_solicitation_interval = 4

net.ipv6.conf.virbr0.router_solicitation_delay = 1

net.ipv6.conf.virbr0.force_mld_version = 0

net.ipv6.conf.virbr0.use_tempaddr = 0

net.ipv6.conf.virbr0.temp_valid_lft = 604800

net.ipv6.conf.virbr0.temp_prefered_lft = 86400

net.ipv6.conf.virbr0.regen_max_retry = 5

net.ipv6.conf.virbr0.max_desync_factor = 600

net.ipv6.conf.virbr0.max_addresses = 16

net.ipv6.conf.virbr0.accept_ra_defrtr = 1

net.ipv6.conf.virbr0.accept_ra_pinfo = 1

net.ipv6.conf.virbr0.accept_ra_rtr_pref = 1

net.ipv6.conf.virbr0.router_probe_interval = 60

net.ipv6.conf.virbr0.accept_ra_rt_info_max_plen = 0

net.ipv6.conf.virbr0.proxy_ndp = 0

net.ipv6.conf.virbr0.accept_source_route = 0

net.ipv6.conf.virbr0.optimistic_dad = 0

net.ipv6.conf.virbr0.mc_forwarding = 0

net.ipv6.conf.virbr0.disable_ipv6 = 1

net.ipv6.conf.virbr0.accept_dad = 1

net.ipv6.conf.virbr0-nic.forwarding = 0

net.ipv6.conf.virbr0-nic.hop_limit = 64

net.ipv6.conf.virbr0-nic.mtu = 1500

net.ipv6.conf.virbr0-nic.accept_ra = 1

net.ipv6.conf.virbr0-nic.accept_redirects = 1

net.ipv6.conf.virbr0-nic.autoconf = 1

net.ipv6.conf.virbr0-nic.dad_transmits = 1

net.ipv6.conf.virbr0-nic.router_solicitations = 3

net.ipv6.conf.virbr0-nic.router_solicitation_interval = 4

net.ipv6.conf.virbr0-nic.router_solicitation_delay = 1

net.ipv6.conf.virbr0-nic.force_mld_version = 0

net.ipv6.conf.virbr0-nic.use_tempaddr = 0

net.ipv6.conf.virbr0-nic.temp_valid_lft = 604800

net.ipv6.conf.virbr0-nic.temp_prefered_lft = 86400

net.ipv6.conf.virbr0-nic.regen_max_retry = 5

net.ipv6.conf.virbr0-nic.max_desync_factor = 600

net.ipv6.conf.virbr0-nic.max_addresses = 16

net.ipv6.conf.virbr0-nic.accept_ra_defrtr = 1

net.ipv6.conf.virbr0-nic.accept_ra_pinfo = 1

net.ipv6.conf.virbr0-nic.accept_ra_rtr_pref = 1

net.ipv6.conf.virbr0-nic.router_probe_interval = 60

net.ipv6.conf.virbr0-nic.accept_ra_rt_info_max_plen = 0

net.ipv6.conf.virbr0-nic.proxy_ndp = 0

net.ipv6.conf.virbr0-nic.accept_source_route = 0

net.ipv6.conf.virbr0-nic.optimistic_dad = 0

net.ipv6.conf.virbr0-nic.mc_forwarding = 0

net.ipv6.conf.virbr0-nic.disable_ipv6 = 0

net.ipv6.conf.virbr0-nic.accept_dad = 1

net.ipv6.ip6frag_high_thresh = 4194304

net.ipv6.ip6frag_low_thresh = 3145728

net.ipv6.ip6frag_time = 60

net.ipv6.route.gc_thresh = 1024

net.ipv6.route.max_size = 16384

net.ipv6.route.gc_min_interval = 0

net.ipv6.route.gc_timeout = 60

net.ipv6.route.gc_interval = 30

net.ipv6.route.gc_elasticity = 0

net.ipv6.route.mtu_expires = 600

net.ipv6.route.min_adv_mss = 1

net.ipv6.route.gc_min_interval_ms = 500

net.ipv6.icmp.ratelimit = 1000

net.ipv6.bindv6only = 0

net.ipv6.nf_conntrack_frag6_timeout = 60

net.ipv6.nf_conntrack_frag6_low_thresh = 3145728

net.ipv6.nf_conntrack_frag6_high_thresh = 4194304

net.ipv6.ip6frag_secret_interval = 600

net.ipv6.mld_max_msf = 64

net.nf_conntrack_max = 65536

net.bridge.bridge-nf-call-arptables = 0

net.bridge.bridge-nf-call-iptables = 0

net.bridge.bridge-nf-call-ip6tables = 0

net.bridge.bridge-nf-filter-vlan-tagged = 0

net.bridge.bridge-nf-filter-pppoe-tagged = 0

net.unix.max_dgram_qlen = 10

crypto.fips_enabled = 0

 

 

# cat /etc/sysctl.conf

# Kernel sysctl configuration file for Red Hat Linux

#

# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and

# sysctl.conf(5) for more details.

#

# Use '/sbin/sysctl -a' to list all possible parameters.

 

# Controls IP packet forwarding

net.ipv4.ip_forward = 0

 

# Controls source route verification

#net.ipv4.conf.default.rp_filter = 1

net.ipv4.conf.default.rp_filter = 0

 

# Do not accept source routing

net.ipv4.conf.default.accept_source_route = 0

 

# Controls the System Request debugging functionality of the kernel

kernel.sysrq = 0

 

# Controls whether core dumps will append the PID to the core filename.

# Useful for debugging multi-threaded applications.

kernel.core_uses_pid = 1

 

# Controls the use of TCP syncookies

net.ipv4.tcp_syncookies = 1

 

# Controls the default maxmimum size of a mesage queue

kernel.msgmnb = 65536

 

# Controls the maximum size of a message, in bytes

kernel.msgmax = 65536

 

# Controls the maximum shared segment size, in bytes

kernel.shmmax = 4294967295

 

# Controls the maximum number of shared memory segments, in pages

kernel.shmall = 268435456

 

 

网络配置

# service network status

Configured devices:

lo eth0

Currently active devices:

lo

 

# /etc/init.d/network status

Configured devices:

lo eth0

Currently active devices:

lo

 

# cat /etc/sysconfig/network-scripts/ifcfg-eth0 

DEVICE=eth0

HWADDR=00:0C:29:12:78:03

TYPE=Ethernet

UUID=9185b744-97f5-4474-bf91-34f38fb48a3a

ONBOOT=no

NM_CONTROLLED=yes

BOOTPROTO=dhcp

 

其中:

ONBOOT表示开机时是否启动该网卡,可设置为yes或no, 默认为no。

BOOTPROTO表示使用动态ip还是静态ip,可设置为statics或dhcp,默认为dhcp。

 

# cat /etc/sysconfig/network-scripts/ifcfg-eth0 

DEVICE=eth0

HWADDR=00:0C:29:12:78:03

TYPE=Ethernet

UUID=9185b744-97f5-4474-bf91-34f38fb48a3a

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=dhcp

 

# service network stop

 

# service network start

 

路由配置

查看路由表

# route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.0.0     *               255.255.255.0   U     0      0        0 eth0

192.168.122.0   *               255.255.255.0   U     0      0        0 virbr0

link-local      *               255.255.0.0     U     1002   0        0 eth0

default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0

 

# route --help

Usage: route [-nNvee] [-FC] [<AF>]           List kernel routing tables

       route [-v] [-FC] {add|del|flush} ...  Modify routing table for AF.

 

       route {-h|--help} [<AF>]              Detailed usage syntax for specified AF.

       route {-V|--version}                  Display version/author and exit.

 

        -v, --verbose            be verbose

        -n, --numeric            don't resolve names

        -e, --extend             display other/more information

        -F, --fib                display Forwarding Information Base (default)

        -C, --cache              display routing cache instead of FIB

 

  <AF>=Use '-A <af>' or '--<af>'; default: inet

  List of possible address families (which support routing):

    inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25) 

    netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP) 

    x25 (CCITT X.25)

 

# route -F

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.0.0     *               255.255.255.0   U     0      0        0 eth0

192.168.122.0   *               255.255.255.0   U     0      0        0 virbr0

link-local      *               255.255.0.0     U     1002   0        0 eth0

default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0

 

# route -C

Kernel IP routing cache

Source          Destination     Gateway         Flags Metric Ref    Use Iface

192.168.0.104   192.168.0.255   192.168.0.255   ibl   0      0        3 lo

192.168.0.102   192.168.1.1     192.168.0.1           0      0        3 eth0

192.168.0.102   192.168.0.109   192.168.0.109         0      3        2 eth0

192.168.1.1     192.168.0.102   192.168.0.102   l     0      0        3 lo

192.168.0.102   192.168.1.1     192.168.0.1           0      0        3 eth0

192.168.0.104   255.255.255.255 255.255.255.255 ibl   0      0        0 lo

localhost       localhost       localhost       l     0      0        0 lo

192.168.0.1     255.255.255.255 255.255.255.255 ibl   0      0        0 lo

192.168.0.109   192.168.0.102   192.168.0.102   il    0      0      103 lo

192.168.0.109   192.168.0.255   192.168.0.255   ibl   0      0        0 lo

localhost       localhost       localhost       l     0      0        0 lo

 

# route -FC

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.0.0     *               255.255.255.0   U     0      0        0 eth0

192.168.122.0   *               255.255.255.0   U     0      0        0 virbr0

link-local      *               255.255.0.0     U     1002   0        0 eth0

default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0

Kernel IP routing cache

Source          Destination     Gateway         Flags Metric Ref    Use Iface

192.168.0.104   192.168.0.255   192.168.0.255   ibl   0      0        3 lo

192.168.0.102   192.168.1.1     192.168.0.1           0      0       12 eth0

192.168.0.102   192.168.0.109   192.168.0.109         0      3        2 eth0

192.168.1.1     192.168.0.102   192.168.0.102   l     0      0       12 lo

192.168.0.102   192.168.1.1     192.168.0.1           0      0       12 eth0

192.168.0.104   255.255.255.255 255.255.255.255 ibl   0      0        1 lo

localhost       localhost       localhost       l     0      0        0 lo

192.168.0.1     255.255.255.255 255.255.255.255 ibl   0      0        1 lo

192.168.0.109   192.168.0.102   192.168.0.102   il    0      0      142 lo

192.168.0.109   192.168.0.255   192.168.0.255   ibl   0      0        0 lo

localhost       localhost       localhost       l     0      0        0 lo

 

<AF>用于指定地址簇。如inet, inet6等。默认为inet。支持路由的地址簇包括:inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25) netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP) x25 (CCITT X.25)

 

# route -A inet

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.0.0     *               255.255.255.0   U     0      0        0 eth0

192.168.122.0   *               255.255.255.0   U     0      0        0 virbr0

link-local      *               255.255.0.0     U     1002   0        0 eth0

default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0

 

# route --inet

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.0.0     *               255.255.255.0   U     0      0        0 eth0

192.168.122.0   *               255.255.255.0   U     0      0        0 virbr0

link-local      *               255.255.0.0     U     1002   0        0 eth0

default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0

 

# route -A inet6

Kernel IPv6 routing table

Destination                                 Next Hop                                Flags Metric Ref    Use Iface

fe80::/64                                   *                                       U     256    0        0 eth0    

fe80::/64                                   *                                       U     256    0        0 virbr0  

localhost/128                               *                                       U     0      21       1 lo      

fe80::20c:29ff:fe12:7803/128                *                                       U     0      0        1 lo      

ff00::/8                                    *                                       U     256    0        0 eth0    

ff00::/8                                    *                                       U     256    0        0 virbr0

 

添加路由

# route add 192.168.1.5 dev eth0

 

# route add -host 192.168.1.2 dev eth0

# route add -host 192.168.1.3 gw 192.168.0.1 dev eth0

 

# route add -net 10.20.30.40 netmask 255.255.255.255 dev eth0

 

删除路由

# route del -host 192.168.1.5 dev eth0

 

# route del -net 10.20.30.40 netmask 255.255.255.255 dev eth0

 

防火墙配置

 

配置

/etc/sysconfig/iptables

 

# cat /etc/sysconfig/iptables

# Firewall configuration written by system-config-firewall

# Manual customization of this file is not recommended.

*filter

:INPUT ACCEPT [0:0]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [0:0]

-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

-A INPUT -p icmp -j ACCEPT

-A INPUT -i lo -j ACCEPT

-A INPUT -m state --state NEW -m udp -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT

-A INPUT -j REJECT --reject-with icmp-host-prohibited

-A FORWARD -j REJECT --reject-with icmp-host-prohibited

COMMIT

 

查看防火墙运行状态

如果防火墙处于关闭状态:

# service iptables status

iptables: Firewall is not running.

 

还可以这样查看防火墙运行状态

# /etc/init.d/iptables status

iptables: Firewall is not running.

 

如果防火墙处于开启状态:

# service iptables status

Table: filter

Chain INPUT (policy ACCEPT)

num  target     prot opt source               destination         

1    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED 

2    ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0           

3    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           

4    ACCEPT     udp  --  0.0.0.0/0            224.0.0.251         state NEW udp dpt:5353 

5    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited 

 

Chain FORWARD (policy ACCEPT)

num  target     prot opt source               destination         

1    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited 

 

Chain OUTPUT (policy ACCEPT)

num  target     prot opt source               destination         

 

 

还可以这样查看防火墙运行状态

# /etc/init.d/iptables status

Table: filter

Chain INPUT (policy ACCEPT)

num  target     prot opt source               destination         

1    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED 

2    ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0           

3    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           

4    ACCEPT     udp  --  0.0.0.0/0            224.0.0.251         state NEW udp dpt:5353 

5    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited 

 

Chain FORWARD (policy ACCEPT)

num  target     prot opt source               destination         

1    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited 

 

Chain OUTPUT (policy ACCEPT)

num  target     prot opt source               destination         

 

 

开启防火墙

# service iptables start

iptables: Applying firewall rules:                         [  OK  ]

还可以这样开启防火墙

# /etc/init.d/iptables start

iptables: Applying firewall rules:                         [  OK  ]

 

关闭防火墙

# service iptables stop

iptables: Setting chains to policy ACCEPT: filter          [  OK  ]

iptables: Flushing firewall rules:                         [  OK  ]

iptables: Unloading modules:                               [  OK  ]

 

还可以这样关闭防火墙

# /etc/init.d/iptables stop

iptables: Setting chains to policy ACCEPT: filter          [  OK  ]

iptables: Flushing firewall rules:                         [  OK  ]

iptables: Unloading modules:                               [  OK  ]

 

nslookup

域名解析

wget ftp://ftp.isc.org/isc/bind8/src/DEPRECATED/8.4.6/bind-src.tar.gz

解压后make的时候会报一些NULL没有声明的错误,引入标准头文件即可。然后make & make install进行安装。

 

 

ssh

查看ssh服务运行状态

# service sshd status

openssh-daemon (pid  2816) is running...

 

# /etc/init.d/sshd status

openssh-daemon (pid  2954) is running...

 

# service sshd status

openssh-daemon is stopped

 

# /etc/init.d/sshd status

openssh-daemon is stopped

 

启动ssh服务

# service sshd start

Starting sshd:                                             [  OK  ]

 

# /etc/init.d/sshd start

Starting sshd:                                             [  OK  ]

 

关闭ssh服务

# service sshd stop

Stopping sshd:                                             [  OK  ]

# /etc/init.d/sshd stop

Stopping sshd:                                             [  OK  ]

 

服务管理

service

 

# service --status-all

abrt-ccpp hook is installed

abrtd (pid  1905) is running...

abrt-dump-oops is stopped

acpid (pid  1772) is running...

atd is stopped

auditd is stopped

automount (pid  1859) is running...

Usage: /etc/init.d/bluetooth {start|stop}

certmonger (pid  1936) is running...

cpuspeed is stopped

crond is stopped

cupsd (pid  1713) is running...

dnsmasq is stopped

/usr/sbin/fcoemon -- RUNNING, pid=1585

No interfaces created.

firstboot is not scheduled to run

hald (pid  1784) is running...

I don't know of any running hsqldb server.

htcacheclean is stopped

httpd is stopped

Table: filter

Chain INPUT (policy ACCEPT)

num  target     prot opt source               destination         

1    ACCEPT     all      ::/0                 ::/0                state RELATED,ESTABLISHED 

2    ACCEPT     icmpv6    ::/0                 ::/0                

3    ACCEPT     all      ::/0                 ::/0                

4    ACCEPT     udp      ::/0                 fe80::/64           state NEW udp dpt:546 

5    ACCEPT     udp      ::/0                 ff02::fb/128        state NEW udp dpt:5353 

6    REJECT     all      ::/0                 ::/0                reject-with icmp6-adm-prohibited 

 

Chain FORWARD (policy ACCEPT)

num  target     prot opt source               destination         

1    REJECT     all      ::/0                 ::/0                reject-with icmp6-adm-prohibited 

 

Chain OUTPUT (policy ACCEPT)

num  target     prot opt source               destination         

 

pluto is stopped

whack: Pluto is not running (no "/var/run/pluto/pluto.ctl")

iptables: Firewall is not running.

irqbalance (pid  1515) is running...

iscsi is stopped

iscsid is stopped

Kdump is not operational

lldpad (pid  1554) is running...

lvmetad is stopped

dmeventd is stopped

mdmonitor is stopped

messagebus (pid  1600) is running...

multipathd is stopped

mysqld is stopped

netconsole module not loaded

Configured devices:

lo

Currently active devices:

lo eth0

NetworkManager (pid  1614) is running...

rpc.svcgssd is stopped

rpc.mountd is stopped

nfsd is stopped

rpc.rquotad is stopped

rpc.statd (pid  1642) is running...

grep: /proc/fs/nfsd/portlist: No such file or directory

nscd is stopped

nslcd is stopped

ntpd is stopped

oddjobd is stopped

ifdhandler is stopped

pcscd is stopped

portreserve is stopped

master is stopped

pppoe-server is stopped

Process accounting is disabled.

quota_nld is stopped

rdisc is stopped

Low level hardware support loaded:

none found

 

Upper layer protocol modules:

ib_ipoib 

 

User space access modules:

rdma_ucm ib_ucm ib_uverbs ib_umad 

 

Connection management modules:

rdma_cm ib_cm iw_cm 

 

Configured IPoIB interfaces: none

Currently active IPoIB interfaces: none

restorecond (pid 2338) is running...

rngd is stopped

rpcbind (pid  1539) is running...

rpc.gssd is stopped

rpc.idmapd is stopped

rpc.svcgssd is stopped

rsyslogd (pid  1481) is running...

sandbox is stopped

saslauthd is stopped

smartd is stopped

spice-vdagentd is stopped

openssh-daemon (pid  3023) is running...

sssd is stopped

Xvnc is stopped

wdaemon is stopped

winbindd is stopped

wpa_supplicant (pid  1654) is running...

ypbind is stopped

 

 

tcpdump

安装

# yum -y install tcpdump

 

# tcpdump --help

tcpdump version 4.1-PRE-CVS_2017_03_21

libpcap version 1.4.0

Usage: tcpdump [-aAdDefhIJKlLnNOpqRStuUvxX] [ -B size ] [ -c count ]

[ -C file_size ] [ -E algo:secret ] [ -F file ] [ -G seconds ]

[ -i interface ] [ -j tstamptype ] [ -M secret ]

[ -Q|-P in|out|inout ]

[ -r file ] [ -s snaplen ] [ -T type ] [ -w file ]

[ -W filecount ] [ -y datalinktype ] [ -z command ]

[ -Z user ] [ expression ]

 

# tcpdump

 

# tcpdump -i eth0

 

# tcpdump -c 10

 

# tcpdump -c 10 host localhost.localdomain

# tcpdump -c 10 host baidu.com

 

# tcpdump -c 10 host 192.168.0.102

 

# tcpdump -c 10 host baidu.com -v

 

# tcpdump -c 10 src host 192.168.0.109

 

# tcpdump -c 10 dst host 192.168.0.109

 

# tcpdump -c 10 port 22

 

# tcpdump -c 10 tcp

 

dump写入到out文件

# tcpdump -e -w out port 2020 -vv

从out文件中加载dump

# tcpdump -e -r out

 

shell

 

sh

# ps -a

  PID TTY          TIME CMD

 2460 pts/1    00:00:00 ps

 

# sh

sh-4.1# 

# ps -a

  PID TTY          TIME CMD

 2461 pts/0    00:00:00 sh

 2462 pts/1    00:00:00 ps

 

# exit

exit

# ps -a

  PID TTY          TIME CMD

 2465 pts/1    00:00:00 ps

 

bash

# ps -a

  PID TTY          TIME CMD

 2466 pts/1    00:00:00 ps

 

# bash

[root@localhost root]#

# ps -a

  PID TTY          TIME CMD

 2467 pts/0    00:00:00 bash

 2474 pts/1    00:00:00 ps

 

# exit

exit

# ps -a

  PID TTY          TIME CMD

 2476 pts/1    00:00:00 ps

 

 

 

mkfs

 

mkfs.ext2

 

mkfs.ext3

# dd if=/dev/zero of=fs.ext3 bs=1M count=32

# mkfs.ext3 fs.ext3

mke2fs 1.41.12 (17-May-2010)

fs.ext3 is not a block special device.

Proceed anyway? (y,n) y

Filesystem label=

OS type: Linux

Block size=1024 (log=0)

Fragment size=1024 (log=0)

Stride=0 blocks, Stripe width=0 blocks

8192 inodes, 32768 blocks

1638 blocks (5.00%) reserved for the super user

First data block=1

Maximum filesystem blocks=33554432

4 block groups

8192 blocks per group, 8192 fragments per group

2048 inodes per group

Superblock backups stored on blocks: 

8193, 24577

 

Writing inode tables: done                            

Creating journal (4096 blocks): done

Writing superblocks and filesystem accounting information: done

 

This filesystem will be automatically checked every 29 mounts or

180 days, whichever comes first.  Use tune2fs -c or -i to override.

 

mkfs.ext4

 

mke2fs

 

mkfs.cramfs

 

 

 

# yum -y install dosfstools

 

mkfs.msdos

 

mkfs.vfat

 

FAT文件系统

FAT包括FAT12,FAT16, FAT32三种格式。

 

通过mkdosfs可以创建FAT文件系统。如下:

# dd if=/dev/zero of=fs.fat bs=1M count=1

# cp -rf fs.fat fs.fat.default

# mkdosfs fs.fat

# od -A x -t x1 -v fs.fat

# od -A x -t x1 -v fs.fat.default

这里没有指定创建哪种格式的FAT文件系统,linux默认会选择一种FAT格式,具体是哪种格式是不一定的。

 

我们可以以16进制形式查看fs.fat的内容,可以看到它创建的是FAT12格式的文件系统。

如下图:



 

 

可以指定-F来指定创建哪种格式的FAT文件系统。

 

创建FAT12格式文件系统

# dd if=/dev/zero of=fs.fat12-64k bs=1K count=64

# cp -rf fs.fat12-64k fs.fat12-64k.default

# mkdosfs -F 12 fs.fat12-64k

# cp -rf fs.fat12-64k fs.fat12-64k.empty

# mount -t vfat fs.fat12-64k tmpfs/ -o loop

 

 

 

# dd if=/dev/zero of=fs.fat12-64k bs=1K count=64

# cp -rf fs.fat12-64k fs.fat12-64k.default

# mkdosfs -F 12 -r 16 -f 1 -s 1 fs.fat12-64k

# cp -rf fs.fat12-64k fs.fat12-64k.empty

# mount -t vfat fs.fat12-64k tmpfs/ -o loop

 

 

 

# dd if=/dev/zero of=fs.fat12-64k-1 bs=1K count=64

# cp -rf fs.fat12-64k-1 fs.fat12-64k-1.default

# mkdosfs -F 12 -r 32 -f 1 -s 1 fs.fat12-64k-1

# cp -rf fs.fat12-64k-1 fs.fat12-64k-1.empty

# mount -t vfat fs.fat12-64k-1 tmpfs/ -o loop

 

 

 

 

# dd if=/dev/zero of=fs.fat12 bs=1M count=1

# cp -rf fs.fat12 fs.fat12.default

# mkdosfs -F 12 fs.fat12


Reserved区域

Reserved区域从FAT卷(分区)的第一个扇区开始,具体Reserved区域多大,占用多少个扇区,可以根据引导扇区(Boot Sector)也就是DBR或VBR(卷引导记录)或PBR(私有引导记录)中的BPB_RsvdSecCnt(偏移14)来判断Reserved区域占用1个扇区。

 

因此,Reserved区域如下图:

各个字段解释

偏移0-2:BS_JmpBoot,一条跳转指令,占3个字节,跳转到bootstrap code,也就是后面的BS_BootCode引导代码。

偏移3-10:BS_OEMName,OEM标识。仅仅是个标识。

偏移11-12:BPB_BytsPerSec,每个扇区的字节数,通常我们常见的是一个扇区512字节。但也有可能不一定,有可能是512, 1024, 2048或4096字节。这里是00 02,表示0x200(512)字节。

偏移13:BPB_SecPerClus,每个簇的扇区数。这里是02表示每个簇2个扇区。

偏移14-15:BPB_RsvdSecCnt,保留区域的扇区数。我们也是通过这个字段判断Reserved区域多大,占用多少个扇区。

偏移16:BPB_NumFATs,FAT表的个数。这里是 “02”,表示有2个FAT表。

偏移17-18:BPB_RootEntCnt,根目录区域中根目录中的entry个数。这里是00 02,表示0x200(512)个根目录项。

偏移19-20:BPB_TotSec16,FAT卷(分区)的扇区数。

偏移21:BPB_Media,Media

偏移22-23:BPB_FATSz16,FAT表的大小,扇区数。表示02 00,表示每个FAT表占用2个扇区。

偏移24-25:BPB_SecPerTrk,每个Head(Track,磁头,盘片)的扇区数。

偏移26-27:BPB_NumHeads,Head(Track,磁头,盘片)的个数。

偏移28-31:BPB_HiddSec,FAT卷(分区)前面隐藏的物理扇区数。

偏移32-35:BPB_TotSec32,FAT卷(分区)的扇区数。FAT32才有用。

偏移36:BS_DrvNum,驱动号(Drive number)

偏移37:BS_Reserved1,预留

偏移38:BS_BootSig,扩展引导签名

偏移39-42:BS_VolID,卷(分区)序列号

偏移43-53:BS_VolLab,卷(分区)标签

偏移54-61:BS_FilSysType,文件系统类型

偏移62-509:BS_BootCode,引导代码,也就是上面的bootstrap code。

偏移510-511:BS_BootSign,引导扇区(Boot Sector)也就是DBR或VBR(卷引导记录)或PBR(私有引导记录)的签名标识。

 

FAT区域

Reserved区域后面就是FAT区域,根据BPB_FATSz16和BPB_NumFATs可以看出,FAT区域在Reserved区域后面的4个扇区。

第1个FAT表的第1个扇区:


第1个FAT表的第2个扇区:

第2个FAT表的第1个扇区:


第2个FAT表的第2个扇区:

2个FAT表内容是一样的。
FAT区域后面就是根目录区域(Root directory area)

根据上面的BPB_RootEntCnt字段,根目录中有512个目录项,每个目录项32个字节。所以根目录区域就在FAT区域后面的32个扇区。

 

这块很大,而且目前这块都为0。

 

数据区域(Data area)

根目录区域(Root directory area)后面就是数据区域

 

这块ye很大,而且目前这块都为0。

 

# mkdir tmpfs

# mount -t vfat fs.fat12 tmpfs/ -o loop

# ls tmpfs/

# cat aaa.txt 

aaa

# cp -rf aaa.txt tmpfs/

# ls tmpfs/

aaa.txt

# umount tmpfs

 

 

 

 

创建FAT16格式文件系统

# dd if=/dev/zero of=fs.fat16 bs=1M count=20

# cp -rf fs.fat16 fs.fat16.default

# mkdosfs -F 16 fs.fat16



 

 

创建FAT32格式文件系统

# dd if=/dev/zero of=fs.fat32 bs=1M count=64

# cp -rf fs.fat32 fs.fat32.default

# mkdosfs -F 32 fs.fat32

man

安装

# yum -y install manpages-posix-dev

 

# man printf

# man 1 printf

# man 3 printf

分享到:
评论

相关推荐

    LinuxCommands:DevOps工程师Linux命令

    在IT行业中,Linux操作系统是DevOps工程师不可或缺的工具。它提供了强大的命令行界面,使得系统管理、自动化和脚本编写等工作变得高效而便捷。本文将深入探讨DevOps工程师常用的Linux命令,帮助提升日常工作效率。 ...

    devops-guidebook::books: DevOps 知识图谱 关于Linux、服务器、数据库、部署等相关体系

    【标题】中的“DevOps Guidebook”是一本涵盖了DevOps领域的综合指南,它涉及Linux操作系统、服务器管理、数据库系统以及部署流程等多个关键方面。这个知识图谱旨在为IT专业人士提供一个全面了解和实践DevOps的框架...

    Chris Van Tuin:论DevOps式思维方式

    - **“代码化配置”**:通过标准化环境、Linux容器和自动化配置等技术实现。 - **CI/CD(持续集成/持续部署)**:包括自动化测试与部署,连续集成与连续交付,以实现小步快跑,从而降低风险。 - **快速创新**:...

    devops:DevOps笔记

    DevOps笔记 这是什么 这是一份围绕 容器云 而写的运维笔记,这份笔记尽量囊括了容器云的各个生态领域(详情查看),为读者们提供一份有价值的参考信息。 这里有什么 内容分为五大部分。 架构 主要介绍基础设施的架构...

    aws-toolbox:DevOps工具的集合,包括可自动处理AWS中无聊内容的shell和python脚本

    DevOps工具的集合,包括可自动执行AWS中无聊内容的shell和python脚本。 目录 贡献 欢迎捐款! 查看。 入门 AWS服务分类的Shell和Python脚本 通用脚本 该文件包含一堆易于记忆的别名,这些别名运行复杂的AWS CLI...

    devops-sandbox:DevOps 沙箱

    DevOps 沙盒DevOps 沙箱文档码头工人IDE 中的 Docker 工具(待定)吉特参考Unix/Linux/外壳码头工人(相关 ) Kubernetes 库贝学院Kubernetes示例skaffold.dev 吉特了解GitHub流程如何为 GitHub 上的开源项目做出...

    集成DevOps思想 基于Centos 7.X打造全方位Linux高级运维架构师 运维开发+自动化运维

    基于Centos 7.X打造全方位Linux高级运维架构师课程,28G百集内容,是一套非常强大的Linux运维课程,后篇还有云计算运维课程,它集成了DevOps思想,或者说叫DevOps方法。 Linux自动化运维课程包括了Linux基础运维...

    Scripts:DevOps Bootcamp Week 2脚本

    Shell脚本是Linux和Unix系统中常用的一种自动化任务执行方式,它允许用户通过编写简单的命令序列来执行一系列操作,极大地提高了工作效率。 首先,我们要理解什么是Shell。Shell是操作系统提供的一个命令行接口,它...

    devops-essentials:DevOps Essentials | 地形| kubernetes | linux | nginx | 监控| 码头工人| 码头工人组成

    本压缩包"devops-essentials"聚焦于DevOps的基础知识,涵盖了多个关键组件和技术,如Terraform、Kubernetes、Linux、Nginx、监控、Docker以及Docker Compose。 1. **Terraform**:这是一个基础设施即代码(IaC)...

    atmos:DevOps和云自动化的通用工具

    1. **多平台支持** - `atmos` 可在各种操作系统上运行,包括Linux、macOS和Windows,确保跨环境的兼容性。 2. **集成Terraform** - 支持Terraform HCL2语法,用于定义和管理基础设施。通过`atmos`,用户可以方便地...

    The Practice of System and Network Administration.pdf

    - **Linux/Unix系统管理**:这些操作系统广泛应用于服务器端,掌握其命令行操作对于系统管理员至关重要。 - **Windows Server管理**:Windows Server 是另一种常用的服务器操作系统,熟悉其管理界面和工具也是必要的...

    machine:DevOps的瑞士军刀

    机器 DevOps的瑞士军刀 什么是机器 机器以两种方式支持DevOps工作流程 ... 要查看machine &lt;provider&gt; config get期间使用Linux映像,请运行machine &lt;provider&gt; config get 。 最后,通过提供程序创建VM。 请按

    devops:DevOps和云工程师的技巧和窍门

    Shell脚本是Linux/Unix环境中进行自动化任务的强大工具。熟练编写和使用Shell脚本,可以极大地提升工作效率,尤其是在执行重复性的系统管理和部署任务时。熟悉基本的命令行操作、条件语句、循环结构以及函数定义是每...

    DevOps指南:DevOps指南从基础到高级,包括面试问题和注释Notes

    DevOps入门链接:贡献者 :sparkles: 感谢这些很棒的人(): 该项目遵循规范。 欢迎任何形式的捐助!执照该项目已获得MIT许可-版权(c)2019 Tikam Alma

    英文原版-DevOps Troubleshooting Linux Server Best Practices 1st Edition

    DevOps can help developers, QAs, and admins work together to solve Linux server problems far more rapidly, significantly improving IT performance, availability, and efficiency. To gain these benefits,...

    pcf-workshop-devops:DevOps 的 PCF 研讨会

    Cloud Foundry平台上的DevOps目标部署和配置微服务和UI,利用平台对微服务进行监控和管理,并进行零停机的蓝绿部署。先决条件Java SDK 1.7+ 来自Git 来自 Cloud Foundry CLI 从关键网络服务帐户。 在此处创建免费的...

    javasnmp源码-DevOps-Interview:DevOps-面试

    snmp源码DevOps-面试 去做 IO性能调优 Linux 命令 1. sed - Replace the first occurrence of a regular expression in each line of a file, and print the result: sed ' s/{{regex}}/{{replace}}/ ' {{filename}}...

    devops-demystified-docker:DevOps DeMystified 在 Docker 上运行

    Dockerized DevOps 揭秘 ... 这个 repo 将尝试使用 Linux 容器 (Docker) 而不是配置管理工具 (Chef) 来重新创建第一个演示的精神。 入门 先决条件 安装了 。 已安装 。 帐户。 运行容器 将 api/TEMPLATE_applicatio

    devops:DevOps专业人士学习指南https:gofunct.github.iodevops

    Helm是Kubernetes的应用包管理工具,类似于Linux中的APT或YUM,但专为Kubernetes设计。Helm采用Chart的概念,将Kubernetes资源文件打包成易于分发和安装的模板,方便管理和升级应用程序。 gRPC是一个高性能、开源和...

    2019马哥全新Linux云计算+安全+Devops+K8s高薪运维工程师课程大纲v11.0(最新版)1

    【Linux 云计算基础】 Linux 是一种开源操作系统,被广泛应用于服务器、云计算和数据中心等领域...它将提供全面的Linux、云计算、安全和DevOps知识,助你在竞争激烈的市场中脱颖而出,实现年薪30万甚至更高的职业目标。

Global site tag (gtag.js) - Google Analytics