How To Assign Ip In Linux?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1. Connect to your Linux system using the shell prompt.
2. Enter the command ‘ifconfig’ to view your current IP address.
3. Enter the command ‘sudo ifconfig eth0 [IP address] netmask [netmask]’, replacing the placeholders with your desired IP address and its associated netmask.
4. Enter the command ‘sudo route add default gw [gateway]’, replacing the placeholder with your router’s IP address.
5. To save your settings, enter the command ‘sudo /etc/init.d/network restart’.
6. To verify your new IP address, enter the command ‘ifconfig’.
1. Use the command “ifconfig” to view the current IP address configuration.
2. Use the command “sudo ifconfig [interface] [IP address] netmask [mask] up” to assign a new IP address to the interface.
3. Use the command “sudo route add default gw [IP address]” to set the default gateway.
4. Use the command “sudo /etc/init.d/network restart” to restart the network.
5. Use the command “ping [IP address]” to test the connection.