Jump to content

Recommended Posts

Guest SoulAssassins
Posted

Hi, I wanna configure two gateway on one nic

 

2gwon1nic.png

 

Code:

$ ip r show

192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.2 metric 1

10.1.0.0/16 dev eth0 proto kernel scope link src 10.1.4.12

default via 192.168.1.1 dev eth0 proto static

Code:

$ cat route-eth0

192.168.1.0 via 192.168.1.1

Code:

in /etc/sysctl.conf

net.ipv4.ip_forward = 1

Code:

$ ip a show up

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN

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

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000

inet 192.168.1.2/24 brd 192.168.1.255 scope global eth0

inet 10.1.4.12/16 brd 10.1.255.255 scope global eth0:1

valid_lft forever preferred_lft forever

from host 10.1.5.9 I can ping 10.1.4.12, and from host 192.168.1.* can ping 192.168.1.2.

traceroute -i eth0 access, but is not passed traceroute -i eth0:1

 

What's wrong? )

Attached Images

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...