编辑配置
/sbin/service network restart /sbin/ip link add link eth0 name vlan2 type vlan id 2 /sbin/ip link add link eth0 name vlan3 type vlan id 3 /sbin/ip link add link eth0 name vlan4 type vlan id 4 /sbin/ip link add link eth0 name vlan5 type vlan id 5 /sbin/ip link add link eth0 name vlan6 type vlan id 6 /sbin/ip link add link eth0 name vlan7 type vlan id 7 /sbin/ip link add link eth0 name vlan8 type vlan id 8 /sbin/ip link set dev vlan2 up /sbin/ip link set dev vlan3 up /sbin/ip link set dev vlan4 up /sbin/ip link set dev vlan5 up /sbin/ip link set dev vlan6 up /sbin/ip link set dev vlan7 up /sbin/ip link set dev vlan8 up /sbin/ip addr replace 10.86.1.17/28 dev vlan2 /sbin/ip addr replace 10.86.1.33/28 dev vlan3 /sbin/ip addr replace 10.86.1.49/28 dev vlan4 /sbin/ip addr replace 10.86.1.65/28 dev vlan5 /sbin/ip addr replace 10.86.1.81/28 dev vlan6 /sbin/ip addr replace 10.86.1.97/28 dev vlan7 /sbin/ip addr replace 10.86.1.113/28 dev vlan8 /sbin/sysctl net.ipv4.ip_forward=1 /sbin/service iptables restart /sbin/iptables -t filter -I FORWARD -j ACCEPT /sbin/ip route replace 10.86.1.128/28 via 10.86.1.116
时间: 2024-10-10 08:33:05