图形界面是无法调整的,需要SSH连接飞牛,用命令行配置:
以内网网口eth0,外网网口eth1为例:
设置静态路由 sudo ip route add default via 外网网关 dev eth1
开启IP转发 sudo sysctl -w net.ipv4.ip_forward=1
编辑 网络配置文件 sudo nano /etc/network/interfaces
添加下列内容:
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 外网网关
dns-nameservers 8.8.8.8 114.114.114.114
Ctrl + O 保存 Ctrl + X 退出
调整防火墙规则:
允许外网流量 sudo ufw allow out on eth1 to any
允许内网访问 sudo ufw allow in on eth0 to any
设置外网口MTU sudo ifconfig eth1 mtu 1500