ip address add address=192.168.1.21/24 interface=ether1
ip address add address=192.168.0.1/24 interface=ether2
ip route add gateway=192.168.1.1
ip dns set servers=192.168.1.1
OpenWRT配置192.168.0.1/24路由:
route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.1.21 dev br-lan
ROS配置DHCP服务:
ip pool add ranges=192.168.1.100-192.168.1.254 name=dhcp
ip dhcp-server add address-pool=dhcp interface=bridge-local disabled=no
ip dhcp-server network add address=192.168.1.0/24 gateway=192.168.1.1 dns-server=192.168.1.1
ROS开启NAT转发服务:
ip firewall nat add chain=srcnat src-address=192.168.0.0/24 action=masquerade out-interface=ether1