hostname WAN-Router
interface GigabitEthernet0/0
ip address 192.168.1.100 255.255.255.0
ip nat outside
no shutdown
interface GigabitEthernet0/1
ip address 192.168.2.254 255.255.255.0
ip nat inside
no shutdown
ip nat inside source static 192.168.2.100 interface GigabitEthernet0/0
ip route 0.0.0.0 0.0.0.0 192.168.1.1
Ubuntuサーバーがインターネットとアクセスできるように、NATを設定しています。
Router1 (IOSv)
hostname Router1
interface GigabitEthernet0/0
ip address 192.168.2.1 255.255.255.0
no shutdown
L2Switch1 (IOSvL2)
hostname L2Switch1
ExConnect
「BRIDGE」モードで起動します。
Ubuntu-DNS (Ubuntu)
sudo ip addr add 192.168.2.100/24 dev ens2
sudo ip route add default via 192.168.2.254
sudo systemd-resolve --interface ens2 --set-dns 192.168.1.1
WAN-Router#ping 192.168.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/9/13 ms
WAN-Router#ping 192.168.2.100
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.100, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 3/6/10 ms
Router1
ping 192.168.2.254
ping 192.168.2.100
Router1#ping 192.168.2.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 7/9/14 ms
Router1#ping 192.168.2.100
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.100, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/9/11 ms