私はLinux初心者です(CentOS 7を使用しています)。 2つのネットワークカードを持つワークステーションがあります。それぞれが独自のWANを持つように構成しました。ただし、同時にアクセス(pingを使用)することはできません。
- 最初のWAN:172.16.0.1
- 2番目のWAN:10.101.0.10
詳細については、次の出力を確認してください。
[root@localhost network-scripts]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default gateway 0.0.0.0 UG 101 0 0 ens192
default gateway 0.0.0.0 UG 102 0 0 ens160
10.101.0.0 0.0.0.0 255.255.0.0 U 102 0 0 ens160
172.16.0.0 0.0.0.0 255.255.255.0 U 101 0 0 ens192
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
Emad Helal <[email protected]>
00:22 (5 minutes ago)
to me
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:0c:29:bf:9c:a5 brd ff:ff:ff:ff:ff:ff
inet 10.101.3.44/16 brd 10.101.255.255 scope global noprefixroute ens160
valid_lft forever preferred_lft forever
inet6 fe80::b66e:4822:ba8c:e806/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:0c:29:bf:9c:af brd ff:ff:ff:ff:ff:ff
inet 172.16.0.8/24 brd 172.16.0.255 scope global noprefixroute ens192
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:febf:9caf/64 scope link
valid_lft forever preferred_lft forever
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:72:52:14 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
link/ether 52:54:00:72:52:14 brd ff:ff:ff:ff:ff:ff
[root@localhost network-scripts]# ping www.google.com
PING www.google.com (216.58.205.196) 56(84) bytes of data.
64 bytes from mrs09s09-in-f4.1e100.net (216.58.205.196): icmp_seq=1 ttl=115 time=38.1 ms
64 bytes from mrs09s09-in-f4.1e100.net (216.58.205.196): icmp_seq=2 ttl=115 time=38.1 ms
64 bytes from mrs09s09-in-f4.1e100.net (216.58.205.196): icmp_seq=3 ttl=115 time=38.1 ms
64 bytes from mrs09s09-in-f4.1e100.net (216.58.205.196): icmp_seq=4 ttl=115 time=38.1 ms
64 bytes from mrs09s09-in-f4.1e100.net (216.58.205.196): icmp_seq=5 ttl=115 time=38.2 ms
64 bytes from mrs09s09-in-f4.1e100.net (216.58.205.196): icmp_seq=6 ttl=115 time=38.4 ms
64 bytes from mrs09s09-in-f4.1e100.net (216.58.205.196): icmp_seq=7 ttl=115 time=38.2 ms
^C
--- www.google.com ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 6007ms
rtt min/avg/max/mdev = 38.117/38.215/38.482/0.119 ms
[root@localhost network-scripts]# ping 172.16.0.1
PING 172.16.0.1 (172.16.0.1) 56(84) bytes of data.
64 bytes from 172.16.0.1: icmp_seq=1 ttl=255 time=1.64 ms
64 bytes from 172.16.0.1: icmp_seq=2 ttl=255 time=0.536 ms
64 bytes from 172.16.0.1: icmp_seq=3 ttl=255 time=0.536 ms
64 bytes from 172.16.0.1: icmp_seq=4 ttl=255 time=0.554 ms
64 bytes from 172.16.0.1: icmp_seq=5 ttl=255 time=0.554 ms
64 bytes from 172.16.0.1: icmp_seq=6 ttl=255 time=0.552 ms
64 bytes from 172.16.0.1: icmp_seq=7 ttl=255 time=0.550 ms
^Z
[1]+ Stopped ping 172.16.0.1
[root@localhost network-scripts]# ping 10.127.111.1
PING 10.127.111.1 (10.127.111.1) 56(84) bytes of data.
IP 10.127.111.1はGW専用回線:172.16.0.1に接続されています。 2番目のネットワークカード(WAN:10.101.0.10)をオフにすると、10.127.111.1が再生されます。これら2枚のカードをどのように受け取ることができますか?
ありがとう:)