Debian9.5 set multiple vlans ip on one NIC in DELL R710

1, If you met this error while restart network: 

Nov 08 11:07:07 debian kernel: bnx2 0000:01:00.0: firmware: failed to load bnx2/bnx2-mips-09-6.2.1b.fw (-2)
Nov 08 11:07:07 debian kernel: bnx2 0000:01:00.0: Direct firmware load for bnx2/bnx2-mips-09-6.2.1b.fw failed with error -2

You need to install the NIC driver: DELL_LAN.iso : mount the iso, 

mount -t iso9660 DELL_LAN.iso /dstdir

and use command `dpkg -i *.deb` install the two deb packages in the iso.

2, Install the `vlan` package or use this deb package vlan_1.9-3.2+b1_amd64.deb which is download from offical website or download from this website vlan_1.9-3.2+b1_amd64.deb .

3, Add such like this configure in the network conf file: "/etc/network/interface"

auto vlan170
iface vlan170 inet static
    vlan-raw-device eno1
    address 10.17.3.249
    netmask 255.255.252.0
    gateway 10.17.0.1

auto vlan174
iface vlan174 inet static
    vlan-raw-device eno1
    address 10.17.7.249
    netmask 255.255.252.0
    gateway 10.17.4.1

and then, restart the networking.

4, Run the cmd `ip r s` will get some route rule like this (these will be generate automatic):

root@debian:~# ip r s
default via 10.17.0.1 dev vlan170 onlink 
10.17.0.0/22 dev vlan170 proto kernel scope link src 10.17.3.249 
10.17.4.0/22 dev vlan174 proto kernel scope link src 10.17.7.249

Finish or you can change the route rule by yourself.

draft

rc.local not run while machine startup, maybe the rc.local file does not have the x(execute) auth

update and save iptables before reboot

unbind mac

svn cleanup less the drive space

https://unix.stackexchange.com/questions/65068/why-ssh-takes-a-long-time-to-connect

make UseDNS no

GSS no

for fast to connect to ssh remote

apache log dir need rx auth

no need to restart

grep '2018-10-26' /var/log/wol_client/wol_client.log|awk '{if($6=="0"){for(i=3;i<8;i++){$i=""}}else{$0=""}if($0!=""){print $0}}'

look rc.local

essential skill crontab all user

rc.local

cron.houly script need +x

apache's execute method file_put_contents need the auth to write, apache run no by root, so chmod 777 the file

python global define to change

cron.houly script need +x

apache's execute method file_put_contents need the auth to write, apache run no by root, so chmod 777 the file

python global define to change

sudo apt-get install curl && curl -L https://bootstrap.saltstack.com -o install_salt.sh && sudo sh install_salt.sh -P

sudo apt-get install curl && curl -L https://bootstrap.saltstack.com -o install_salt.sh && sudo sh install_salt.sh -M

SVN cm error maybe there are some .svn in the subdirectory

Ansible trouble shooting

1, get error below in client "/var/log/auth.log" file after ansible host ran the ping command return fault:

sshd[29378]: Connection closed by 10.17.64.13 [preauth]
10.17.19.250 | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: Connection to 10.17.19.250 timed out while waiting to read\r\n",
    "unreachable": true
}

solved:

iptables INPUT policy was DROP, although the ansible host 10.17.64.13 was accept, but the state wasn't be setted, so I should add this policy

"iptables -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT"

solved 2 from bubie liu:

Should use the right user to execute ansible host command

Protect Your Website

Welcome, this is the second time I rebuild this my personal website for recording some tips and documents.
After by hacked yesterday, I realize that your host will be hacked in some day whatever process the host running or however the host providing service.

Some article I lost:

vim tips

sed, awk usage

iptables, ipset, pfctl, netsh advfirewall firewall

dhcp failover configure

trap usage in shell script

manage deamon with supervisor

syslog date different from machine time and python import date module