GNS 토폴로지.png

Vyos

install image

conf
set service ssh port 22
set system gateway-address 10.0.0.1
set interfaces ethernet eth0 address 10.10.91.10/8
set interfaces ethernet eth1 address 192.168.102.252/24
set interfaces ethernet eth2 address 172.16.101.252/24

set protocols ospf parameters router-id 10.1.1.1
set protocols ospf area 0 network 192.168.102.0/24

commit

set nat source rule 1 source address 172.16.101.0/24
set nat source rule 1 translation address 10.10.91.100
set nat source rule 1 outbound-interface eth0

set nat destination rule 1 inbound-interface eth0
set nat destination rule 1 translation address 172.16.101.80
set nat destination rule 1 protocol tcp
set nat destination rule 1 destination port 80, 22
commit

#vyos 임시로 외부 통신을 위한 NAT 설정

set nat source rule 2 source address 192.168.102.0/24
set nat source rule 2 translation address 10.10.91.100
set nat source rule 2 outbound-interface eth0
commit

#Router 1

conf
interface FastEthernet0/0
ip address 192.168.102.100 255.255.255.0
no shutdown
interface FastEthernet1/0
ip address 192.168.103.10 255.255.255.128
no shutdown
interface FastEthernet2/0
ip address 192.168.103.130 255.255.255.128
no shutdown

router ospf 1
router-id 1.1.1.1
network 192.168.102.100 0.0.0.0 area 0
network 192.168.103.10 0.0.0.0 area 0
network 192.168.103.130 0.0.0.0 area 0

NAT
ip route 0.0.0.0 0.0.0.0 192.168.102.252
router os 1
default-information originate

access-list 1 permit 192.168.100.0 0.0.3.255
int f0/0
ip nat outside
int f1/0
ip nat inside
int f2/0
ip nat inside
ip nat inside source list 1 int f0/0 overload

#L3SW1

conf t
int f1/0
no switchport
ip address 192.168.103.20 255.255.255.128
no shutdown

int f1/5
switchport mode trunk
int f1/15
switchport mode trunk

vlan 100
exit
vlan 101
exit
int vlan 100
ip add 192.168.100.100 255.255.255.0
no shu
int vlan 101
ip add 192.168.101.100 255.255.255.0
no shu

int vlan 100
standby 100 ip 192.168.100.250
standby 100 track f1/0 50
standby 100 timer 1 3
standby 100 preempt delay reload 30
standby 100 priority 110

int vlan 101
standby 101 ip  192.168.101.250
standby 101 timer 1 3
standby 101 preempt 

router os 1
router-id 2.2.2.2
network 192.168.103.20 0.0.0.0 a 0
network 192.168.100.0 0.0.0.255 a 0
network 192.168.101.0 0.0.0.255 a 0

#L3SW2

conf t
int f1/0
no switchport
ip address 192.168.103.140 255.255.255.128
no shutdown

vlan 100
exit
vlan 101
exit
int vlan 100
ip add 192.168.100.200 255.255.255.0
no shu

int vlan 101
ip add 192.168.101.200 255.255.255.0
no shu

int f1/5
switchport mode trunk
int f1/15
switchport mode trunk

int vlan 100
standby 100 ip  192.168.100.250
standby 100 timer 1 3
standby 100 preempt 

int vlan 101
standby 101 ip  192.168.101.250
standby 101 track f1/0 50
standby 101 timer 1 3
standby 101 preempt delay reload 30
standby 101 priority 110

router os 1
router-id 3.3.3.3
network 192.168.103.140 0.0.0.0 a 0
network 192.168.100.0 0.0.0.255 a 0
network 192.168.101.0 0.0.0.255 a 0

#SW1

conf t

vlan 100
exit
vlan 101
exit

int range f1/5 , f1/15
switchport mode trunk

int f1/0
switchport mode access
switchport access vlan 100

#SW2

conf t

vlan 100
exit
vlan 101
exit

int range f1/5 , f1/15
switchport mode trunk

int f1/10
switchport mode access
switchport access vlan 101