Ip

From UVOO Tech Wiki
Revision as of 04:16, 22 March 2020 by Busk (talk | contribs)
Jump to navigation Jump to search

iproute2 and other ip resources on linux

Sites

change portchannel 2 settings to 802.1q

conf t int port-chan 2 switchport trunk encapsulation dot1q switchport trunk allowed vlan 101-104 switchport mode trunk end Here you can manually add it without downtime or you can make it permanent and restart networking

ip link add name bond1.101 link bond1 type vlan id 101 ip addr add 10.1.1.11/24 dev bond1.101 ip link set dev bond1.101 up Make it permanent on network restart

auto bond1.101

iface bond1.101 inet manual

iface bond1.101 inet static

    address 10.1.1.11
    netmask 255.255.255.0
       vlan_raw_device bond0

systemctl restart networking

ip route add 10.0.0.0/16 via 10.0.1.1 dev bond0

ip route add 0.0.0.0/0 via 10.1.1.1 dev bond1.101

manual

ip link add name bond1.101 link bond1 type vlan id 101 ip addr add 10.1.1.11/24 dev bond1.101 ip link set dev bond1.101 up

down

ip link del name bond1.101 link bond1 type vlan id 101

ip link del dev bond1.101 ip addr del 10.1.1.11/24 dev bond1.101 ip link set dev bond1.101 down

vconfig add bond1 101 ip addr add 10.1.1.11/24 dev bond1.101 ip link set up bond1.101

DEVICE=eth1.10 BOOTPROTO=none ONBOOT=yes IPADDR=192.168.10.1 PREFIX=24 NETWORK=192.168.10.0 VLAN=yes

systemctl restart network

cat /proc/net/vlan/config