《Centos7 防火牆習題二》

2021-10-24 19:03:02 字數 2659 閱讀 2614

snat策略應該應用在哪個鏈中( b )[選擇1項]

a.prerouting b. postrouting c. input d. output

dnat策略應該應用在哪個鏈中 ( a )[選擇1項]

a. prerouting b. postrouting c. input d. output

開啟「路由**」功能的配置項應該寫在以下哪個檔案中( c )[選擇1項][選擇1項]

a. /etc/sysconfig/sysctl.conf b. /var/sysctl.conf

c. /etc/sysctl.conf d. /boot/sysctl.conf

修改了上面一題中的檔案後,我們需要執行哪個命令來讓修改生效( b )[選擇1項]

a. sysctl b. sysctl -p c. sysctl -t d. sysctl -h

若希望臨時開啟「路由**」功能可以執行哪個命令( c )[選擇1項]

a. echo 「1」 > /proc/net/sys/ipv4/ip_forward b. echo 「1」 > /proc/net/ipv4/ip_forward

c. echo 「1」 > /proc/sys/net/ipv4/ip_forward d. echo 「1」 > /proc/ipv4/ip_forward

對於「主機型」防火牆和「網路型」防火牆的描述正確的是( bc )[選擇2項]

a. 「主機型」防火牆多會配置 forward 鏈 b. 「網路型」防火牆多會配置forward鏈

c. 「主機型」防火牆多會配置 input 鏈 d. 「網路型」防火牆多會配置 input 鏈

「net.ipv4.ip_default_ttl=128」 的作用是( d )[選擇1項]

a. 拒絕相應icmp請求 b. 拒絕相應icmp廣播 c. 開啟路由** d. 修改icmp響應超時

「net.ipv4.icmp_echo_ignore_all=1」 的作用是( a )[選擇1項]

a. 拒絕相應icmp請求 b. 拒絕相應icmp廣播 c. 開啟路由** d. 修改icmp響應超時

「net.ipv4.tcp_syn_resties=3」 的作用是( b )[選擇1項]

a. 拒絕相應icmp請求 b. 最大syn請求重試次數 c. 開啟路由** d.修改icmp響應超時

「net.ipv4.tcp_max_syn_backlog=3200」 的作用是( c )[選擇1項]

a. 拒絕相應icmp請求 b. 最大syn請求重試次數 c. syn請求佇列長度 d. 修改icmp響應超時

公司使用linux閘道器伺服器,通過adsl寬頻接入internet,並連線兩個區域網段192.168.1.0/24和192.168.2.0/24,請設定可行的snat策略,實現區域網共享上網。

iptables -t nat -a postrouting -s 192.168.1.0/24,192.168.20./24 -o eth0 -j masquerade

公司使用linux閘道器伺服器,固定的公網ip位址為202.15.16.17,請設定可行的dnat策略,發布內網的郵件伺服器192.168.1.8 。

iptables -t nat -a prerouting -i eth0 -d 202.15.16.17 -p tcp --dport 25 -j dnat --to-destination 192.168.1.8

公司使用linux閘道器伺服器,固定的公網ip位址為202.15.16.17,請正確配置閘道器策略,發布內網的ftp伺服器192.168.1.9 。

iptables -t nat -a prerouting -i eth0 -d 218.29.30.31 -p tcp --dport 21-j dnat --to-destination 192.168.1.9

通過調整/proc目錄下的相關引數,拒絕響應其他主機的ping請求。

/proc/sys/net/ipv4/icmp_echo_ignore_all(net.ipv4.icmp_echo_ignore_all=1)

1.課後實驗(要求通過指令碼實現下列防火牆規則要求)

實驗環境——公司使用雙網絡卡linux主機作為閘道器伺服器,其中網絡卡eth1連線區域網,網絡卡eth0通過光纖接入internet。由於只註冊了乙個公網ip位址,要求合理配置閘道器策略,使區域網內的pc機可以通過共享的方式訪問internet;並在internet中發布位於內網的**伺服器,作為公司的電子商務平台,

實驗要求——使區域網段192.168.1.0/24的pc機以共享接入的方式訪問internet 。

發布公司的**伺服器,當從internet中訪問 時,實際上由主機192.168.1.7提供網頁內容。

允許從internet遠端登入**伺服器,訪問位址為173.16.16.1,埠為2222 。

iptables -t nat -a postrouting -s 192.168.1.0/24 -o eth0 -j snat --to-source 192.168.22.111

iptables -t nat -a prerouting -i ech0 -d 173.16.16.1 -p tcp -dport 80 -j dnat --to 192.168.1.7

iptables -t nat -a prerouting -i ech0 -d 173.16.16.1 -p tcp -dport 2222 -j dnat --to 192.168.1.7

centos7防火牆配置

centos7防火牆配置 centos7使用的是linux kernel 3.10.0的核心版本,新版的kernel核心已經有了防火牆netfilter,並且firewalld的使用效能更高,穩定性更好。centos7配置防火牆的兩種方法 一 使用xml配置檔案的方式配置 方法一cp usr lib...

Centos7 關閉防火牆

centos7 關閉防火牆 centos 7.0預設使用的是firewall作為防火牆,使用iptables必須重新設定一下 1 直接關閉防火牆 systemctl stop firewalld.service 停止firewall systemctl disable firewalld.servi...

Centos7 關閉防火牆

1 直接關閉防火牆 systemctl stop firewalld.service 停止firewall systemctl disable firewalld.service 禁止firewall開機啟動 2 設定 iptables service yum y install iptables ...