November
18
November
18
Linux: Bonding – Generic with mode 0
nano /etc/modprobe.d/bond1.conf
alias bond0 bonding
options bond0 mode=0 miimon=100
nano /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.0.4
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
ONBOOT=yes
BOOTPROTO=none
TYPE=Bond
BONDING_MASTER=yes
PREFIX=24
DEFROUTE=yes
NAME="Bond bond0"
BONDING_OPTS="mode=active-backup miimon=0 arp_ip_target=192.168.0.2 arp_interval=1000"
LAST_CONNECT=1530826407
NM_CONTROLLED=no
nano /etc/sysconfig/network-scripts/ifcfg-bond1
DEVICE=bond1
TYPE=Bond
BONDING_MASTER=yes
NAME=bond1
ONBOOT=yes
BONDING_OPTS="mode=4 miimon=100"
NM_CONTROLLED=no
Force a failover
ifenslave -c bond0 nic-id
Look at bonding state
cat /proc/net/bonding/bond0
November
18
Linux: Network Connection Speed information
1. ifconfig (to find ethernet card name)
p5p1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::c15d:1159:3654:2fc6 prefixlen 64 scopeid 0x20<link>
ether 00:0a:f7:a4:13:18 txqueuelen 1000 (Ethernet)
RX packets 349930173 bytes 29236710276 (27.2 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1149185442 bytes 16287580311793 (15.7 TiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
2. dmesg | grep p5p1
[ 14.659351] IPv6: ADDRCONF(NETDEV_UP): p5p1: link is not ready
[ 14.697067] bnxt_en 0000:05:00.0 p5p1: NIC Link is Up, 10000 Mbps full duplex, Flow control: none
[ 14.697072] bnxt_en 0000:05:00.0 p5p1: EEE is not active
3.ethtool p5p1
Settings for p5p1:
Supported ports: [ TP ]
Supported link modes: 1000baseT/Full
10000baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 1000baseT/Full
10000baseT/Full
Advertised pause frame use: Symmetric
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Speed: 10000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 12
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: d
Wake-on: d
Current message level: 0x00000000 (0)
Link detected: yes
November
18
Linux: Network list ethernet harware with specific configuration details
November
18
Linux: Setting up a static route
Temporary:
Linux add a default route using route command
Route all traffic via 192.168.1.254 gateway connected via eth0 network interface:
# route add default gw 192.168.1.254 eth0
Linux add a default gateway (route) using ip command
Route all traffic via 192.168.1.254 gateway connected via eth0 network interface:
# ip route add 192.168.1.0/24 dev eth0
Persistent:
RHEL/CentOS/Fedora/Scientific Linux persistent routing configuration
Edit /etc/sysconfig/network and set default gateway IP address:
# vi /etc/sysconfig/network
Sample outputs:
## setup default gateway ##
GATEWAY=192.168.1.254
You can add additional static route for eth0 by editing /etc/sysconfig/network-scripts/route-eth0 file as follows:
192.168.12.0/24 via 192.168.1.56 dev eth0
The above config sets static routing for network 192.168.12.0/24 via 192.168.1.1 router.
The address 192.168.1.1 is the IP address leading to the remote network. It is preferably the next hop address but the address of the exit interface will work. The “next hop” means the remote end of a link, for example a gateway or router. The dev option can be used to specify the exit interface interface but it is not required. Add as many static routes as required.
Debian / Ubuntu Linux persistence static routing configuration
Edit /etc/network/interfaces file, enter:
# vi /etc/network/interfaces
Append the following in eth0 section:
up route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.254
down route del -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.254
Save and close the file.