To disable the internet and allow only SSH connection to this server running Red Hat Enterprise Linux release 8.9 (Ootpa)
Kaushal Shriyan <[email protected]> Fri, 8 Mar 2024 17:47:46 +0530
| Newsgroups | gmane.linux.redhat.general |
|---|---|
| Message-ID | <CAD7Ssm--BjP0+QTyRRD476im_HBwywBacq9TYbX5odkKA58Zmw@mail.gmail.com> |
--000000000000adc4ac0613252e63 Content-Type: text/plain; charset="UTF-8" Hi, I am running Red Hat Enterprise Linux release 8.9 (Ootpa). Is there a way to disable the internet and allow only SSH connection to this server? I have followed the below steps to disable internet access and allow only SSH connections to the remote server. #systemctl stop NetworkManager #systemctl disable NetworkManager #vim /etc/sysconfig/network-scripts/ifcfg-enp1s0 TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=none DEFROUTE=yes IPV4_FAILURE_FATAL=yes IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=eui64 NAME=enp1s0 UUID=86cea6e1-ec03-49e7-9d6d-1d1b9d094cdc DEVICE=enp1s0 ONBOOT=yes IPADDR=192.168.0.114 PREFIX=24 GATEWAY=192.168.0.10 DNS1=8.8.8.8 DNS2=8.8.4.4 ZONE=drop # systemctl restart network Failed to restart network.service: Unit network.service not found. # #firewall-cmd --permanent --zone=public --add-service=ssh #firewall-cmd --permanent --zone=public --remove-service=dhcpv6-client #firewall-cmd --reload #vim /etc/sysctl.conf net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 #sysctl -p ssh [email protected] ping google.com I am still able to reach out to google.com # ping google.com PING google.com (142.250.193.142) 56(84) bytes of data. 64 bytes from maa05s25-in-f14.1e100.net (142.250.193.142): icmp_seq=1 ttl=57 time=10.5 ms 64 bytes from maa05s25-in-f14.1e100.net (142.250.193.142): icmp_seq=2 ttl=57 time=10.1 ms 64 bytes from maa05s25-in-f14.1e100.net (142.250.193.142): icmp_seq=3 ttl=57 time=10.7 ms ^C --- google.com ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2003ms rtt min/avg/max/mdev = 10.147/10.452/10.701/0.258 ms Please guide me. Thanks in advance. Best Regards, Kaushal -- You received this message because you are subscribed to the Google Groups "[email protected]" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. --000000000000adc4ac0613252e63 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Hi,<br><div><br></div><div>I am running Red Hat Enterprise= Linux release 8.9 (Ootpa). Is there a way to disable the internet and allo= w only=C2=A0SSH connection to this server? I have followed the below steps = to disable internet access and allow only SSH connections to the remote ser= ver.</div><div><br>#systemctl stop NetworkManager<br>#systemctl disable Net= workManager<br><br>#vim /etc/sysconfig/network-scripts/ifcfg-enp1s0<br><br>= TYPE=3DEthernet<br>PROXY_METHOD=3Dnone<br>BROWSER_ONLY=3Dno<br>BOOTPROTO=3D= none<br>DEFROUTE=3Dyes<br>IPV4_FAILURE_FATAL=3Dyes<br>IPV6INIT=3Dyes<br>IPV= 6_AUTOCONF=3Dyes<br>IPV6_DEFROUTE=3Dyes<br>IPV6_FAILURE_FATAL=3Dno<br>IPV6_= ADDR_GEN_MODE=3Deui64<br>NAME=3Denp1s0<br>UUID=3D86cea6e1-ec03-49e7-9d6d-1d= 1b9d094cdc<br>DEVICE=3Denp1s0<br>ONBOOT=3Dyes<br>IPADDR=3D192.168.0.114<br>= PREFIX=3D24<br>GATEWAY=3D192.168.0.10<br>DNS1=3D8.8.8.8<br>DNS2=3D8.8.4.4<b= r>ZONE=3Ddrop<br><br># systemctl restart network<br>Failed to restart netwo= rk.service: Unit network.service not found.<br>#<br><br>#firewall-cmd --per= manent --zone=3Dpublic --add-service=3Dssh<br>#firewall-cmd --permanent --z= one=3Dpublic --remove-service=3Ddhcpv6-client<br>#firewall-cmd --reload<br>= <br>#vim /etc/sysctl.conf<br>net.ipv6.conf.all.disable_ipv6 =3D 1<br>net.ip= v6.conf.default.disable_ipv6 =3D 1<br><br>#sysctl -p<br><br>ssh <a href=3D"= mailto:[email protected]">[email protected]</a><br><br>ping <a href=3D"ht= tp://google.com">google.com</a><br><br><br>I am still able to reach out to = <a href=3D"http://google.com">google.com</a><br><br># ping <a href=3D"http:= //google.com">google.com</a><br>PING <a href=3D"http://google.com">google.c= om</a> (142.250.193.142) 56(84) bytes of data.<br>64 bytes from <a href=3D"= http://maa05s25-in-f14.1e100.net">maa05s25-in-f14.1e100.net</a> (142.250.19= 3.142): icmp_seq=3D1 ttl=3D57 time=3D10.5 ms<br>64 bytes from <a href=3D"ht= tp://maa05s25-in-f14.1e100.net">maa05s25-in-f14.1e100.net</a> (142.250.193.= 142): icmp_seq=3D2 ttl=3D57 time=3D10.1 ms<br>64 bytes from <a href=3D"http= ://maa05s25-in-f14.1e100.net">maa05s25-in-f14.1e100.net</a> (142.250.193.14= 2): icmp_seq=3D3 ttl=3D57 time=3D10.7 ms<br>^C<br>--- <a href=3D"http://goo= gle.com">google.com</a> ping statistics ---<br>3 packets transmitted, 3 rec= eived, 0% packet loss, time 2003ms<br>rtt min/avg/max/mdev =3D 10.147/10.45= 2/10.701/0.258 ms<br><br>Please guide me. Thanks in advance.=C2=A0<br><br>B= est Regards,<br><br>Kaushal<br></div></div> <p></p> -- <br /> You received this message because you are subscribed to the Google Groups &= quot;[email protected]" group.<br /> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a href=3D"mailto:[email protected]">redhat-list+u= [email protected]</a>.<br /> --000000000000adc4ac0613252e63--