Netplan
enp1s0 은 mtu 1500, default route, 학내망, 기본 인터넷 이용
enp7s0 은 mtu 9000, 특정 대역만 통신
# cat /etc/netplan/50-cloud-init.yaml network: version: 2 ethernets: enp1s0: mtu: 1500 addresses: - aaa.bbb.207.9/24 nameservers: addresses: - 8.8.8.8 routes: - to: default via: aaa.bbb.207.1 enp7s0: mtu: 9000 addresses: - ccc.ddd.248.239/24 routes: - to: ccc.ddd.248.0/24 via: ccc.ddd.248.1 - to: 1.1.1.0/24 via: ccc.ddd.248.1 # netplan apply
Interfaces
# ip addr 1: lo: 2: enp1s0: mtu 1500 inet aaa.bbb.207.9/24 brd aaa.bbb.207.255 scope global enp1s0 3: enp7s0: mtu 9000 inet ccc.ddd.248.239/24 brd aaa.bbb.248.255 scope global enp7s0
Routes
# ip route default via aaa.bbb.207.1 dev enp1s0 proto static 1.1.1.0/24 via ccc.ddd.207.1 dev enp7s0 proto static aaa.bbb.207.0/24 dev enp1s0 proto kernel scope link src aaa.bbb.207.9 ccc.ddd.207.0/24 dev enp7s0 proto kernel scope link src ccc.ddd.207.239 ccc.ddd.207.0/24 via ccc.ddd.207.1 dev enp7s0 proto static
Ping
# ping -c 8.8.8.8 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=119 time=49.1 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=119 time=49.1 ms 64 bytes from 8.8.8.8: icmp_seq=3 ttl=119 time=49.1 ms --- 8.8.8.8 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2002ms rtt min/avg/max/mdev = 49.134/49.138/49.144/0.004 ms # ping -c 3 ccc.ddd.207.1 PING ccc.ddd.207.1 (ccc.ddd.207.1) 56(84) bytes of data. 64 bytes from ccc.ddd.207.1: icmp_seq=1 ttl=255 time=0.296 ms 64 bytes from ccc.ddd.207.1: icmp_seq=2 ttl=255 time=0.340 ms 64 bytes from ccc.ddd.207.1: icmp_seq=3 ttl=255 time=0.508 ms --- ccc.ddd.207.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2029ms rtt min/avg/max/mdev = 0.296/0.381/0.508/0.091 ms # ping -c 3 aaa.bbb.207.1 PING aaa.bbb.207.1 (aaa.bbb.207.1) 56(84) bytes of data. 64 bytes from aaa.bbb.207.1: icmp_seq=1 ttl=255 time=1.12 ms 64 bytes from aaa.bbb.207.1: icmp_seq=2 ttl=255 time=0.795 ms 64 bytes from aaa.bbb.207.1: icmp_seq=3 ttl=255 time=0.980 ms --- aaa.bbb.207.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2001ms rtt min/avg/max/mdev = 0.795/0.965/1.120/0.133 ms # ping -c 3 1.1.1.1 PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data. 64 bytes from 1.1.1.1: icmp_seq=1 ttl=53 time=132 ms 64 bytes from 1.1.1.1: icmp_seq=2 ttl=53 time=132 ms 64 bytes from 1.1.1.1: icmp_seq=3 ttl=53 time=132 ms --- 1.1.1.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2002ms rtt min/avg/max/mdev = 131.614/131.828/132.256/0.302 ms
Tcpdump on default route (interface)
# tcpdump -n -nn icmp -i enp1s0 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on enp1s0, link-type EN10MB (Ethernet), capture size 262144 bytes 06:05:39.599812 IP aaa.bbb.207.9 > 8.8.8.8: ICMP echo request, id 20, seq 1, length 64 06:05:39.648941 IP 8.8.8.8 > aaa.bbb.207.9: ICMP echo reply, id 20, seq 1, length 64 06:05:40.601012 IP aaa.bbb.207.9 > 8.8.8.8: ICMP echo request, id 20, seq 2, length 64 06:05:40.650132 IP 8.8.8.8 > aaa.bbb.207.9: ICMP echo reply, id 20, seq 2, length 64 06:05:41.602205 IP aaa.bbb.207.9 > 8.8.8.8: ICMP echo request, id 20, seq 3, length 64 06:05:41.651317 IP 8.8.8.8 > aaa.bbb.207.9: ICMP echo reply, id 20, seq 3, length 64 06:05:58.406954 IP aaa.bbb.207.9 > aaa.bbb.207.1: ICMP echo request, id 22, seq 1, length 64 06:05:58.408068 IP aaa.bbb.207.1 > aaa.bbb.207.9: ICMP echo reply, id 22, seq 1, length 64 06:05:59.408253 IP aaa.bbb.207.9 > aaa.bbb.207.1: ICMP echo request, id 22, seq 2, length 64 06:05:59.409020 IP aaa.bbb.207.1 > aaa.bbb.207.9: ICMP echo reply, id 22, seq 2, length 64 06:06:00.408366 IP aaa.bbb.207.9 > aaa.bbb.207.1: ICMP echo request, id 22, seq 3, length 64 06:06:00.409320 IP aaa.bbb.207.1 > aaa.bbb.207.9: ICMP echo reply, id 22, seq 3, length 64 ^C 12 packets captured 12 packets received by filter 0 packets dropped by kernel
Tcpdump on the second static route (interface)
# tcpdump -n -nn icmp -i enp7s0 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on enp7s0, link-type EN10MB (Ethernet), capture size 262144 bytes 06:05:52.943174 IP ccc.ddd.207.239 > ccc.ddd.207.1: ICMP echo request, id 21, seq 1, length 64 06:05:52.943456 IP ccc.ddd.207.1 > ccc.ddd.207.239: ICMP echo reply, id 21, seq 1, length 64 06:05:53.948355 IP ccc.ddd.207.239 > ccc.ddd.207.1: ICMP echo request, id 21, seq 2, length 64 06:05:53.948668 IP ccc.ddd.207.1 > ccc.ddd.207.239: ICMP echo reply, id 21, seq 2, length 64 06:05:54.972374 IP ccc.ddd.207.239 > ccc.ddd.207.1: ICMP echo request, id 21, seq 3, length 64 06:05:54.972850 IP ccc.ddd.207.1 > ccc.ddd.207.239: ICMP echo reply, id 21, seq 3, length 64 06:19:44.006848 IP ccc.ddd.248.239 > 1.1.1.1: ICMP echo request, id 24, seq 1, length 64 06:19:44.138421 IP 1.1.1.1 > ccc.ddd.248.239: ICMP echo reply, id 24, seq 1, length 64 06:19:45.007389 IP ccc.ddd.248.239 > 1.1.1.1: ICMP echo request, id 24, seq 2, length 64 06:19:45.138983 IP 1.1.1.1 > ccc.ddd.248.239: ICMP echo reply, id 24, seq 2, length 64 06:19:46.008345 IP ccc.ddd.248.239 > 1.1.1.1: ICMP echo request, id 24, seq 3, length 64 06:19:46.139936 IP 1.1.1.1 > ccc.ddd.248.239: ICMP echo reply, id 24, seq 3, length 64 ^C 12 packets captured 12 packets received by filter 0 packets dropped by kernel