This is a discussion on Strange question - second subnet in my router within the Linux Networking forums, part of the Linux Forums category; Dear all, I have a pc with linux which play as router in my office. Here is my originally setting : ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Dear all,
I have a pc with linux which play as router in my office. Here is my originally setting : 192.168.1.x/24 --LAN-- (192.168.1.1 (PC-linux) 192.168.17.212) --WAN-- 2 NIC in my PC-linux, one of them is eth0(192.168.1.1) as my lan gateway and the other eth1(192.168.17.212) as my wan ip.All PCs in lan access internet via PC-linux. For some reason, I have to extend my PC-linux ability to handle the second lan. And I use "ip addr" command to achieve this request. My command is - ip addr add 192.168.111.111/24 dev eth0. I can attach 2nd lan to eth0 successfully and it can access internet smoothly. The question is that when PCs in 2nd lan try to access my PC-linux's WAN IP(192.179.17.212), PC-linux always send these packets to WAN instead of sending to 2nd lan.But my 1st lan(192.168.1.x) can access without any problem. At first I think this may be a iptable or routed issue, but after flush iptable and check routing table I still can't resolve this problem. My routing table is # route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.0 * 255.255.255.0 U 0 0 0 eth0 192.168.17.0 * 255.255.255.0 U 0 0 0 eth1 192.168.111.0 * 255.255.255.0 U 0 0 0 eth0 default 192.168.17.70 0.0.0.0 UG 0 0 0 eth1 My ip address list is # ip addr l 1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo 6: eth1: <BROADCAST,NOTRAILERS,UP> mtu 1500 qdisc htb qlen 100 link/ether 00:04:ed:45:88:25 brd ff:ff:ff:ff:ff:ff inet 192.168.17.212/24 brd 192.168.17.255 scope global eth1 inet 192.168.17.212/32 scope global eth1 7: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc htb qlen 100 link/ether 00:26:66:45:88:24 brd ff:ff:ff:ff:ff:ff inet 192.168.1.1/24 brd 192.168.1.255 scope global eth0 inet 192.168.111.111/24 scope global eth0 Any ideas?? Thanks.. |