Exam EX200 All QuestionsBrowse all questions from this exam
Question 47

SIMULATION -

There are two different networks, 192.168.0.0/24 and 192.168.1.0/24. Your System is in 192.168.0.0/24 Network. One RHEL6 Installed System is going to use as a Router. All required configuration is already done on Linux Server. Where 192.168.0.254 and 192.168.1.254 IP Address are assigned on that Server. How will make successfully ping to 192.168.1.0/24 Network's Host?

    Correct Answer:

    To successfully ping a host in the 192.168.1.0/24 network from the 192.168.0.0/24 network, you need to ensure that IP forwarding is enabled on the router (RHEL6 system). Here are the steps to achieve this: 1. Enable IP forwarding: Edit the file /etc/sysctl.conf and add or modify the line net.ipv4.ip_forward=1 to enable IP forwarding. Apply the changes with the command sysctl -p. This ensures that the configuration persists across reboots. 2. Configure the default gateway: Open the file /etc/sysconfig/network-scripts/ifcfg-eth0 and add the line GATEWAY=192.168.0.254 (for the network interface connected to 192.168.0.0/24) if not already present. Restart the network service to apply the changes with service network restart. This configuration routes packets from the 192.168.0.0/24 network to the 192.168.1.0/24 network via 192.168.0.254. Additionally, verify the connectivity by pinging the gateway (192.168.0.254) and then the target network (192.168.1.0/24).

Discussion
cookieb

nmtui -> edit connection -> routing <edit> -> add route much easier to remember

AbidBajwa

I think we need to allow IP Forwarding to allow traffic to access each other. sysctl -w net.ipv4.ip_forward=1

wizojlo

True, it is about IP forwarding, but above solution will not survive reboot. echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.d/ipforward.conf sysctl -p reboot sysctl net.ipv4.ip_forward (to verify; should return a value of 1)

STFN2019

Question unclear, propably just to setup a default gateway for connection to work between these 2 networks, fair enough.

Hmenu0s

Assuming the default gateway here is different and we need to add additional route to reach the 192.168.1.0/24 network. # get the connection holding the ip of 192.168.0.0/24 network ip -br a nmcli con show # Ping the router ip to check connectivity ping 192.168.0.254 # Add a permanent route to 192.168.1.0/24 via 192.168.0.254 on the connection identified above. in this example that connection is static-enp0s3 sudo nmcli con modify static-enp0s3 +ipv4.routes "192.168.1.0/24 198.168.0.254" sudo nmcli con up static-enp0s3 # check the routes and test the connectivity ip r nmcli con show static-enp0s3 | grep routes ping 192.168.1.254