要在Ubuntu系统上配置网关,您需要编辑网络接口配置文件。以下是一个简单的步骤来配置网关:
sudo nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1
保存并关闭文件。在Nano编辑器中,您可以按下Ctrl + X,然后按Y确认更改并按Enter键保存文件。
重新启动网络服务以应用更改:
sudo systemctl restart networking
现在您已经成功配置了网关。您可以使用以下命令来检查网络接口配置是否正确:
ip route
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:ubuntu如何设置默认网关